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

[elasticsearch/sysconfig] use ini_manage #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arthurzenika
Copy link
Contributor

instead of file.managed, so we can keep documentation
comments and the other variables one can tweak

solves #21

instead of file.managed, so we can keep documentation
comments and the other variables one can tweak
@blbradley
Copy link
Contributor

/etc/default/elasticsearch is not an ini file. So, this is not semantically correct.

Have a look at file.managed's contents_pillar. It may do what you want.

@arthurzenika
Copy link
Contributor Author

I beg to differ "Keys may (but need not) be grouped into arbitrarily named sections. " https://en.wikipedia.org/wiki/INI_file#Sections

(and it seems that travis is failing on something different)

@blbradley
Copy link
Contributor

I fixed the failing test in master.

Comments in INI format start with ;. Comments in scripts and environments files start with #. I'm afraid the shoe just does not fit.

@arthurzenika
Copy link
Contributor Author

Are we being picky about names or you prefer the file.managed approach ? I think it serves the user to keep the documentation in the /etc/default/elasticsearch file

The ini_manage module user # by default https://github.com/saltstack/salt/blob/develop/salt/modules/ini_manage.py#L198

I guess it was primarily developed to manage openstack ini files http://docs.openstack.org/icehouse/config-reference/content/config_format.html which uses # too.

@blbradley
Copy link
Contributor

blbradley commented Dec 15, 2016

Are we being picky about names or you prefer the file.managed approach ?

Neither. I'm weary of breaking the formula for other users.

I think it serves the user to keep the documentation in the /etc/default/elasticsearch file

Do you keep your pillar data in a git repository? This would be a great place for people to look for specific documentation vs a file on a server.

The ini_manage module uses # by default

This is true, but it doesn't follow the INI spec. From https://en.wikipedia.org/wiki/INI_file#Varying_features:

Some software supports the use of the number sign (#) as an alternative to the semicolon for indicating comments.

@cmclaughlin
Copy link
Contributor

As a compromise, perhaps simply add the backup option on file.managed... that way the user has the original file with all the comments intact.

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

Successfully merging this pull request may close these issues.

None yet

3 participants