Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_ip_pool.yml

raw symbols SCIP
1 ---
2 # Example Playbook: cisco.ucs.ucs_ip_pool
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: level1
24 parent_org_path: root
25 description: level1 org
26 state: present
27 delegate_to: localhost
28
29 - name: Configure IPv4 and IPv6 address pool
30 cisco.ucs.ucs_ip_pool:
31 <<: *login_info
32 name: ip-pool-01
33 org_dn: org-root/org-level1
34 ipv4_blocks:
35 - first_addr: 192.168.10.1
36 last_addr: 192.168.10.20
37 subnet_mask: 255.255.255.128
38 default_gw: 192.168.10.2
39 - first_addr: 192.168.11.1
40 last_addr: 192.168.11.20
41 subnet_mask: 255.255.255.128
42 default_gw: 192.168.11.2
43 ipv6_blocks:
44 - ipv6_first_addr: fe80::1cae:7992:d7a1:ed07
45 ipv6_last_addr: fe80::1cae:7992:d7a1:edfe
46 ipv6_default_gw: fe80::1cae:7992:d7a1:ecff
47 - ipv6_first_addr: fe80::1cae:7992:d7a1:ec07
48 ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe
49 ipv6_default_gw: fe80::1cae:7992:d7a1:ecff
50 delegate_to: localhost
51
52 - name: Remove IPv4 and IPv6 address pool blocks
53 cisco.ucs.ucs_ip_pool:
54 <<: *login_info
55 name: ip-pool-01
56 org_dn: org-root/org-level1
57 ipv4_blocks:
58 - first_addr: 192.168.10.1
59 last_addr: 192.168.10.20
60 state: absent
61 ipv6_blocks:
62 - ipv6_first_addr: fe80::1cae:7992:d7a1:ec07
63 ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe
64 state: absent
65 delegate_to: localhost
66
67 - name: Remove IPv4 and IPv6 address pool
68 cisco.ucs.ucs_ip_pool:
69 <<: *login_info
70 name: ip-pool-01
71 org_dn: org-root/org-level1
72 state: absent
73 delegate_to: localhost
74
75 - name: IP Pool - CIMC
76 cisco.ucs.ucs_ip_pool:
77 <<: *login_info
78 name: ext-mgmt-testing
79 org_dn: org-root/org-level1
80 description: CIMC IP Pool
81 ipv4_blocks:
82 - first_addr: 10.12.34.56
83 last_addr: 10.12.34.78
84 subnet_mask: 255.255.255.0
85 default_gw: 10.12.34.1
86 primary_dns: 4.2.2.2
87 secondary_dns: 8.8.8.8
88 delegate_to: localhost
89
90 - name: Idempotent IP Pool - CIMC
91 cisco.ucs.ucs_ip_pool:
92 <<: *login_info
93 name: ext-mgmt-testing
94 org_dn: org-root/org-level1
95 description: CIMC IP Pool
96 ipv4_blocks:
97 - first_addr: 10.12.34.56
98 last_addr: 10.12.34.78
99 subnet_mask: 255.255.255.0
100 default_gw: 10.12.34.1
101 primary_dns: 4.2.2.2
102 secondary_dns: 8.8.8.8
103 delegate_to: localhost
104
105 - name: Remove IP Pool - CIMC
106 cisco.ucs.ucs_ip_pool:
107 <<: *login_info
108 name: ext-mgmt-testing
109 org_dn: org-root/org-level1
110 state: absent
111 delegate_to: localhost
112
113 - name: Remove UCS Organization
114 cisco.ucs.ucs_org:
115 <<: *login_info
116 org_name: level1
117 parent_org_path: root
118 state: absent
119 delegate_to: localhost