Skip to content

Commit

Permalink
Recollect facts in mount_option_nodev_nonroot_local_partitions
Browse files Browse the repository at this point in the history
This patch changes the Ansible code for rule
mount_option_nodev_nonroot_local_partitions so that Ansible id forced to
refresh facts about mount points right before running the Ansible Task
for this rule.  The data in facts that were collected at the beginning
of the play can be outdated at point when this Ansible Task is executed
if there is some other Ansible Task that changes mount points, for
example if the Ansible Tasks for rule mount_option_boot_nosuid is before
the Ansible Task for rule mount_option_nodev_nonroot_local_partitions.

Fixes: ComplianceAsCode#11933
  • Loading branch information
jan-cerny committed May 3, 2024
1 parent bd9ef20 commit c5235f4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# complexity = low
# disruption = high

- name: "{{{ rule_title }}}: Refresh facts"
setup:
gather_subset: mounts

- name: Ensure non-root local partitions are mounted with nodev option
mount:
path: "{{ item.mount }}"
Expand Down

0 comments on commit c5235f4

Please sign in to comment.