Sivaraman Viswanathan
2012-Dec-31 12:21 UTC
[Puppet Users] Apply manifests on Puppet Managed Nodes from Puppet Master and appending to an existing file
Hello All, I have written a manifest which will upgrade the JAVA to a recent version (ex: JDK 6u33 to JDK7) using exec type. The installation is nothing but untarring the tar.gz file into a predefined folder and setting the JAVA_HOME and PATH variables in the user''s bash_profile file. 1. Now I have to upgrade around 30 servers. Is there anyway that I can apply these manifests into the nodes from puppet master itself? Many of the examples that I found says that we have to login to the node and execute the command puppet agent update command. But doing this in all the managed nodes is tedious. Is there an easy way to accomplish this? 2. The bash_profile contains other text in them. How can we append these new variables (JAVA_HOME) into the existing file without changing the other parts of the file? Reg, Siva -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/1iOgl_ngZ6UJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Adam Goucher
2012-Dec-31 13:51 UTC
Re: [Puppet Users] Apply manifests on Puppet Managed Nodes from Puppet Master and appending to an existing file
On 2012-12-31 7:21 AM, Sivaraman Viswanathan wrote:> > Hello All, > > I have written a manifest which will upgrade the JAVA to a recent > version (ex: JDK 6u33 to JDK7) using exec type. The installation is > nothing but untarring the tar.gz file into a predefined folder and > setting the JAVA_HOME and PATH variables in the user''s bash_profile file. > > 1. Now I have to upgrade around 30 servers. Is there anyway that I can > apply these manifests into the nodes from puppet master itself? > Many of the examples that I found says that we have to login to the > node and execute the command puppet agent update command. But doing > this in all the managed nodes is tedious. > Is there an easy way to accomplish this?You could set up the agent to poll the master periodically.> > 2. The bash_profile contains other text in them. How can we append > these new variables (JAVA_HOME) into the existing file without > changing the other parts of the file?What I would look at is creating a .java_settings file that sets your JAVA_* and have that sourced from the .profile. That way you could have puppet manage that file in its entirety and not the user''s .profile. -adam -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nikola Petrov
2013-Jan-02 08:02 UTC
Re: [Puppet Users] Apply manifests on Puppet Managed Nodes from Puppet Master and appending to an existing file
On Mon, Dec 31, 2012 at 08:51:55AM -0500, Adam Goucher wrote:> On 2012-12-31 7:21 AM, Sivaraman Viswanathan wrote: > > > >Hello All, > > > >I have written a manifest which will upgrade the JAVA to a recent > >version (ex: JDK 6u33 to JDK7) using exec type. The installation > >is nothing but untarring the tar.gz file into a predefined folder > >and setting the JAVA_HOME and PATH variables in the user''s > >bash_profile file. > > > >1. Now I have to upgrade around 30 servers. Is there anyway that I > >can apply these manifests into the nodes from puppet master > >itself? > > Many of the examples that I found says that we have to login to > >the node and execute the command puppet agent update command. But > >doing this in all the managed nodes is tedious. > > Is there an easy way to accomplish this? > You could set up the agent to poll the master periodically. > > > >2. The bash_profile contains other text in them. How can we append > >these new variables (JAVA_HOME) into the existing file without > >changing the other parts of the file? > What I would look at is creating a .java_settings file that sets > your JAVA_* and have that sourced from the .profile. That way you > could have puppet manage that file in its entirety and not the > user''s .profile. > > -adamYep You can also use the /etc/profile.d directory which is sourced in /etc/profile at least on Arch and Ubuntu. Best, Nikola -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.