From 72a3c7c62e37772b7680a02e5253f835c6420fb7 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorek Date: Fri, 23 Apr 2021 12:10:38 +0200 Subject: 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 --- .../noheat/infra-openstack/ansible/create.yml | 10 +++---- .../noheat/infra-openstack/ansible/destroy.yml | 10 +++---- .../roles/create_hosts/tasks/create_host.yml | 33 ++++++++++++++++++++++ .../ansible/roles/create_hosts/tasks/main.yml | 3 ++ .../ansible/roles/create_keypair/tasks/main.yml | 25 ++++++++++++++++ .../roles/create_network/tasks/create_network.yml | 20 +++++++++++++ .../ansible/roles/create_network/tasks/main.yml | 4 +++ .../tasks/create_securitygroup.yml | 21 ++++++++++++++ .../roles/create_securitygroup/tasks/main.yml | 6 ++++ .../roles/destroy_hosts/tasks/destroy_host.yml | 5 ++++ .../ansible/roles/destroy_hosts/tasks/main.yml | 3 ++ .../ansible/roles/destroy_keypair/tasks/main.yml | 12 ++++++++ .../destroy_network/tasks/destroy_network.yml | 10 +++++++ .../ansible/roles/destroy_network/tasks/main.yml | 4 +++ .../tasks/destroy_securitygroup.yml | 5 ++++ .../roles/destroy_securitygroup/tasks/main.yml | 4 +++ .../create_devstack_hosts/tasks/create_host.yml | 33 ---------------------- .../openstack/create_devstack_hosts/tasks/main.yml | 3 -- .../create_devstack_keypair/tasks/main.yml | 25 ---------------- .../tasks/create_network.yml | 20 ------------- .../create_devstack_network/tasks/main.yml | 4 --- .../tasks/create_securitygroup.yml | 21 -------------- .../create_devstack_securitygroup/tasks/main.yml | 6 ---- .../destroy_devstack_hosts/tasks/destroy_host.yml | 5 ---- .../destroy_devstack_hosts/tasks/main.yml | 3 -- .../destroy_devstack_keypair/tasks/main.yml | 12 -------- .../tasks/destroy_network.yml | 10 ------- .../destroy_devstack_network/tasks/main.yml | 4 --- .../tasks/destroy_securitygroup.yml | 5 ---- .../destroy_devstack_securitygroup/tasks/main.yml | 4 --- 30 files changed, 165 insertions(+), 165 deletions(-) create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/create_host.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_keypair/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/create_network.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_network/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/create_securitygroup.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/destroy_host.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_keypair/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/destroy_network.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/main.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/destroy_securitygroup.yml create mode 100644 deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/create_network.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_network/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/create_securitygroup.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_securitygroup/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/destroy_host.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_keypair/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/destroy_network.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_network/tasks/main.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/destroy_securitygroup.yml delete mode 100644 deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_securitygroup/tasks/main.yml (limited to 'deployment') diff --git a/deployment/noheat/infra-openstack/ansible/create.yml b/deployment/noheat/infra-openstack/ansible/create.yml index 5b9542195..69ecd1dd9 100644 --- a/deployment/noheat/infra-openstack/ansible/create.yml +++ b/deployment/noheat/infra-openstack/ansible/create.yml @@ -4,10 +4,10 @@ connection: local gather_facts: False roles: - - openstack/create_devstack_network - - openstack/create_devstack_securitygroup - - openstack/create_devstack_keypair - - role: openstack/create_devstack_hosts + - create_network + - create_securitygroup + - create_keypair + - role: create_hosts hosts: "{{ operation.hosts }}" operator_key: "dummy" - name: Create cluster operator access keypair @@ -25,7 +25,7 @@ connection: local gather_facts: False roles: - - role: openstack/create_devstack_hosts + - role: create_hosts hosts: "{{ cluster.hosts }}" operator_key: "{{ hostvars['operator0']['key']['public_key'] }}" - name: Create cluster operator access information diff --git a/deployment/noheat/infra-openstack/ansible/destroy.yml b/deployment/noheat/infra-openstack/ansible/destroy.yml index ca1455f5f..ff9d5fccf 100644 --- a/deployment/noheat/infra-openstack/ansible/destroy.yml +++ b/deployment/noheat/infra-openstack/ansible/destroy.yml @@ -4,10 +4,10 @@ connection: local gather_facts: False roles: - - role: openstack/destroy_devstack_hosts + - role: destroy_hosts hosts: "{{ cluster.hosts }}" - - role: openstack/destroy_devstack_hosts + - role: destroy_hosts hosts: "{{ operation.hosts }}" - - openstack/destroy_devstack_keypair - - openstack/destroy_devstack_network - - openstack/destroy_devstack_securitygroup + - destroy_keypair + - destroy_network + - destroy_securitygroup diff --git a/deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/create_host.yml b/deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/create_host.yml new file mode 100644 index 000000000..c217abaa9 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/create_host.yml @@ -0,0 +1,33 @@ +--- +- 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/create_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/main.yml new file mode 100644 index 000000000..731bca04f --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/create_hosts/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include: create_host.yml host={{ item }} + loop: "{{ hosts }}" diff --git a/deployment/noheat/infra-openstack/ansible/roles/create_keypair/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/create_keypair/tasks/main.yml new file mode 100644 index 000000000..a330875d8 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/create_keypair/tasks/main.yml @@ -0,0 +1,25 @@ +- 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/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 }}" diff --git a/deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/create_securitygroup.yml b/deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/create_securitygroup.yml new file mode 100644 index 000000000..bd8abf564 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/create_securitygroup.yml @@ -0,0 +1,21 @@ +--- +- 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/create_securitygroup/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/main.yml new file mode 100644 index 000000000..d04b72c34 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/create_securitygroup/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- include: create_securitygroup.yml + loop: + - "{{ securitygroup }}" + loop_control: + loop_var: secgrp diff --git a/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/destroy_host.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/destroy_host.yml new file mode 100644 index 000000000..e9cedce7a --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/destroy_host.yml @@ -0,0 +1,5 @@ +--- +- name: Destroy host + os_server: + name: "{{ host.name }}" + state: absent diff --git a/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/main.yml new file mode 100644 index 000000000..5ce130d44 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_hosts/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include: destroy_host.yml host={{ item }} + loop: "{{ hosts }}" diff --git a/deployment/noheat/infra-openstack/ansible/roles/destroy_keypair/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_keypair/tasks/main.yml new file mode 100644 index 000000000..6025b82b3 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_keypair/tasks/main.yml @@ -0,0 +1,12 @@ +- 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/destroy_network/tasks/destroy_network.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/destroy_network.yml new file mode 100644 index 000000000..8f97d9507 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/destroy_network.yml @@ -0,0 +1,10 @@ +--- +- 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/destroy_network/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/main.yml new file mode 100644 index 000000000..e52dcbdb8 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_network/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- include: destroy_network.yml net={{ item }} + loop: + - "{{ network }}" diff --git a/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/destroy_securitygroup.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/destroy_securitygroup.yml new file mode 100644 index 000000000..eb86f9bc2 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/destroy_securitygroup.yml @@ -0,0 +1,5 @@ +--- +- name: "Destroy {{ secgrp.name }} security group" + os_security_group: + state: absent + name: "{{ secgrp.name }}" diff --git a/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/main.yml new file mode 100644 index 000000000..de098afec --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/destroy_securitygroup/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- include: destroy_securitygroup.yml secgrp={{ item }} + loop: + - "{{ securitygroup }}" 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 }}" -- cgit 1.2.3-korg