remove/unset augeas lines

asked 2015-08-03 02:40:09 -0500

sjwrong gravatar image

Hello, How can I delete or unset lines which was added by augeas ? Server:Ubuntu 12.04 LTS

augeas{ "new_if" :
context => "/files/etc/network/interfaces",
changes => [
    "set auto[child::1 = 'eth0:1']/1 eth0:1",
    "set iface[. = 'eth0:1'] eth0:1",
    "set iface[. = 'eth0:1']/family inet",
    "set iface[. = 'eth0:1']/method static",
    "set iface[. = 'eth0:1']/address 11.11.11.11/24",
],

}

and I need to delete this setted lines with some of augeas attributes but if I use this It wont work.

augeas{ "new_if" :
context => "/files/etc/network/interfaces",
changes => [
    "rm auto[child::1 = 'eth0:1']/1 eth0:1",
    "rm iface[. = 'eth0:1'] eth0:1",
    "rm iface[. = 'eth0:1']/family inet",
    "rm iface[. = 'eth0:1']/method static",
    "rm iface[. = 'eth0:1']/address 11.11.11.11/24",
],

}

How can I remove it? or Which attribute/command can I use to do this?

edit retag flag offensive close merge delete

Comments

What error message does augeas display when you attempt to apply that code to your agent node?

GregLarkin gravatar imageGregLarkin ( 2015-08-06 23:10:59 -0500 )edit