File: main.yml

package info (click to toggle)
python-openstacksdk 4.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,904 kB
  • sloc: python: 127,036; sh: 153; makefile: 23
file content (101 lines) | stat: -rw-r--r-- 2,340 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
- name: Create network
  os_network:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ network_name }}"
     external: "{{ network_external }}"

- name: Create subnet
  os_subnet:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ subnet_name }}"
     network_name: "{{ network_name }}"
     cidr: 10.5.5.0/24

- name: Create port (no security group or default security group)
  os_port:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ port_name }}"
     network: "{{ network_name }}"
     no_security_groups: "{{ no_security_groups }}"
     fixed_ips:
       - ip_address: 10.5.5.69
  register: port

- debug: var=port

- name: Delete port (no security group or default security group)
  os_port:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ port_name }}"

- name: Create security group
  os_security_group:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ secgroup_name }}"
     description: Test group

- name: Create port (with security group)
  os_port:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ port_name }}"
     network: "{{ network_name }}"
     fixed_ips:
       - ip_address: 10.5.5.69
     security_groups:
       - "{{ secgroup_name }}"
  register: port

- debug: var=port

- name: Delete port (with security group)
  os_port:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ port_name }}"

- name: Create port (with allowed_address_pairs and extra_dhcp_opts)
  os_port:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ port_name }}"
     network: "{{ network_name }}"
     no_security_groups: "{{ no_security_groups }}"
     allowed_address_pairs:
       - ip_address: 10.6.7.0/24
     extra_dhcp_opts:
       - opt_name: "bootfile-name"
         opt_value: "testfile.1"
  register: port

- debug: var=port

- name: Delete port (with allowed_address_pairs and extra_dhcp_opts)
  os_port:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ port_name }}"

- name: Delete security group
  os_security_group:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ secgroup_name }}"

- name: Delete subnet
  os_subnet:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ subnet_name }}"

- name: Delete network
  os_network:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ network_name }}"