aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/infra-openstack/ansible/roles/openstack
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/openstack
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/openstack')
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml33
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml3
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml25
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/create_network.yml20
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/main.yml4
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/create_securitygroup.yml21
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/main.yml6
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/destroy_host.yml5
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml3
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_keypair/tasks/main.yml12
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/destroy_network.yml10
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/main.yml4
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/destroy_securitygroup.yml5
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/main.yml4
14 files changed, 0 insertions, 155 deletions
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml
deleted file mode 100644
index c217abaa9..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-- name: Create host
- os_server:
- state: present
- name: "{{ host.name }}"
- image: "{{ host.image }}"
- flavor: "{{ host.flavor }}"
- key_name: "{{ host.keypair }}"
- network: "{{ host.network }}"
- security_groups:
- - "{{ host.securitygroup }}"
- auto_ip: "{{ host.auto_ip | default(true) }}"
- boot_from_volume: true
- terminate_volume: true
- volume_size: "{{ host.volume_size | default(10) }}"
- userdata: |
- #cloud-config
- ssh_authorized_keys:
- - "{{ operator_key }}"
- register: new_host
-
-- name: Add host to inventory
- add_host:
- hostname: "{{ new_host.server.name }}"
- groups: "{{ cluster.name }}"
- ansible_ssh_host: "{{ new_host.server.public_v4 }}"
- ansible_ssh_user: "{{ image.user }}"
- ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
- ansible_ssh_private_key_file: "~/.ssh/{{ keypair.key.name }}"
-
-- name: Add host to hosts dict
- set_fact:
- hosts_dict: "{{ hosts_dict|default({}) | combine( {new_host.server.name: new_host.server.private_v4} ) }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml
deleted file mode 100644
index 731bca04f..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-- include: create_host.yml host={{ item }}
- loop: "{{ hosts }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml
deleted file mode 100644
index a330875d8..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-- name: Create keypair
- os_keypair:
- state: present
- name: "{{ keypair.name }}"
- register: keypair
-
-- name: Create local public key
- local_action:
- module: copy
- content: "{{ keypair.key.public_key }}"
- dest: "~/.ssh/{{ keypair.key.name }}.pub"
- mode: 0600
-
-- name: Check if local private key exists
- stat:
- path: "~/.ssh/{{ keypair.key.name }}"
- register: local_private_key
-
-- name: Create local private key
- local_action:
- module: copy
- content: "{{ keypair.key.private_key }}"
- dest: "~/.ssh/{{ keypair.key.name }}"
- mode: 0600
- when: local_private_key.stat.exists == False
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/create_network.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/create_network.yml
deleted file mode 100644
index 5d86858c1..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/create_network.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- 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/openstack/create_devstack_network/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/main.yml
deleted file mode 100644
index 5e3ef67f5..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- include: create_network.yml net={{ item }}
- loop:
- - "{{ network }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/create_securitygroup.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/create_securitygroup.yml
deleted file mode 100644
index bd8abf564..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/create_securitygroup.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- name: "Create {{ secgrp.name }} security group"
- os_security_group:
- state: present
- name: "{{ secgrp.name }}"
-
-- name: "Create {{ secgrp.name }} security group rule for ping"
- os_security_group_rule:
- security_group: "{{ secgrp.name }}"
- protocol: icmp
- remote_ip_prefix: "{{ item }}"
- loop: "{{ secgrp.remote_ip_prefix }}"
-
-- name: "Create {{ secgrp.name }} security group rule for SSH"
- os_security_group_rule:
- security_group: "{{ secgrp.name }}"
- protocol: tcp
- port_range_min: 22
- port_range_max: 22
- remote_ip_prefix: "{{ item }}"
- loop: "{{ secgrp.remote_ip_prefix }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/main.yml
deleted file mode 100644
index d04b72c34..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/main.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- include: create_securitygroup.yml
- loop:
- - "{{ securitygroup }}"
- loop_control:
- loop_var: secgrp
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/destroy_host.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/destroy_host.yml
deleted file mode 100644
index e9cedce7a..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/destroy_host.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: Destroy host
- os_server:
- name: "{{ host.name }}"
- state: absent
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml
deleted file mode 100644
index 5ce130d44..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-- include: destroy_host.yml host={{ item }}
- loop: "{{ hosts }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_keypair/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_keypair/tasks/main.yml
deleted file mode 100644
index 6025b82b3..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_keypair/tasks/main.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-- name: Destroy keypair
- os_keypair:
- state: absent
- name: "{{ keypair.name }}"
-
-- name: Destroy local keypair
- file:
- state: absent
- path: "{{ item }}"
- loop:
- - "~/.ssh/{{ keypair.name }}.pub"
- - "~/.ssh/{{ keypair.name }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/destroy_network.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/destroy_network.yml
deleted file mode 100644
index 8f97d9507..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/destroy_network.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-- name: "Destroy {{ net.name }} router"
- os_router:
- name: "{{ net.name }}_router"
- state: absent
-
-- name: "Destroy {{ net.name }} network and its subnets"
- os_network:
- name: "{{ net.name }}"
- state: absent
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/main.yml
deleted file mode 100644
index e52dcbdb8..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- include: destroy_network.yml net={{ item }}
- loop:
- - "{{ network }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/destroy_securitygroup.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/destroy_securitygroup.yml
deleted file mode 100644
index eb86f9bc2..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/destroy_securitygroup.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: "Destroy {{ secgrp.name }} security group"
- os_security_group:
- state: absent
- name: "{{ secgrp.name }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/main.yml
deleted file mode 100644
index de098afec..000000000
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- include: destroy_securitygroup.yml secgrp={{ item }}
- loop:
- - "{{ securitygroup }}"