ensure /bin/bash with pipefail as per lint

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2023-12-04 17:10:47 -06:00
parent 5c35e7e9e3
commit e7f7a1533a
5 changed files with 20 additions and 0 deletions

View file

@ -21,6 +21,7 @@
- name: Get the file content
ansible.builtin.shell: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC
executable: /bin/bash
changed_when: false
register: content

View file

@ -241,6 +241,7 @@
- name: Get the file content
ansible.builtin.shell: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC
executable: /bin/bash
changed_when: false
register: content

View file

@ -104,6 +104,7 @@
- name: Get mount options
ansible.builtin.shell: set -o pipefail && mount | grep mount_dest | grep -E -w '(ro|read-only)' | wc -l
executable: /bin/bash
changed_when: false
register: remount_options
@ -272,6 +273,7 @@
- name: Get the last write time
ansible.builtin.shell: "set -o pipefail && dumpe2fs /tmp/myfs.img 2>/dev/null | grep -i last write time: |cut -d: -f2-"
executable: /bin/bash
changed_when: false
register: last_write_time
@ -286,6 +288,7 @@
- name: Get again the last write time
ansible.builtin.shell: "set -o pipefail && dumpe2fs /tmp/myfs.img 2>/dev/null | grep -i last write time: |cut -d: -f2-"
executable: /bin/bash
changed_when: false
register: last_write_time2
@ -302,6 +305,7 @@
- name: Get remounted options (Linux only)
ansible.builtin.shell: set -o pipefail && mount | grep myfs | grep -E -w 'noexec' | wc -l
executable: /bin/bash
changed_when: false
register: remounted_options
@ -570,6 +574,7 @@
- name: Get mountinfo
ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l
executable: /bin/bash
register: check_mountinfo
changed_when: false
@ -582,6 +587,7 @@
- name: Get first mount record
ansible.builtin.shell: set -o pipefail && mount -v | grep '/tmp/myfs'
executable: /bin/bash
register: ephemeral_mount_record_1
changed_when: false
@ -596,11 +602,13 @@
- name: Get second mount record (should be different than the first)
ansible.builtin.shell: set -o pipefail && mount -v | grep '/tmp/myfs'
executable: /bin/bash
register: ephemeral_mount_record_2
changed_when: false
- name: Get mountinfo
ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l
executable: /bin/bash
register: check_mountinfo
changed_when: false
@ -623,11 +631,13 @@
- name: Get third mount record (should be the same than the second)
ansible.builtin.shell: set -o pipefail && mount -v | grep '/tmp/myfs'
executable: /bin/bash
register: ephemeral_mount_record_3
changed_when: false
- name: Get mountinfo
ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l
executable: /bin/bash
register: check_mountinfo
changed_when: false
@ -656,6 +666,7 @@
- name: Get mountinfo
ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l
executable: /bin/bash
register: check_mountinfo
changed_when: false

View file

@ -30,11 +30,13 @@
- name: Get getsebool output preflight
ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W'
executable: /bin/bash
changed_when: false
register: getsebool_output_preflight
- name: Cleanup
ansible.builtin.shell: set -o pipefail && setsebool -P httpd_can_network_connect 0
executable: /bin/bash
changed_when: getsebool_output_preflight.stdout.startswith('httpd_can_network_connect --> on')
- name: Set flag and don't keep it persistent
@ -45,6 +47,7 @@
- name: Get getsebool output
ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W'
executable: /bin/bash
changed_when: false
register: getsebool_output
@ -63,6 +66,7 @@
- name: Get getsebool output
ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W'
executable: /bin/bash
changed_when: false
register: getsebool_output
@ -84,6 +88,7 @@
- name: Get getsebool output
ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W'
executable: /bin/bash
changed_when: false
register: getsebool_output

View file

@ -66,6 +66,7 @@
- name: Get file content
ansible.builtin.shell: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\#
executable: /bin/bash
changed_when: false
register: sysctl_content0
@ -101,6 +102,7 @@
- name: Get file content
ansible.builtin.shell: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\#
executable: /bin/bash
changed_when: false
register: sysctl_content2