Gentoo Archives: gentoo-user

From: Tomas Mozes <tomas.mozes@××××.sk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] emerge default config
Date: Sat, 24 Jan 2015 06:19:48
Message-Id: 8b8e295f240a4f2c4db36c7f79a1601d@shmu.sk
In Reply to: [gentoo-user] emerge default config by shawn wilson
1 On 2015-01-23 23:45, shawn wilson wrote:
2 > Is there a way to have default config lines that emerge updates won't
3 > touch?
4 >
5 > For instance, my /etc/ssh/sshd_config differs from the default in some
6 > places. I know this and upstream shows me the same diffs in that file
7 > over and over again. But maybe upstream will add a new option - I'd
8 > like to see that (obviously I'd miss out on new crypto types if I
9 > ignored that line, but that's ok - I keep up on that anyway). There
10 > are obviously other places in other files as well - logrotate
11 > retention comes to mind as well.
12
13 1) you have a fresh /etc/ssh/sshd_config
14 2) describe and apply the changes you want to make, like:
15 ensure PermitRootLogin is without-password
16 ensure AllowUsers is admin1 admin2
17
18 After some time, you have a shiny new OpenSSH version installed that
19 adds some lines, so you have a ._cfg to deal with. What do you do?
20
21 - mv ._cfg to sshd_config
22 - do 2) as before
23
24 Your configuration is updated and your changes stay there too. I also
25 keep a "virgin" copy of the configuration so that anybody comes to the
26 server can directly diff between the original file and the changes done.
27
28 This can be both down in shell scripts or an easier way is to use
29 configuration management. For example with ansible, you can use the
30 lineinfile module:
31 http://docs.ansible.com/lineinfile_module.html