aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/infra-openstack/ansible/roles/create_network
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2021-04-23 12:10:38 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2021-04-26 09:28:08 +0200
commit72a3c7c62e37772b7680a02e5253f835c6420fb7 (patch)
tree3d4e277c5b0e1a05422bfa41403a562fa922e96b /deployment/noheat/infra-openstack/ansible/roles/create_network
parent87e526604b5817a8cc12ecfb2964a963c98dadcc (diff)
Flatten Ansible role structure
Given current constraints of CI Lab application of Ansible playbooks has to be divided into several stages (changing Ansible controller between them). This is why role structure can be flattened for increased readability. Issue-ID: INT-1601 Change-Id: I71f95649617e160f7887f03c6a96161fb8873c66 Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'deployment/noheat/infra-openstack/ansible/roles/create_network')
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/create_network.yml20
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/main.yml4
2 files changed, 24 insertions, 0 deletions
diff --git a/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/create_network.yml b/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/create_network.yml
new file mode 100644
index 000000000..5d86858c1
--- /dev/null
+++ b/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/create_network.yml
@@ -0,0 +1,20 @@
+---
+- name: "Create {{ net.name }} network"
+ os_network:
+ name: "{{ net.name }}"
+ state: present
+
+- name: "Create {{ net.name }} subnet"
+ os_subnet:
+ name: "{{ net.name }}_subnet"
+ network_name: "{{ net.name }}"
+ cidr: "{{ net.cidr }}"
+ state: present
+
+- name: "Create {{ net.name }} router"
+ os_router:
+ name: "{{ net.name }}_router"
+ network: public
+ interfaces:
+ - "{{ net.name }}_subnet"
+ state: present
diff --git a/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/main.yml
new file mode 100644
index 000000000..5e3ef67f5
--- /dev/null
+++ b/deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- include: create_network.yml net={{ item }}
+ loop:
+ - "{{ network }}"