Skip to content

Commit e792e99

Browse files
committed
added fix for #327 thanks to @derekbentson
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
1 parent 257191b commit e792e99

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

tasks/fix-cat2.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6161,30 +6161,12 @@
61616161
"MEDIUM | RHEL-08-040120 | PATCH | RHEL 8 must mount /dev/shm with the nodev option."
61626162
"MEDIUM | RHEL-08-040121 | PATCH | RHEL 8 must mount /dev/shm with the nosuid option."
61636163
"MEDIUM | RHEL-08-040122 | PATCH | RHEL 8 must mount /dev/shm with the noexec option."
6164-
block:
6165-
- name: |
6166-
"MEDIUM | RHEL-08-040120 | AUDIT | RHEL 8 must mount /dev/shm with the nodev option."
6167-
"MEDIUM | RHEL-08-040121 | AUDIT | RHEL 8 must mount /dev/shm with the nosuid option."
6168-
"MEDIUM | RHEL-08-040122 | AUDIT | RHEL 8 must mount /dev/shm with the noexec option."
6169-
ansible.builtin.shell: mount | grep /dev/shm
6170-
changed_when: false
6171-
failed_when: false
6172-
register: rhel8stig_040120_dev_shm_status
6173-
6174-
- name: |
6175-
"MEDIUM | RHEL-08-040120 | PATCH | RHEL 8 must mount /dev/shm with the nodev option."
6176-
"MEDIUM | RHEL-08-040121 | PATCH | RHEL 8 must mount /dev/shm with the nosuid option."
6177-
"MEDIUM | RHEL-08-040122 | PATCH | RHEL 8 must mount /dev/shm with the noexec option."
6178-
ansible.posix.mount:
6179-
path: "{{ item.mount }}"
6180-
state: mounted
6181-
src: "{{ item.device }}"
6182-
fstype: "{{ item.fstype }}"
6183-
opts: "defaults{{ rhel_08_040120 | ternary (',nodev', '') }}{{ rhel_08_040121 | ternary (',nosuid', '') }}{{ rhel_08_040122 | ternary (',noexec', '') }}"
6184-
loop: "{{ ansible_facts.mounts }}"
6185-
when:
6186-
- item.mount == '/dev/shm'
6187-
- rhel8stig_040120_dev_shm_status.stdout | length > 0
6164+
ansible.posix.mount:
6165+
path: /dev/shm
6166+
state: mounted
6167+
src: tmpfs
6168+
fstype: tmpfs
6169+
opts: "defaults{{ rhel_08_040120 | ternary (',nodev', '') }}{{ rhel_08_040121 | ternary (',nosuid', '') }}{{ rhel_08_040122 | ternary (',noexec', '') }}"
61886170
when:
61896171
- rhel_08_040120 or
61906172
rhel_08_040121 or

0 commit comments

Comments
 (0)