aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-08-09 14:32:00 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-08-09 14:32:00 +0300
commitf320dc2306a77da017a6bacda733c31d0f32f460 (patch)
tree49636764a69a5e9b663ef26e8764d5eca56f90bc
parentadd "server" role (diff)
downloadmaintenance-f320dc2306a77da017a6bacda733c31d0f32f460.tar.gz
maintenance-f320dc2306a77da017a6bacda733c31d0f32f460.zip
use "args: chdir=" instead of "cd "
-rw-r--r--roles/pacman/tasks/main.yml8
-rw-r--r--roles/snap/tasks/main.yml8
2 files changed, 12 insertions, 4 deletions
diff --git a/roles/pacman/tasks/main.yml b/roles/pacman/tasks/main.yml
index 31b4352..3f5500f 100644
--- a/roles/pacman/tasks/main.yml
+++ b/roles/pacman/tasks/main.yml
@@ -22,7 +22,9 @@
when: not etc_versioned
- 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
@@ -31,7 +33,9 @@
when: not git_status.stdout
- name: All changes are pacman.d/gnupg
- shell: cd /etc && git status --porcelain=v1 | cut -c 4- | grep -G -v '^pacman.d/gnupg/'
+ shell: git status --porcelain=v1 | cut -c 4- | grep -G -v '^pacman.d/gnupg/'
+ args:
+ chdir: /etc
register: only_gnupg
changed_when: no
ignore_errors: yes
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