Skip to content

Commit

Permalink
Merge pull request #11775 from Mab879/fix_11771
Browse files Browse the repository at this point in the history
Fix ansible_ini_file_set
  • Loading branch information
jan-cerny authored Apr 2, 2024
2 parents 3363a2e + 6addee5 commit 695c283
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 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 }}", description="", ignore_spaces=true) }}}
{{{ ansible_ini_file_set("/etc/NetworkManager/NetworkManager.conf", "main", "dns", "{{ var_networkmanager_dns_mode }}", description="", no_extra_spaces=true) }}}

- name: "{{{ rule_title }}} - Ensure Network Manager"
ansible.builtin.systemd:
Expand Down
5 changes: 2 additions & 3 deletions 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="", ignore_spaces=false) -%}}
{{% macro ansible_ini_file_set(filename, section, key, value, description="", no_extra_spaces=False) -%}}
- name: "{{{ description if description else ("Set '" + key + "' to '" + value + "' in the [" + section + "] section of '" + filename + "'") }}}"
ini_file:
path: "{{{ filename }}}"
Expand All @@ -733,8 +733,7 @@ The following macro remediates Audit syscall rule in :code:`/etc/audit/audit.rul
value: "{{{ value }}}"
create: yes
mode: 0644
{{% if ignore_spaces %}}
ignore_spaces: false
{{% if no_extra_spaces %}}
no_extra_spaces: true
{{% endif %}}

Expand Down

0 comments on commit 695c283

Please sign in to comment.