Allow operator access to the cluster
[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     - openstack/create_devstack_hosts
11 - name: Create cluster operator access keypair
12   hosts: "operator0"
13   gather_facts: False
14   tasks:
15     - name: Wait for system to become reachable
16       wait_for_connection:
17     - name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
18       community.crypto.openssh_keypair:
19         path: "~/.ssh/{{ keypair.name }}"
20       register: key
21 - name: Deploy cluster operator public key
22   hosts: "cluster0"
23   gather_facts: False
24   tasks:
25     - name: Wait for system to become reachable
26       wait_for_connection:
27     - name: Add authorized key
28       ansible.posix.authorized_key:
29         user: "{{ image.user }}"
30         state: present
31         key: "{{ hostvars['operator0']['key']['public_key'] }}"