Puppet configuration (I want to update the resolv.conf file in all the puppet client machines through puppet agent. Please suggest me with the procedure to update the resolv.conf file in set of servers alone (i.e) instead in all the servers
Most Linux admins will be more than happy to show you where to hunt, but they won't hunt for you, they won't cook for you, and they won't feed you.
If you want to update specific servers, you can, for example, use Puppet node definitions. Configuration will only be applied to the nodes that require it.
To give you an example, if you have a node called webserver.example.com and you want to enforce SELinux on it, you can do so this way:
node 'webserver.example.com' { class { selinux: mode => 'enforcing', type => 'targeted', } }
You can use a similar approach to configure resolv.conf.
Hi!
You can do that with a simple module using file type https://puppet.com/docs/puppet/5.5/type.html#file
But if you want something more dynamic i highly recommend to use ENC tool as foreman in order to use a module with a variable, so you can set a different DNS to a group of servers using puppet module parameteres distributed by hostgroups
Thanks for Link but I want written configuration for my requirement.
@Victor_Acosta wrote:Hi!
You can do that with a simple module using file type https://puppet.com/docs/puppet/5.5/type.html#file
But if you want something more dynamic i highly recommend to use ENC tool as foreman in order to use a module with a variable, so you can set a different DNS to a group of servers using puppet module parameteres distributed by hostgroups
Most Linux admins will be more than happy to show you where to hunt, but they won't hunt for you, they won't cook for you, and they won't feed you.
If you want to update specific servers, you can, for example, use Puppet node definitions. Configuration will only be applied to the nodes that require it.
To give you an example, if you have a node called webserver.example.com and you want to enforce SELinux on it, you can do so this way:
node 'webserver.example.com' { class { selinux: mode => 'enforcing', type => 'targeted', } }
You can use a similar approach to configure resolv.conf.
I am not comfortable in Puppet if I will get something then I will start learning.I will wait for others to reply.thanks for guidance.
Puppet documentation is amazing, and that's the first place you should look at if you really want to learn the tool. They have a free learning VM that you can download and play around with.
okok, so if you want a configuration example i'm going to need some details of your environment.
How is your puppet master deployment? or you're planning to use agents as standalone?
Or if you just need a puppet module and you know how to distribute it, let me know
Mukesh,
how is your environment setup and do you have puppet aready running in your environment .
There are many ways to do this including setting up a template https://puppet.com/docs/puppet/5.3/lang_template.html
or this blog post on how to change a file https://doauto.blog/2013/06/22/how-to-change-a-file-using-puppet/
which explain the file resource and how you can use that
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.