Skip to content

Commit

Permalink
Add ignore_spaces to Ansible remediation for networkmanager_dns_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Mar 25, 2024
1 parent ca6c392 commit 81e63be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{{{ ansible_instantiate_variables("var_networkmanager_dns_mode") }}}

{{{ ansible_ini_file_set("/etc/NetworkManager/NetworkManager.conf", "main", "dns", "{{ var_networkmanager_dns_mode }}") }}}
{{{ ansible_ini_file_set("/etc/NetworkManager/NetworkManager.conf", "main", "dns", "{{ var_networkmanager_dns_mode }}", true) }}}

- name: "{{{ rule_title }}} - Ensure Network Manager"
ansible.builtin.systemd:
Expand Down
3 changes: 2 additions & 1 deletion shared/macros/10-ansible.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ The following macro remediates Audit syscall rule in :code:`/etc/audit/audit.rul
{{%- endmacro %}}


{{% macro ansible_ini_file_set(filename, section, key, value, description="") -%}}
{{% macro ansible_ini_file_set(filename, section, key, value, description="", ignore_spaces=false) -%}}
- name: "{{{ description if description else ("Set '" + key + "' to '" + value + "' in the [" + section + "] section of '" + filename + "'") }}}"
ini_file:
path: "{{{ filename }}}"
Expand All @@ -733,6 +733,7 @@ The following macro remediates Audit syscall rule in :code:`/etc/audit/audit.rul
value: "{{{ value }}}"
create: yes
mode: 0644
ignore_spaces: false
{{%- endmacro %}}

{{#
Expand Down

0 comments on commit 81e63be

Please sign in to comment.