aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/infra-openstack/ansible/create.yml
blob: 3885f0e2ce967d3bdaaee1da730366e06a03d8a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- name: Create infrastructure
  hosts: localhost
  connection: local
  gather_facts: False
  roles:
    - openstack/create_devstack_network
    - openstack/create_devstack_securitygroup
    - openstack/create_devstack_keypair
    - openstack/create_devstack_hosts
- name: Create cluster operator access keypair
  hosts: "operator0"
  gather_facts: False
  tasks:
    - name: Wait for system to become reachable
      wait_for_connection:
    - name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
      community.crypto.openssh_keypair:
        path: "~/.ssh/{{ keypair.name }}"
      register: key
- name: Deploy cluster operator public key
  hosts: "cluster0"
  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'] }}"