diff options
author | Kevin Fenzi <kevin@scrye.com> | 2015-02-23 16:47:35 +0000 |
---|---|---|
committer | Kevin Fenzi <kevin@scrye.com> | 2015-02-23 16:47:35 +0000 |
commit | 293207d03b371b73db9fd6e362802f1e0157bfec (patch) | |
tree | bca3867f5d7474a6ab768565ec0abc4b4ca191ea | |
parent | 697de812ba59ca89f81f8ec5bd16045946ccc950 (diff) | |
download | ansible-293207d03b371b73db9fd6e362802f1e0157bfec.tar.gz ansible-293207d03b371b73db9fd6e362802f1e0157bfec.tar.xz ansible-293207d03b371b73db9fd6e362802f1e0157bfec.zip |
Make this touch idempotent
-rw-r--r-- | roles/copr/backend/tasks/main.yml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/copr/backend/tasks/main.yml b/roles/copr/backend/tasks/main.yml index 1da19a46b..880e5930a 100644 --- a/roles/copr/backend/tasks/main.yml +++ b/roles/copr/backend/tasks/main.yml @@ -40,8 +40,15 @@ - name: setup copr user ssh config file copy: src="ssh_config" dest=/home/copr/.ssh/config owner=copr group=copr mode=600 +- name: check known_hosts file + command: stat /home/copr/.ssh/known_hosts + register: hostsstat + always_run: yes + changed_when: "1 != 1" + - name: create empty known_hosts file: state=touch dest=/home/copr/.ssh/known_hosts owner=copr group=copr mode=600 + when: hostsstat.rc == 1 - name: replace bashrc for copr user copy: src="copr_bashrc" dest=/home/copr/.bashrc owner=copr group=copr mode=600 |