Skip to content

Commit

Permalink
Merge pull request #62 from enix/detect_change_on_all_nodes
Browse files Browse the repository at this point in the history
Detect changes on all nodes, for triggering "pause" on review
  • Loading branch information
Zempashi authored Dec 11, 2023
2 parents d96eaa0 + ca513b6 commit 51adb6e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion roles/process_reasons/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
- name: 'Pause to review diff and upgrade reasons'
pause:
when:
- _upgrade_reasons|length > 0 or _config_upgrade_reasons|length > 0
- ansible_play_hosts_all|map('extract', hostvars, '_upgrade_reasons')|map('default', [])|map('length')|select|list|length > 0
or ansible_play_hosts_all|map('extract', hostvars, '_config_upgrade_reasons')|map('default', [])|map('length')|select|list|length > 0
- groups.cp_running|default([])|length > 0
- not action_reasons_review_skip|bool

Expand Down
8 changes: 6 additions & 2 deletions scripts/detect-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ fi
if [ "$(id -u)" -ne "${PWD_UID}" ] ; then
getent passwd ${PWD_UID} || ${USERADD} -u ${PWD_UID} enix
PWD_UNAME=$(stat . -c "%U")
exec su ${PWD_UNAME} "$@"
if command -v sudo > /dev/null; then
sudo -HEu ${PWD_UNAME} "$@"
else
exec su ${PWD_UNAME} "$@"
fi;
else
$@
"$@"
fi
2 changes: 1 addition & 1 deletion tests/dev/group_vars/all/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
action_reasons_review_skip: true
---
cluster_config:
networking:
podSubnet: 10.95.0.0/16
Expand Down

0 comments on commit 51adb6e

Please sign in to comment.