Debian Codegraph @

ansible_collections/dellemc/openmanage/playbooks/ome/profile/ome_profile_unassign_job_tracking.yml

raw symbols SCIP
1 ---
2 - name: Dell OpenManage Ansible profile operations.
3 hosts: ome
4 gather_facts: false
5 vars:
6 retries_count: 120
7 polling_interval: 30 # 30 seconds x 120 times = 1 hour
8 failed_states:
9 ["Failed", "Warning", "Aborted", "Paused", "Stopped", "Canceled"]
10 completed_states:
11 [
12 "Completed",
13 "Failed",
14 "Warning",
15 "Aborted",
16 "Paused",
17 "Stopped",
18 "Canceled",
19 ]
20
21 tasks:
22 - name: Unassign using profile name
23 dellemc.openmanage.ome_profile:
24 hostname: "{{ hostname }}"
25 username: "{{ username }}"
26 password: "{{ password }}"
27 ca_path: "/path/to/ca_cert.pem"
28 command: "unassign"
29 name: "Profile 00003"
30 register: result
31 delegate_to: localhost
32
33 - name: End play when no job_id in result # noqa: no-handler
34 ansible.builtin.meta: end_play
35 when:
36 - not result.changed
37 - "'job_id' not in result"
38 delegate_to: localhost
39
40 - name: Get job details using job id
41 dellemc.openmanage.ome_job_info:
42 hostname: "{{ hostname }}"
43 username: "{{ username }}"
44 password: "{{ password }}"
45 ca_path: "/path/to/ca_cert.pem"
46 job_id: "{{ result.job_id }}"
47 register: job_result
48 failed_when:
49 - job_result.job_info.LastRunStatus.Name in "{{ failed_states }}"
50 changed_when: job_result.job_info.LastRunStatus.Name == 'Completed'
51 until: job_result.job_info.LastRunStatus.Name in "{{ completed_states }}"
52 retries: "{{ retries_count }}"
53 delay: "{{ polling_interval }}"
54 delegate_to: localhost