74d6d1f44f27e93dd603c9c3731d17dbb384d4dd
[integration.git] / deployment / noheat / infra-openstack / ansible / create.yml
1 ---
2 - name: Create infrastructure
3   hosts: localhost
4   connection: local
5   gather_facts: False
6   roles:
7     - openstack/create_devstack_network
8     - openstack/create_devstack_securitygroup
9     - openstack/create_devstack_keypair
10     - role: openstack/create_devstack_hosts
11       hosts: "{{ operation.hosts }}"
12     - role: openstack/create_devstack_hosts
13       hosts: "{{ cluster.hosts }}"
14 - name: Create cluster operator access keypair
15   hosts: "operator0"
16   gather_facts: False
17   tasks:
18     - name: Wait for system to become reachable
19       wait_for_connection:
20     - name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
21       community.crypto.openssh_keypair:
22         path: "~/.ssh/{{ keypair.name }}"
23       register: key
24 - name: Deploy cluster operator public key
25   hosts: "cluster0"
26   gather_facts: False
27   tasks:
28     - name: Wait for system to become reachable
29       wait_for_connection:
30     - name: Add authorized key
31       ansible.posix.authorized_key:
32         user: "{{ image.user }}"
33         state: present
34         key: "{{ hostvars['operator0']['key']['public_key'] }}"