From f320dc2306a77da017a6bacda733c31d0f32f460 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 9 Aug 2021 14:32:00 +0300 Subject: use "args: chdir=" instead of "cd " --- roles/snap/tasks/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'roles/snap/tasks') diff --git a/roles/snap/tasks/main.yml b/roles/snap/tasks/main.yml index 0be58cf..039aa74 100644 --- a/roles/snap/tasks/main.yml +++ b/roles/snap/tasks/main.yml @@ -9,12 +9,16 @@ when: snap_version.rc == 0 and etc_versioned block: - name: There are uncommitted changes - shell: cd /etc && git status --porcelain=v1 + command: git status --porcelain=v1 + args: + chdir: /etc register: git_status changed_when: no - name: All changes are snap changes - shell: cd /etc && git status --porcelain=v1 | cut -c 4- | grep -G -v '^systemd/system/' | grep -G -v '/snap\.\|snap-' + shell: git status --porcelain=v1 | cut -c 4- | grep -G -v '^systemd/system/' | grep -G -v '/snap\.\|snap-' + args: + chdir: /etc register: only_snap changed_when: no ignore_errors: yes -- cgit v1.2.3