aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deployment/noheat/infra-openstack/ansible/create.yml22
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml4
2 files changed, 13 insertions, 13 deletions
diff --git a/deployment/noheat/infra-openstack/ansible/create.yml b/deployment/noheat/infra-openstack/ansible/create.yml
index 74d6d1f44..6adcf5f65 100644
--- a/deployment/noheat/infra-openstack/ansible/create.yml
+++ b/deployment/noheat/infra-openstack/ansible/create.yml
@@ -1,5 +1,5 @@
---
-- name: Create infrastructure
+- name: Prepare infrastructure and create operation instances
hosts: localhost
connection: local
gather_facts: False
@@ -9,8 +9,7 @@
- openstack/create_devstack_keypair
- role: openstack/create_devstack_hosts
hosts: "{{ operation.hosts }}"
- - role: openstack/create_devstack_hosts
- hosts: "{{ cluster.hosts }}"
+ operator_key: "dummy"
- name: Create cluster operator access keypair
hosts: "operator0"
gather_facts: False
@@ -21,14 +20,11 @@
community.crypto.openssh_keypair:
path: "~/.ssh/{{ keypair.name }}"
register: key
-- name: Deploy cluster operator public key
- hosts: "cluster0"
+- name: Create cluster instances
+ hosts: localhost
+ connection: local
gather_facts: False
- tasks:
- - name: Wait for system to become reachable
- wait_for_connection:
- - name: Add authorized key
- ansible.posix.authorized_key:
- user: "{{ image.user }}"
- state: present
- key: "{{ hostvars['operator0']['key']['public_key'] }}"
+ roles:
+ - role: openstack/create_devstack_hosts
+ hosts: "{{ cluster.hosts }}"
+ operator_key: "{{ hostvars['operator0']['key']['public_key'] }}"
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
index 7fed57859..c3b40d29d 100644
--- 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
@@ -13,6 +13,10 @@
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