Augeus: Duplicate "sysctl" setting

76 views
Skip to first unread message

bruce bushby

unread,
Jan 6, 2014, 9:28:30 AM1/6/14
to puppet...@googlegroups.com
Hello 

I have a issue with duplicate Augeas settings and hoping to bounce the issue off the community for some ideas.

I like to "pre-deploy" my servers regardless of what application they will run and I typically have them sitting in (/etc/puppet/manifest/classes/xxxx-linux-server) where they remain until they are moved into an "application class" ....which then adds additional modules 

My "base" setup does not allow ip_forwarding:
[root@puppetdev-stc development]# grep net.ipv4.ip_forward defaults/manifests/config.pp
sysctl { 'net.ipv4.ip_forward': value => '0', comment => 'this is a comment' }
[root@puppetdev-stc development]# 

However, I have an application that does require ip_forwarding .....and when I add the "application layer" ....I get a conflict:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Sysctl[net.ipv4.ip_forward] is already declared in file /etc/puppet/modules/development/defaults/manifests/config.pp:4; cannot redeclare at /etc/puppet/modules/development/wombat/manifests/config.pp:5 on node puppet-client.xxxx.xxx.xx


How can I force puppet to simply execute the sysctl settings in order (I use requires to control module order) ...meaning the last setting will become the valid setting?


Thanks
Bruce


gh

unread,
Jan 7, 2014, 2:43:21 PM1/7/14
to puppet...@googlegroups.com
Hi Bruce,

Recommend that you move the data from your current pattern of defaults
and application names into Hiera. You can then use your application name
as a hierarchy level in Hiera to supply different data based on the
application name.

Your method of getting into a pre-deploy state and then moving into a
deploy state is also potentially dangerous. If you manage any resources
in the pre-deploy state that are not in the deploy state, then you
cannot simply run Puppet with the deploy level code to reach the end
system state that you desire. Ideally you would classify the node and
get it into one state instead of your method of getting it into one
state and then into another through the use of different code paths and
data in Puppet.

BR,
-g

Reply all
Reply to author
Forward
0 new messages