Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set interface to "::" to enable IPv6 #233

Closed
rhertzog opened this issue Jun 20, 2016 · 1 comment
Closed

Cannot set interface to "::" to enable IPv6 #233

rhertzog opened this issue Jun 20, 2016 · 1 comment

Comments

@rhertzog
Copy link
Contributor

rhertzog commented Jun 20, 2016

https://docs.saltstack.com/en/latest/ref/configuration/master.html explains that to enable IPv6 you must set the interface option to '::'. So I have put this in pillar:

salt:
  master:
    ipv6: True
    interface: '::'

But if you apply the salt.master state with this value it will generate an invalid configuration file as it will put the string without the quotes in the generated file:

$ grep ^interface /etc/salt/master.d/f_defaults.conf
interface: ::

And this breaks the salt master... somehow we must enhance the code which embeds strings in the configuration file to add the required quotes.

The code for the minion does use the "json" output filter which avoids this, we should do the same with the master configuration file.

@rhertzog
Copy link
Contributor Author

Something like this:

diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf
index 29b5f8a..9b0d87c 100644
--- a/salt/files/master.d/f_defaults.conf
+++ b/salt/files/master.d/f_defaults.conf
@@ -5,11 +5,11 @@
 {% set cfg_master = cfg_salt.get('master', {}) -%}
 {%- macro get_config(configname, default_value) -%}
 {%- if configname in cfg_master -%}
-{{ configname }}: {{ cfg_master[configname] }}
+{{ configname }}: {{ cfg_master[configname]|json }}
 {%- elif configname in cfg_salt and configname not in reserved_keys -%}
-{{ configname }}: {{ cfg_salt[configname] }}
+{{ configname }}: {{ cfg_salt[configname]|json }}
 {%- else -%}
-#{{ configname }}: {{ default_value }}
+#{{ configname }}: {{ default_value|json }}
 {%- endif -%}
 {%- endmacro -%}
 {%- from 'salt/formulas.jinja' import file_roots, formulas with context -%}

rhertzog added a commit to rhertzog/salt-formula that referenced this issue Jun 20, 2016
This avoids problems when values are strings containing colons. And it
mimicks what was already done for the salt-minion's configuration file.

Fixes saltstack-formulas#233.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant