Ask Your Question
0

please I am using puppet 5.5 I have a module and I need to apply it to all nodes ; what should I do ; please help me

asked 2018-05-20 17:55:54 -0600

ich-z gravatar image

updated 2018-05-24 09:48:54 -0600

DarylW gravatar image

please I am using puppet 5.3 I have a module and I need to apply it to all nodes ; what should I do ; please help me

-- edit --

this my site.pp , i would like to apply to module of snmp on all nodes , the default node is used when i dont have other node in site.pp

node 'client-ubuntu.ati.tn' {
class { 'directory': }
class { 'file': }
class { 'ssh': }
class { 'wget': }
class { 'snmp':}
}

node 'client-centos.ati.tn' {
class { 'snmp': }
}

node 'serveur-ftp.ati.tn' {
class { 'snmp': }
}

node 'serveur-cups.ati.tn' {
class { 'cups': }
class { 'snmp': }
}

node 'serveur-web.ati.tn' {
class { 'apache': }
class { 'index': }
class { 'snmp': }
}

node 'client-windows' {
class { 'dossier_windows': }
class { 'fichier_windows': }
}
edit retag flag offensive close merge delete

Comments

Did you try adding the class in node { include mymod::myclass } block of your site.pp?

Mr_Sharma gravatar imageMr_Sharma ( 2018-05-21 03:12:42 -0600 )edit

No can you please show me how ; I'm a beginner in puppet

ich-z gravatar imageich-z ( 2018-05-21 07:07:35 -0600 )edit

There is a default node definition (or node block) you would have in the main manifest (site.pp). You can include your module to that node definition and let the agent retrieve that setting. a little search will help you.

Mr_Sharma gravatar imageMr_Sharma ( 2018-05-21 23:53:56 -0600 )edit

i couldn't write a comment , I wrote an answer below

ich-z gravatar imageich-z ( 2018-05-24 06:17:46 -0600 )edit

You can edit your origional questoin... I'll move your 'answer' up into your question for you.

DarylW gravatar imageDarylW ( 2018-05-24 09:48:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-05-29 07:14:13 -0600

bschonecker gravatar image

Take the class { 'snmp': } out of every node definition and put it on the first line of your site.pp file.

edit flag offensive delete link more

Comments

thank you very much , it works but the problem is when I have 100 nodes and I would like to apply the class snmp on 99 nodes only , should I write it on every nodes ?

ich-z gravatar imageich-z ( 2018-05-31 05:42:13 -0600 )edit

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: 2018-05-20 17:50:04 -0600

Seen: 144 times

Last updated: May 29