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
This commit is contained in:
Giulio Fidente 2017-10-02 22:44:18 +02:00
parent e21f8e094f
commit 47e66a8168
2 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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: