Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_graphics_card_policy.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs_graphics_card_policy
3 - hosts: ucs
4 connection: local
5 gather_facts: false
6
7 vars:
8 org: AnsibleOrg
9
10 tasks:
11 - name: Test that we have a UCS hostname, UCS username, and UCS password
12 fail:
13 msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
14 when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
15 vars:
16 # use "<<: *login_info" to substite the information below in each task
17 # this is not required, however it makes the playbook shorter.
18 login_info: &login_info
19 hostname: "{{ ucs_hostname }}"
20 username: "{{ ucs_username }}"
21 password: "{{ ucs_password }}"
22
23 - name: Add UCS Organization
24 cisco.ucs.ucs_org:
25 <<: *login_info
26 org_name: "{{ org }}"
27 parent_org_path: root
28 description: "Org {{ org }}"
29 state: present
30 delegate_to: localhost
31
32 - name: Add Graphics Card Policy
33 cisco.ucs.ucs_graphics_card_policy:
34 <<: *login_info
35 state: present
36 org_dn: "org-root/org-{{ org }}"
37 description: Any Graphics Mode Policy
38 name: prod_graphics
39 graphics_card_mode: any-configuration
40 delegate_to: localhost
41
42 - name: Check Graphics Card Policy
43 cisco.ucs.ucs_graphics_card_policy:
44 <<: *login_info
45 state: present
46 org_dn: "org-root/org-{{ org }}"
47 description: Any Graphics Mode Policy
48 name: prod_graphics
49 graphics_card_mode: any-configuration
50 delegate_to: localhost
51 check_mode: True
52
53 - name: Add Graphics Card Policy
54 cisco.ucs.ucs_graphics_card_policy:
55 <<: *login_info
56 state: present
57 description: Any Graphics Mode Policy
58 name: any_graphics
59 graphics_card_mode: any-configuration
60 delegate_to: localhost
61
62 - name: Idempotent Graphics Card Policy
63 cisco.ucs.ucs_graphics_card_policy:
64 <<: *login_info
65 state: present
66 description: Any Graphics Mode Policy
67 name: any_graphics
68 graphics_card_mode: any-configuration
69 delegate_to: localhost
70
71 - name: Check Create/Update Graphics Card Policy
72 cisco.ucs.ucs_graphics_card_policy:
73 <<: *login_info
74 state: present
75 org_dn: "org-root/org-{{ org }}"
76 description: Compute Graphics Mode Policy
77 name: prod_graphics
78 graphics_card_mode: compute
79 delegate_to: localhost
80 check_mode: true
81
82 - name: Create/Update Graphics Card Policy
83 cisco.ucs.ucs_graphics_card_policy:
84 <<: *login_info
85 state: present
86 org_dn: "org-root/org-{{ org }}"
87 description: Compute Graphics Mode Policy
88 name: prod_graphics
89 graphics_card_mode: compute
90 delegate_to: localhost
91
92 - name: Delete Graphics Card Policy
93 cisco.ucs.ucs_graphics_card_policy:
94 <<: *login_info
95 state: absent
96 name: any_graphics
97 delegate_to: localhost
98
99 - name: Remove UCS Organization
100 cisco.ucs.ucs_org:
101 <<: *login_info
102 org_name: "{{ org }}"
103 parent_org_path: root
104 state: absent
105 delegate_to: localhost