From 47e66a81681b8327b5d1c284e54bb0495e2f4872 Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Mon, 2 Oct 2017 22:44:18 +0200 Subject: [PATCH] Ensure ssh key is active before returning from create_admin_via_nova We need to make sure os-collect-config has pulled in the new software deployment and committed the changes before returning. Also sets the ceph-ansible playbook retries to 3 to make sure we don't fail unnecessarily on unpredictable network issues. Change-Id: I544abf5053f18984d93cf381812372029f4ce498 Closes-Bug: #1720793 --- workbooks/access.yaml | 27 +++++++++++++++++++++++++++ workbooks/ceph-ansible.yaml | 1 + 2 files changed, 28 insertions(+) diff --git a/workbooks/access.yaml b/workbooks/access.yaml index a0aa957cf..4cfd2c020 100644 --- a/workbooks/access.yaml +++ b/workbooks/access.yaml @@ -74,6 +74,7 @@ workflows: input: queue_name: <% $.queue_name %> tasks: <% $.create_admin_tasks %> + overcloud_admin: <% $.overcloud_admin %> # SSH variant create_admin_via_ssh: @@ -88,6 +89,7 @@ workflows: input: - tasks - queue_name: tripleo + - overcloud_admin: tripleo-admin tags: - tripleo-common-managed tasks: @@ -99,6 +101,7 @@ workflows: create_admin: workflow: tripleo.deployment.v1.deploy_on_server + on-success: get_privkey with-items: server in <% $.servers %> input: server_name: <% $.server.name %> @@ -111,6 +114,30 @@ workflows: connection: local tasks: <% json_pp($.tasks) %> + get_privkey: + action: tripleo.validations.get_privkey + on-success: wait_for_occ + publish: + privkey: <% task(get_privkey).result %> + + wait_for_occ: + action: tripleo.ansible-playbook + input: + inventory: + overcloud: + hosts: <% $.servers.addresses.ctlplane.addr.flatten().toDict($, {}) %> + remote_user: <% $.overcloud_admin %> + ssh_private_key: <% $.privkey %> + ssh_common_args: '-o StrictHostKeyChecking=no' + playbook: + - hosts: overcloud + gather_facts: no + tasks: + - name: wait for connection + wait_for_connection: + sleep: 5 + timeout: 300 + create_admin_via_ssh: input: - tasks diff --git a/workbooks/ceph-ansible.yaml b/workbooks/ceph-ansible.yaml index 7097b9a42..e3a1deeaa 100644 --- a/workbooks/ceph-ansible.yaml +++ b/workbooks/ceph-ansible.yaml @@ -16,6 +16,7 @@ workflows: ANSIBLE_RETRY_FILES_ENABLED: 'False' ANSIBLE_LOG_PATH: /var/log/mistral/ceph-install-workflow.log ANSIBLE_LIBRARY: /usr/share/ceph-ansible/library/ + ANSIBLE_SSH_RETRIES: '3' - ceph_ansible_extra_vars: {} - ceph_ansible_playbook: /usr/share/ceph-ansible/site-docker.yml.sample tags: