Debian Codegraph @

ansible_collections/dellemc/openmanage/playbooks/ome/powerstate/ome_powerstate_with_job_tracking.yml

raw symbols SCIP
1 ---
2 - name: "OME - Power state management job tracking."
3 hosts: ome
4 gather_facts: false
5 vars:
6 retries_count: 5
7 polling_interval: 5 # in seconds
8
9 tasks:
10 - name: Power state operation based on device id
11 dellemc.openmanage.ome_powerstate:
12 hostname: "{{ hostname }}"
13 username: "{{ username }}"
14 password: "{{ password }}"
15 ca_path: "/path/to/ca_cert.pem"
16 power_state: "off"
17 device_id: 11111
18 register: result
19 failed_when: "'job_status' not in result"
20 delegate_to: localhost
21
22 - name: Get job details using job id from power state operation.
23 dellemc.openmanage.ome_job_info:
24 hostname: "{{ hostname }}"
25 username: "{{ username }}"
26 password: "{{ password }}"
27 ca_path: "/path/to/ca_cert.pem"
28 job_id: "{{ result.job_status.Id }}"
29 register: job_result
30 failed_when: "'job_info' not in job_result"
31 until: job_result.job_info.LastRunStatus.Name == 'Completed' or job_result.job_info.LastRunStatus.Name == 'Failed'
32 retries: "{{ retries_count }}"
33 delay: "{{ polling_interval }}"
34 delegate_to: localhost