Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
State augeas.change do not update config file #50016
Description of Issue/Question
We have a state to update /etc/service and include a new entry. After applying that state, we don't the change in configuration file.
BTW This is working with salt 2017.7.5 but not in 2018.3.2
Here is a sample state file
python-augeas: pkg.installed mysqlchk-service: augeas.change: - lens: services.lns - context: /files/etc/services - changes: - ins service-name after service-name[last()] - set service-name[last()] "mysqlchk" - set "service-name[. = 'mysqlchk']/port" 9200 - set "service-name[. = 'mysqlchk']/protocol" tcp - set "service-name[. = 'mysqlchk']/#comment" "MySQL HAProxy health check" - require: - pkg: python-augeas - unless: grep -qi "mysqlchk" /etc/services
Here is the relevant part of the log
and this is salt output
local: ---------- ID: python-augeas Function: pkg.installed Result: True Comment: All specified packages are already installed Started: 06:38:35.827478 Duration: 319.361 ms Changes: ---------- ID: mysqlchk-service Function: augeas.change Result: True Comment: No changes made Started: 06:38:36.148753 Duration: 414.774 ms Changes: Summary for local ------------ Succeeded: 2 Failed: 0 ------------ Total states run: 2 Total run time: 734.135 ms
Steps to Reproduce Issue
Just create a state like the one posted above and run it. Check /etc/service and find out that the file does not include the new entry
Not sure if this could be related to unicode change
This might be a version issue.
After it worked fine in centos 7 I decided to check ubuntu. 14.04 didn't work however if i uninstalled the
ubuntu 16.04 didn't have the problem and worked with the package installed by the os.