Only add ssh keys if there is a valid ssh agent with keys

Change-Id: I3170bcab532396f21d1ae9adceebe7ad21c51e8e
This commit is contained in:
Matthew Mosesohn 2017-01-20 16:21:10 +03:00
parent ea20afb970
commit e5e1ac7b0a
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@
become: false
register: ssh_pubkeys
changed_when: false
failed_when: false
- name: Add SSH pubkey to authorized_keys
authorized_key:
@ -23,7 +24,7 @@
key: "{{ item }}"
state: present
with_items: "{{ ssh_pubkeys.stdout_lines }}"
changed_when: false
when: ssh_pubkeys.rc == 0
- include: process_certificates.yml
when: trust_self_signed_certs|bool