aboutsummaryrefslogtreecommitdiffstats
path: root/deployment
diff options
context:
space:
mode:
Diffstat (limited to 'deployment')
-rw-r--r--deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml
index 4ac8a48f1..a330875d8 100644
--- a/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml
+++ b/deployment/noheat/infra-openstack/ansible/roles/openstack/create_devstack_keypair/tasks/main.yml
@@ -11,9 +11,15 @@
dest: "~/.ssh/{{ keypair.key.name }}.pub"
mode: 0600
+- name: Check if local private key exists
+ stat:
+ path: "~/.ssh/{{ keypair.key.name }}"
+ register: local_private_key
+
- name: Create local private key
local_action:
module: copy
content: "{{ keypair.key.private_key }}"
dest: "~/.ssh/{{ keypair.key.name }}"
mode: 0600
+ when: local_private_key.stat.exists == False