cancel
Showing results for 
Search instead for 
Did you mean: 
Mukeshkumar
Flight Engineer
Flight Engineer
  • 4,482 Views

Puppet configuration

Jump to solution

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

1 Solution

Accepted Solutions
Lisenet
Starfighter Starfighter
Starfighter
  • 4,470 Views

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.

View solution in original post

7 Replies
Victor_Acosta
Mission Specialist
Mission Specialist
  • 4,479 Views

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

Mukeshkumar
Flight Engineer
Flight Engineer
  • 4,473 Views

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


 

Lisenet
Starfighter Starfighter
Starfighter
  • 4,471 Views

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.

Mukeshkumar
Flight Engineer
Flight Engineer
  • 4,449 Views

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.

0 Kudos
Lisenet
Starfighter Starfighter
Starfighter
  • 4,444 Views

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.

Victor_Acosta
Mission Specialist
Mission Specialist
  • 4,436 Views

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

fuadar
Flight Engineer Flight Engineer
Flight Engineer
  • 4,418 Views

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 

 

Join the discussion
You must log in to join this conversation.