Skip to content

Commit 32e1a61

Browse files
jsf9kmcdonnnj
andcommitted
Expand comment describing why we use follow=false
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
1 parent 9a51c3a commit 32e1a61

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tasks/main.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,21 @@
2121

2222
- name: Create /etc/resolv.conf symlink
2323
ansible.builtin.file:
24-
# Do not apply any group, owner, or mode changes to src.
24+
# Note that group, owner, and mode can modify src when follow=true
25+
# and state=link are used:
26+
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html#parameter-follow
27+
#
28+
# In fact, I found this to be exactly the case when testing. In
29+
# other words, if I set follow=true (or left it as the default)
30+
# without specifying group, owner, or mode then the group and
31+
# owner of src (i.e., /run/systemd/resolve/stub-resolv.conf) would
32+
# both be changed from systemd-resolved to root.
33+
#
34+
# In this case we definitely _do not_ want to modify the group,
35+
# owner, or mode of src, and we do not need to follow any
36+
# filesystem links to arrive at /etc/resolv.conf, so we simply
37+
# override the default and set follow equal to false. This will
38+
# ensure that no group, owner, or mode changes are applied to src.
2539
follow: false
2640
# If a file is already present at /etc/resolv.conf then just
2741
# delete it.

0 commit comments

Comments
 (0)