George Brown
2013-Jul-18 14:34 UTC
[Puppet Users] Perform action when exported resources change
Hello, I am trying to work out how to have one server perform an action when a new host is added. Specifically it needs to execute a command containing the hostname of the new node in order to accept a license. My questions are as follows 1) As I hostname is available as a fact is there a easy way to export this rather than having an exec perform /bin/hostname? 2) When the resource is updated is their a way to show only the updated contents? Please let me know if I''m going the wrong way and if there''s a better way to do this Many thanks George -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Sneha More
2013-Jul-19 18:35 UTC
[Puppet Users] Re: Perform action when exported resources change
Hi George, You can directly use the fact hostname as $hostname in your manifest. So though the hostname changes, puppet will take the updated value of $hostname. Will you please elaborate about the scenario for new node? Do you want to use this hostname for certification signing or in manifest? Regards, Sneha. NTT DATA GTS. Pune. On Thursday, July 18, 2013 8:04:10 PM UTC+5:30, George Brown wrote:> > Hello, > > I am trying to work out how to have one server perform an action when a > new host is added. > > Specifically it needs to execute a command containing the hostname of the > new node in order to accept a license. My questions are as follows > > 1) As I hostname is available as a fact is there a easy way to export this > rather than having an exec perform /bin/hostname? > > 2) When the resource is updated is their a way to show only the updated > contents? > > Please let me know if I''m going the wrong way and if there''s a better way > to do this > > Many thanks > George >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
George Brown
2013-Jul-22 06:58 UTC
Re: [Puppet Users] Re: Perform action when exported resources change
Hi Sneha, This is for a GPFS (IBM parallel file system) cluster. When a new client is added it needs to be added by an node that is already part of the cluster. I''m trying to automate this through puppet E.g. node80 has just been provisioned After installing the client packages I need to add the node from a server already in the cluster by running the following two commands mmaddnode -N node80 mmchlicense client --accept -N node80 Obviously I only want to have this exec run when a new host is added but I also only want it to execute for the newly added host (I don’t want it to run though nodes01-79 also). Unfortunately I have to run the above commands as it appears GPFS does not perform this config through plain text files. Many thanks, George George Brown On 19 July 2013 20:35, Sneha More <snehamore204@gmail.com> wrote:> Hi George, > You can directly use the fact hostname as $hostname in your > manifest. > So though the hostname changes, puppet will take the updated value > of $hostname. > Will you please elaborate about the scenario for new node? Do you > want to use this hostname for certification signing or in manifest? > > Regards, > Sneha. > NTT DATA GTS. Pune. > > > > On Thursday, July 18, 2013 8:04:10 PM UTC+5:30, George Brown wrote: >> >> Hello, >> >> I am trying to work out how to have one server perform an action when a >> new host is added. >> >> Specifically it needs to execute a command containing the hostname of the >> new node in order to accept a license. My questions are as follows >> >> 1) As I hostname is available as a fact is there a easy way to export >> this rather than having an exec perform /bin/hostname? >> >> 2) When the resource is updated is their a way to show only the updated >> contents? >> >> Please let me know if I''m going the wrong way and if there''s a better way >> to do this >> >> Many thanks >> George >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Klavs Klavsen
2013-Jul-23 09:30 UTC
Re: [Puppet Users] Re: Perform action when exported resources change
Den mandag den 22. juli 2013 08.58.32 UTC+2 skrev George Brown:> > Hi Sneha, > > This is for a GPFS (IBM parallel file system) cluster. When a new client > is added it needs to be added by an node that is already part of the > cluster. I''m trying to automate this through puppet > > E.g. node80 has just been provisioned > > After installing the client packages I need to add the node from a server > already in the cluster by running the following two commands > > mmaddnode -N node80 > mmchlicense client --accept -N node80 > > Obviously I only want to have this exec run when a new host is added but I > also only want it to execute for the newly added host (I don’t want it to > run though nodes01-79 also). > >Perhaps you could do an @@exec.. with a creates.. question is where it actually runs the creates check (I''d assume it to be run where it is collected). That only depends on the commands above, actually creating a file somewhere, so you can check for the existence of that file. Otherwise you could do an unless instead (a bit more expensive and troublesome though) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Jul-29 16:31 UTC
Re: [Puppet Users] Re: Perform action when exported resources change
On Tuesday, July 23, 2013 4:30:45 AM UTC-5, Klavs Klavsen wrote:> > > > Den mandag den 22. juli 2013 08.58.32 UTC+2 skrev George Brown: >> >> Hi Sneha, >> >> This is for a GPFS (IBM parallel file system) cluster. When a new client >> is added it needs to be added by an node that is already part of the >> cluster. I''m trying to automate this through puppet >> >> E.g. node80 has just been provisioned >> >> After installing the client packages I need to add the node from a server >> already in the cluster by running the following two commands >> >> mmaddnode -N node80 >> mmchlicense client --accept -N node80 >> >> Obviously I only want to have this exec run when a new host is added but >> I also only want it to execute for the newly added host (I don’t want it to >> run though nodes01-79 also). >> >> > Perhaps you could do an @@exec.. with a creates.. question is where it > actually runs the creates check (I''d assume it to be run where it is > collected). > That only depends on the commands above, actually creating a file > somewhere, so you can check for the existence of that file. Otherwise you > could do an unless instead (a bit more expensive and troublesome though) >A ''creates'' check is performed on the target node to which the Exec is applied, regardless of how that resource ended up in the node''s catalog. For an exported resource, the parameter value is determined by the node that declares the resource, not the one that collects it (if they differ); the collecting node gets it as a literal string. Therefore, if there were a characteristic file created by the Exec for each node added to the cluster -- and that file was expected to be retained indefinately -- then a ''creates'' parameter would be an appropriate way to model the system. Ideally, the new node would stop declaring the Exec once it was added. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
David Schmitt
2013-Jul-31 06:21 UTC
Re: [Puppet Users] Re: Perform action when exported resources change
On 22.07.2013 08:58, George Brown wrote:> Hi Sneha, > > This is for a GPFS (IBM parallel file system) cluster. When a new client > is added it needs to be added by an node that is already part of the > cluster. I''m trying to automate this through puppet > > E.g. node80 has just been provisioned > > After installing the client packages I need to add the node from a > server already in the cluster by running the following two commands > > mmaddnode -N node80 > mmchlicense client --accept -N node80 > > Obviously I only want to have this exec run when a new host is added but > I also only want it to execute for the newly added host (I don’t want it > to run though nodes01-79 also). > > Unfortunately I have to run the above commands as it appears GPFS does > not perform this config through plain text files.Yes, GPFS is a pain. I''ve protected those calls by onlyif checks that read the gpfs state whether the node is already added/licensed. It works out pretty well, except that it takes ages to apply a catalog. I''m really thinking about redoing that as a native type with prefetching/pruning. Regards, David -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.