diff --git a/tests/integration/targets/authorized_key/tasks/comments.yml b/tests/integration/targets/authorized_key/tasks/comments.yml index c56ad6e..fedbdda 100644 --- a/tests/integration/targets/authorized_key/tasks/comments.yml +++ b/tests/integration/targets/authorized_key/tasks/comments.yml @@ -20,8 +20,9 @@ register: result - name: Get the file content - ansible.builtin.shell: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC + executable: /bin/bash changed_when: false register: content diff --git a/tests/integration/targets/authorized_key/tasks/ssh_dss.yml b/tests/integration/targets/authorized_key/tasks/ssh_dss.yml index 7ab6769..5aa6807 100644 --- a/tests/integration/targets/authorized_key/tasks/ssh_dss.yml +++ b/tests/integration/targets/authorized_key/tasks/ssh_dss.yml @@ -240,8 +240,9 @@ - result.key_options == "no-agent-forwarding,no-X11-forwarding,permitopen=\"10.9.8.1:8080\",permitopen=\"10.9.8.1:9001\"" - name: Get the file content - ansible.builtin.shell: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && cat "{{ output_dir | expanduser }}/authorized_keys" | fgrep DATA_BASIC + executable: /bin/bash changed_when: false register: content diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index c6770e9..3807a7d 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -103,8 +103,9 @@ register: bind_result_freebsd - 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 + ansible.builtin.shell: + cmd: 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,8 +273,9 @@ state: mounted - 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 + ansible.builtin.shell: + cmd: "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 @@ -287,8 +289,9 @@ state: remounted - 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 + ansible.builtin.shell: + cmd: "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 @@ -304,8 +307,9 @@ opts: rw,noexec - name: Get remounted options (Linux only) - ansible.builtin.shell: set -o pipefail && mount | grep myfs | grep -E -w 'noexec' | wc -l - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && mount | grep myfs | grep -E -w 'noexec' | wc -l + executable: /bin/bash changed_when: false register: remounted_options @@ -573,8 +577,9 @@ register: fstab_stat_after_mount - name: Get mountinfo - ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l + executable: /bin/bash register: check_mountinfo changed_when: false @@ -586,8 +591,9 @@ - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] - name: Get first mount record - ansible.builtin.shell: set -o pipefail && mount -v | grep '/tmp/myfs' - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && mount -v | grep '/tmp/myfs' + executable: /bin/bash register: ephemeral_mount_record_1 changed_when: false @@ -601,14 +607,16 @@ register: ephemeral_mount_info - 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 + ansible.builtin.shell: + cmd: 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 + ansible.builtin.shell: + cmd: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l + executable: /bin/bash register: check_mountinfo changed_when: false @@ -630,14 +638,16 @@ ignore_errors: true - 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 + ansible.builtin.shell: + cmd: 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 + ansible.builtin.shell: + cmd: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l + executable: /bin/bash register: check_mountinfo changed_when: false @@ -665,8 +675,9 @@ register: fstab_stat_after_unmount - name: Get mountinfo - ansible.builtin.shell: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && mount -v | awk '{print $3}' | grep '^/tmp/myfs$' | wc -l + executable: /bin/bash register: check_mountinfo changed_when: false diff --git a/tests/integration/targets/seboolean/tasks/seboolean.yml b/tests/integration/targets/seboolean/tasks/seboolean.yml index b108ff8..dbd747b 100644 --- a/tests/integration/targets/seboolean/tasks/seboolean.yml +++ b/tests/integration/targets/seboolean/tasks/seboolean.yml @@ -29,14 +29,16 @@ - ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=') - name: Get getsebool output preflight - ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' - executable: /bin/bash + ansible.builtin.shell: + cmd: 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 + ansible.builtin.shell: + cmd: 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 @@ -46,8 +48,9 @@ register: output - name: Get getsebool output - ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' + executable: /bin/bash changed_when: false register: getsebool_output @@ -65,8 +68,9 @@ state: false - name: Get getsebool output - ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' + executable: /bin/bash changed_when: false register: getsebool_output @@ -87,8 +91,9 @@ register: output - name: Get getsebool output - ansible.builtin.shell: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && semanage boolean -l | grep 'httpd_can_network_connect\W' + executable: /bin/bash changed_when: false register: getsebool_output diff --git a/tests/integration/targets/sysctl/tasks/main.yml b/tests/integration/targets/sysctl/tasks/main.yml index eeb00a3..249bde1 100644 --- a/tests/integration/targets/sysctl/tasks/main.yml +++ b/tests/integration/targets/sysctl/tasks/main.yml @@ -65,8 +65,9 @@ verbosity: 1 - name: Get file content - ansible.builtin.shell: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\# - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\# + executable: /bin/bash changed_when: false register: sysctl_content0 @@ -101,8 +102,9 @@ register: sysctl_test2 - name: Get file content - ansible.builtin.shell: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\# - executable: /bin/bash + ansible.builtin.shell: + cmd: set -o pipefail && cat {{ output_dir_test }}/sysctl.conf | egrep -v ^\# + executable: /bin/bash changed_when: false register: sysctl_content2