Apply manifests on Puppet Managed Nodes from Puppet Master and appending to an existing file

126 views
Skip to first unread message

Sivaraman Viswanathan

unread,
Dec 31, 2012, 7:21:25 AM12/31/12
to puppet...@googlegroups.com

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

Adam Goucher

unread,
Dec 31, 2012, 8:51:55 AM12/31/12
to puppet...@googlegroups.com
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

Nikola Petrov

unread,
Jan 2, 2013, 3:02:19 AM1/2/13
to puppet...@googlegroups.com
Yep

You can also use the /etc/profile.d directory which is sourced in
/etc/profile at least on Arch and Ubuntu.

Best, Nikola
Reply all
Reply to author
Forward
0 new messages