diff options
author | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2020-12-24 09:42:55 +0100 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2021-01-07 10:34:50 +0000 |
commit | f7dd723294912e4bb4484859ac263ab9270d70c6 (patch) | |
tree | 33cac7e5c114ea50abccf5d13ea5cea37c7d6bbd /deployment/noheat/infra-openstack/ansible/create.yml | |
parent | dbe49b2d6eeddc3726270c1cdd0ce93848bbac5c (diff) |
Allow operator access to the cluster
This patch creates operator keypair and deploys its public key to all
machines in the cluster. Previously cluster could be accessed from
OpenStack admin machine only.
Additional information added to the "all.yml*" group variables allowed
keeping current roles generic and flexible.
Issue-ID: INT-1601
Change-Id: I6b289ff9a8c9ebe04562671b8f4b4468b543723f
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'deployment/noheat/infra-openstack/ansible/create.yml')
-rw-r--r-- | deployment/noheat/infra-openstack/ansible/create.yml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deployment/noheat/infra-openstack/ansible/create.yml b/deployment/noheat/infra-openstack/ansible/create.yml index 38f2f9d20..3885f0e2c 100644 --- a/deployment/noheat/infra-openstack/ansible/create.yml +++ b/deployment/noheat/infra-openstack/ansible/create.yml @@ -8,3 +8,24 @@ - 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'] }}" |