I'm currently developing some basic Puppet manifests and modules to install my application dependencies after my server has been deployed. It's a suite of basic stuff: -
- OS -> Ubuntu 14.04 LTS
- Nginx
- PHP5-FPM
- MySQL
Simple, right?
Everything is going pretty well for the most part; until I stumbled upon the ability to use Augeas to update the config files with my custom config items. I've set the PHP config items without any problems, as such:
augeas { 'php.ini':
require => [
Package['php5-fpm'],
Package['libaugeas-ruby'],
],
notify => Service['php5-fpm'],
context => '/files/etc/php5/fpm/php.ini',
changes => [
'set PHP/cgi.fix_pathinfo 0',
],
}
This works just fine. No issues at all.
However, now I've come to the MySQL config file, I'm using the following (which was nearly a copy and paste job)
augeas { 'my.cnf':
require => [
Package['mysql-server'],
Package['libaugeas-ruby'],
],
notify => Service['mysql'],
context => '/files/etc/mysql/my.cnf',
changes => [
'set mysqld/bind-address 0.0.0.0',
],
}
Unfortunately, this just isn't working. I looked at the augeas documentation regarding the lenses it ships with, and no issues. The following is the initial output from the Puppet apply command.
Error: /Stage[main]/Mysql/Augeas[my.cnf]: Could not evaluate: Save failed with return code false, see debug
The next logical step was, of course, to look at the debug information. Which was the following information in it.
Debug: Augeas[my.cnf](provider=augeas): sending command 'set' with params ["/files/etc/mysql/my.cnf/mysqld/bind-address", "0.0.0.0"]
Debug: Augeas[my.cnf](provider=augeas): Put failed on one or more files, output from /augeas//error:
Debug: Augeas[my.cnf](provider=augeas): /augeas/files/etc/mysql/my.cnf/error = put_failed
Debug: Augeas[my.cnf](provider=augeas): /augeas/files/etc/mysql/my.cnf/error/path = /files/etc/mysql/my.cnf
Debug: Augeas[my.cnf](provider=augeas): /augeas/files/etc/mysql/my.cnf/error/lens = /usr/share/augeas/lenses/dist/mysql.aug:39.13-.60:
Debug: Augeas[my.cnf](provider=augeas): /augeas/files/etc/mysql/my.cnf/error/message = Failed to match