Skip to content

Commit 9467167

Browse files
run role: standardize inline scipt options
1 parent 2886995 commit 9467167

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

roles/run/handlers/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
# prints every processed file but reports only when a change is made.
2424
ansible.builtin.shell:
2525
cmd: |
26-
set -e
26+
set -u # fail on unset vars
27+
set -o pipefail # fail if any pipe cmd fails
28+
set -e # exit on any error (incl. in if/while/tests)
2729
2830
# Set ownership of files and directories: service user and group
2931
find \

roles/run/tasks/config/default.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
# https://github.com/acmesh-official/acme.sh/wiki/Options-and-Params
2020
ansible.builtin.shell:
2121
cmd: |
22+
set -u # fail on unset vars
23+
set -o pipefail # fail if any pipe cmd fails
24+
2225
__run_acmesh_checksum_before="$({{ __run_acmesh_sha1sum_executable }} '{{ run_acmesh_cfg_config_home }}/account.conf')"
2326
2427
if ! ./acme.sh \

roles/run/tasks/init.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
# - Security concerns are mitigated by strict path usage and input validation.
108108
ansible.builtin.shell:
109109
cmd: |
110+
set -u # fail on unset vars
111+
set -o pipefail # fail if any pipe cmd fails
110112
__run_acmesh_version_installed=""
111113
if command -v '{{ run_acmesh_cfg_home }}/acme.sh' > /dev/null 2>&1
112114
then

roles/run/tasks/setup/install/default.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@
258258
# - Security concerns are mitigated by strict path usage and input validation.
259259
ansible.builtin.shell:
260260
cmd: |
261+
set -u # fail on unset vars
262+
set -o pipefail # fail if any pipe cmd fails
261263
__run_acmesh_version_installed=''
262264
if command -v '{{ run_acmesh_cfg_home }}/acme.sh' > /dev/null 2>&1
263265
then

0 commit comments

Comments
 (0)