Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_org.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_org
3 - hosts: ucs
4 connection: local
5 gather_facts: false
6
7 tasks:
8 - name: Test that we have a UCS hostname, UCS username, and UCS password
9 fail:
10 msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
11 when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
12 vars:
13 # use "<<: *login_info" to substite the information below in each task
14 # this is not required, however it makes the playbook shorter.
15 login_info: &login_info
16 hostname: "{{ ucs_hostname }}"
17 username: "{{ ucs_username }}"
18 password: "{{ ucs_password }}"
19
20 - name: Add UCS Organization
21 cisco.ucs.ucs_org:
22 <<: *login_info
23 org_name: test
24 description: testing org
25 state: present
26 delegate_to: localhost
27
28 - name: Update UCS Organization
29 cisco.ucs.ucs_org:
30 <<: *login_info
31 org_name: test
32 description: Testing org
33 state: present
34 delegate_to: localhost
35
36 - name: Remove UCS Organization
37 cisco.ucs.ucs_org:
38 <<: *login_info
39 org_name: test
40 state: absent
41 delegate_to: localhost
42
43 - name: Add UCS Organization
44 cisco.ucs.ucs_org:
45 <<: *login_info
46 org_name: level1
47 parent_org_path: root
48 description: level1 org
49 state: present
50 delegate_to: localhost
51
52 - name: Add UCS Organization
53 cisco.ucs.ucs_org:
54 <<: *login_info
55 org_name: level2
56 parent_org_path: root/level1
57 description: level2 org
58 state: present
59 delegate_to: localhost
60
61 - name: Add UCS Organization
62 cisco.ucs.ucs_org:
63 <<: *login_info
64 org_name: level3
65 parent_org_path: root/level1/level2
66 description: level3 org
67 state: present
68 delegate_to: localhost
69
70 - name: Remove UCS Organization
71 cisco.ucs.ucs_org:
72 <<: *login_info
73 org_name: level2
74 parent_org_path: root/level1
75 state: absent
76 delegate_to: localhost