ansible-augeas icon indicating copy to clipboard operation
ansible-augeas copied to clipboard

commands with empty value

Open MarioVerbelen opened this issue 7 years ago • 0 comments

I would like to add a file with empty value but that looks like not possible now Or is there a other way to insert entry's with no values?

I would like to add 'skip-innodb' for example to mysql config

Target system: ubuntu 16.04

action: augeas commands='set /augeas/load/MySQL/incl[last()+1] /etc/mysql/mysql.conf.d/*.cnf
                         load
                         set /files/etc/mysql/mysql.conf.d/mysqld.cnf/target[.=\\"mysqld\\"]/skip-innodb ""'

I have tested several syntax but I don't think its possible right now If I execute the commands in augtool it is working correctly

TASK [mysql : mysqld settings] *************************************************
fatal: [serverX]: FAILED! => {"changed": false, "failed": true, "msg": "Augeas refused to save changes. Augeas has reported following problems  (it's possible that some of them are unrelated to your action):\n\n/augeas/files/etc/mysql/mysql.conf.d/mysqld.cnf/error/path: /files/etc/mysql/mysql.conf.d/mysqld.cnf/target/skip-innodb\n/augeas/files/etc/mysql/mysql.conf.d/mysqld.cnf/error/lens: /usr/share/augeas/lenses/dist/mysql.aug:22.44-.52:\n/augeas/files/etc/mysql/mysql.conf.d/mysqld.cnf/error/message: Can not store a nonexistent (NULL) value\n\n/augeas/files/etc/rsyslog.conf/error/pos: 269\n/augeas/files/etc/rsyslog.conf/error/line: 13\n/augeas/files/etc/rsyslog.conf/error/char: 0\n/augeas/files/etc/rsyslog.conf/error/lens: /usr/share/augeas/lenses/dist/rsyslog.aug:61.10-.57:\n/augeas/files/etc/rsyslog.conf/error/message: Get did not match entire input\n\n/augeas/files/etc/apt/apt.conf.d/01autoremove/error/pos: 108\n/augeas/files/etc/apt/apt.conf.d/01autoremove/error/line: 11\n/augeas/files/etc/apt/apt.conf.d/01autoremove/error/char: 1\n/augeas/files/etc/apt/apt.conf.d/01autoremove/error/lens: /usr/share/augeas/lenses/dist/aptconf.aug:143.10-.46:\n/augeas/files/etc/apt/apt.conf.d/01autoremove/error/message: Syntax error"}

MarioVerbelen avatar Apr 01 '17 20:04 MarioVerbelen