diff options
Diffstat (limited to 'deployment/noheat/infra-openstack/ansible/roles')
6 files changed, 53 insertions, 0 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 new file mode 100644 index 000000000..847150f36 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml @@ -0,0 +1,9 @@ +--- +- name: Create host + os_server: + state: present + name: "{{ host.name }}" + image: "{{ host.image }}" + flavor: "{{ host.flavor }}" + key_name: "{{ host.keypair }}" + network: "{{ host.network }}" 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 new file mode 100644 index 000000000..f79314c72 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- include: create_host.yml host={{ item }} + with_items: + - "{{ 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 new file mode 100644 index 000000000..4ac8a48f1 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml @@ -0,0 +1,19 @@ +- 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: Create local private key + local_action: + module: copy + content: "{{ keypair.key.private_key }}" + dest: "~/.ssh/{{ keypair.key.name }}" + mode: 0600 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 new file mode 100644 index 000000000..e9cedce7a --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_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/openstack/destroy_devstack_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml new file mode 100644 index 000000000..eddf09736 --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- include: destroy_host.yml host={{ item }} + with_items: + - "{{ 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 new file mode 100644 index 000000000..b106ee0cd --- /dev/null +++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_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 }}" + with_items: + - "~/.ssh/{{ keypair.name }}.pub" + - "~/.ssh/{{ keypair.name }}" |