Ask Your Question
0

add network interface to already existing interfaces file

asked 2015-07-22 07:40:39 -0500

sjwrong gravatar image

How can I add network interface to already existing "interfaces" file on Ubuntu 12.04 LTS:

I need put new lines with new interface settings to already existing /etc/network/interfaces without deleting already default configuration, only add new lines about new interface. Something like this Network-module/puppet-forge

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-07-22 13:05:32 -0500

generally prefer to manage a whole file - can get messy otherwise. however have a look at augeus or file_line resources which would do the job.

edit flag offensive delete link more
0

answered 2015-07-24 03:49:58 -0500

sjwrong gravatar image

updated 2015-07-24 03:55:25 -0500

Okay thanks, but How can I add new lines via augeas? because if I use this to edit interfaces file, nothing happens.

augeas{ "ifaces" :
context => "/files/tmp/ifaces",
changes => [
    "set auto eth1",
],

}

This is only example of my using augeas, but I can't solve it. Also I have a problem with editing file with augeas because what can I do If I have more than 1 line which starts with the same parameter like "auto" in interfaces file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-22 07:35:16 -0500

Seen: 163 times

Last updated: Jul 24 '15