Skip to content

Commit 06f2867

Browse files
committed
Use a yamllint disable directive to ignore quoted strings
We need the quotes to ensure that the percent characters do not get interpreted as YAML special characters.
1 parent c589765 commit 06f2867

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

create/playbook.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@
3535
ansible.builtin.lineinfile:
3636
dest: /etc/sudoers
3737
state: present
38+
# yamllint/ansible-lint complain about the following lines
39+
# being quoted, but we need the quotes to ensure that the
40+
# percent characters do not get interpreted as YAML
41+
# special characters.
42+
#
43+
# yamllint disable rule:quoted-strings
3844
regexp: '^%sudo-nopw ALL\='
3945
line: '%sudo-nopw ALL=(ALL) NOPASSWD:ALL'
4046
validate: 'visudo -cf %s'
47+
# yamllint enable rule:quoted-strings
4148

4249
- name: Add user to sudo-nopw group
4350
ansible.builtin.user:

0 commit comments

Comments
 (0)