Debian Codegraph @

ansible_collections/cisco/ucs/playbooks/ucs_ipv4_pool_only.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 address pool
30 cisco.ucs.ucs_ip_pool:
31 <<: *login_info
32 name: ext-mgmt
33 org_dn: org-root/org-level1
34 description: CIMC IP Pool
35 ipv4_blocks:
36 - first_addr: 192.168.10.1
37 last_addr: 192.168.10.20
38 subnet_mask: 255.255.255.128
39 default_gw: 192.168.10.2
40 - first_addr: 192.168.11.1
41 last_addr: 192.168.11.20
42 subnet_mask: 255.255.255.128
43 default_gw: 192.168.11.2
44 delegate_to: localhost
45
46 - name: Remove IPv4 address pool blocks
47 cisco.ucs.ucs_ip_pool:
48 <<: *login_info
49 name: ext-mgmt
50 org_dn: org-root/org-level1
51 ipv4_blocks:
52 - first_addr: 192.168.10.1
53 last_addr: 192.168.10.20
54 state: absent
55 delegate_to: localhost
56
57 - name: Remove IPv4 address pool
58 cisco.ucs.ucs_ip_pool:
59 <<: *login_info
60 name: ext-mgmt
61 org_dn: org-root/org-level1
62 state: absent
63 delegate_to: localhost
64
65 - name: Remove UCS Organization
66 cisco.ucs.ucs_org:
67 <<: *login_info
68 org_name: level1
69 parent_org_path: root
70 state: absent
71 delegate_to: localhost