aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/infra-openstack/ansible/roles
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2020-12-24 09:42:55 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-01-07 10:34:50 +0000
commitf7dd723294912e4bb4484859ac263ab9270d70c6 (patch)
tree33cac7e5c114ea50abccf5d13ea5cea37c7d6bbd /deployment/noheat/infra-openstack/ansible/roles
parentdbe49b2d6eeddc3726270c1cdd0ce93848bbac5c (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/roles')
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/create_host.yml10
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml2
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml2
3 files changed, 12 insertions, 2 deletions
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 2a78e82e3..7fed57859 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,3 +13,13 @@
boot_from_volume: true
terminate_volume: true
volume_size: "{{ host.volume_size | default(10) }}"
+ register: new_host
+
+- name: Add host to inventory
+ add_host:
+ hostname: "{{ new_host.server.name }}"
+ groups: "{{ cluster.name }}"
+ ansible_ssh_host: "{{ new_host.server.public_v4 }}"
+ ansible_ssh_user: "{{ image.user }}"
+ ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
+ ansible_ssh_private_key_file: "~/.ssh/{{ keypair.key.name }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml
index 731bca04f..f8a64cbef 100644
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml
+++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_hosts/tasks/main.yml
@@ -1,3 +1,3 @@
---
- include: create_host.yml host={{ item }}
- loop: "{{ hosts }}"
+ loop: "{{ cluster.hosts }}"
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml
index 5ce130d44..a27e6a27b 100644
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml
+++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/destroy_devstack_hosts/tasks/main.yml
@@ -1,3 +1,3 @@
---
- include: destroy_host.yml host={{ item }}
- loop: "{{ hosts }}"
+ loop: "{{ cluster.hosts }}"