]> git.phdru.name Git - ansible.git/commitdiff
Feat: Add `changed_when`
authorOleg Broytman <phd@phdru.name>
Sun, 28 Jul 2019 19:01:09 +0000 (22:01 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 28 Jul 2019 19:25:03 +0000 (22:25 +0300)
playbooks/debian/roles/phd/tasks/main.yml
playbooks/debian/roles/root/tasks/mc.yml
playbooks/debian/roles/root/tasks/root.yml

index 2c7373c0845e7ba58b5cd9f437cc92aa2bf8c0c8..dfd87800724c161c963b389bd628d338e38f9663 100644 (file)
@@ -2,6 +2,7 @@
   stat:
     path: "{{ item }}"
   register: phd_exists
+  changed_when: not phd_exists.stat.exists
   loop: ['~/.profile', '~/.shellrc']
 
 - debug:
index ec8052308c4f808397fb43f591ce2b20c19ca81f..332015ef7d3facd2480290e9d892eaca816480ac 100644 (file)
@@ -3,6 +3,7 @@
   stat:
     path: "{{ item }}"
   register: links_exist
+  changed_when: not links_exist.stat.exists
   loop: ['~root/.cache/mc', '~root/.config/mc', '~root/.local/share/mc']
 
 - debug:
index b713f01625c7d622f72bdcfd59c94ab68b096b58..142e00c575a68b0196cf0b54446e9bbbd5c45577 100644 (file)
@@ -44,6 +44,7 @@
   stat:
     path: ~root/.sh_history
   register: sh_history
+  changed_when: not sh_history.stat.exists
 
 - name: "Setup ~root - create .sh_history"
   become: true