From 9c7776a3c9b2c701f80c06954a9b1a975b68d843 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 28 Jul 2019 22:01:09 +0300 Subject: [PATCH] Feat: Add `changed_when` --- playbooks/debian/roles/phd/tasks/main.yml | 1 + playbooks/debian/roles/root/tasks/mc.yml | 1 + playbooks/debian/roles/root/tasks/root.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/playbooks/debian/roles/phd/tasks/main.yml b/playbooks/debian/roles/phd/tasks/main.yml index 2c7373c..dfd8780 100644 --- a/playbooks/debian/roles/phd/tasks/main.yml +++ b/playbooks/debian/roles/phd/tasks/main.yml @@ -2,6 +2,7 @@ stat: path: "{{ item }}" register: phd_exists + changed_when: not phd_exists.stat.exists loop: ['~/.profile', '~/.shellrc'] - debug: diff --git a/playbooks/debian/roles/root/tasks/mc.yml b/playbooks/debian/roles/root/tasks/mc.yml index ec80523..332015e 100644 --- a/playbooks/debian/roles/root/tasks/mc.yml +++ b/playbooks/debian/roles/root/tasks/mc.yml @@ -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: diff --git a/playbooks/debian/roles/root/tasks/root.yml b/playbooks/debian/roles/root/tasks/root.yml index b713f01..142e00c 100644 --- a/playbooks/debian/roles/root/tasks/root.yml +++ b/playbooks/debian/roles/root/tasks/root.yml @@ -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 -- 2.39.5