Debian Codegraph @

ansible_collections/dellemc/openmanage/playbooks/ome/profile/ome_profile_migrate_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: Migrate a profile
23 dellemc.openmanage.ome_profile:
24 hostname: "{{ hostname }}"
25 username: "{{ username }}"
26 password: "{{ password }}"
27 ca_path: "/path/to/ca_cert.pem"
28 command: "migrate"
29 name: "Profile 00001"
30 device_id: 12456
31 register: result
32 delegate_to: localhost
33
34 - name: End play when no job_id in result # noqa: no-handler
35 ansible.builtin.meta: end_play
36 when:
37 - not result.changed
38 - "'job_id' not in result"
39 delegate_to: localhost
40
41 - name: Get job details using job id
42 dellemc.openmanage.ome_job_info:
43 hostname: "{{ hostname }}"
44 username: "{{ username }}"
45 password: "{{ password }}"
46 ca_path: "/path/to/ca_cert.pem"
47 job_id: "{{ result.job_id }}"
48 register: job_result
49 failed_when:
50 - job_result.job_info.LastRunStatus.Name in "{{ failed_states }}"
51 changed_when: job_result.job_info.LastRunStatus.Name == 'Completed'
52 until: job_result.job_info.LastRunStatus.Name in "{{ completed_states }}"
53 retries: "{{ retries_count }}"
54 delay: "{{ polling_interval }}"
55 delegate_to: localhost