Skip to content

Commit

Permalink
Fixes ansible shell with pipefail
Browse files Browse the repository at this point in the history
pipefail requires bash.
default dash shell on Debian errors out when this option is set.

(cherry picked from commit 832ba66)
  • Loading branch information
prahal authored and drybjed committed May 24, 2023
1 parent f17755a commit 7ef881c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ General
The modern project layout supports multiple Ansible inventories encapsulated
into :ref:`infrastructure views <project_infrastructure_views>`.

- Various roles which use the ``shell`` Ansible module will now use
:command:`bash` shell as the executable explicitly.

:ref:`debops.apt` role
''''''''''''''''''''''

Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/controller/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
become: '{{ controller__install_systemwide|bool }}'
shell: |
type debops-update > /dev/null 2>&1 && (echo 'debops-update' | batch > /dev/null 2>&1) || true
args:
executable: 'bash'
when: (not controller__update_method == 'sync' and
(ansible_local|d() and ansible_local.atd|d() and
ansible_local.atd.enabled|bool))
4 changes: 2 additions & 2 deletions ansible/roles/owncloud/tasks/tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
| sed --silent 's/.*href="nextcloud-\({{ owncloud__release | regex_escape() }}[^"]\+\).zip.asc".*/\1/p'
| sort --version-sort --reverse
args:
executable: 'sh'
executable: 'bash'
register: owncloud__register_full_version
changed_when: False
check_mode: False
Expand Down Expand Up @@ -94,7 +94,7 @@
+ owncloud__variant + "-" + owncloud__register_full_version.stdout_lines[0]
+ ".zip.sha512" }} | grep '.zip$'
args:
executable: 'sh'
executable: 'bash'
changed_when: False
register: owncloud__register_checksum
when: not ansible_check_mode # Latest checksum file may not be available
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/postwhite/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
- name: Update Postwhite in the background using batch
shell: |
echo '/usr/local/lib/postwhite' | batch > /dev/null 2>&1
args:
executable: 'bash'
when: postwhite__initial_update_method == 'batch'

0 comments on commit 7ef881c

Please sign in to comment.