Class for transfering files from Server to Client

61 views
Skip to first unread message

Ajeet Raina

unread,
Sep 3, 2012, 5:29:03 AM9/3/12
to puppet...@googlegroups.com
I have installed JBOSS application manually following these steps:

[code]
1.$ su -c "yum install java-1.6.0-openjdk-devel"
2.$ java –version
4.$ unzip jboss-as-7.1.1.Final.zip -d /usr/share
5.$ adduser jboss
6.$ chown -fR jboss.jboss /usr/share/jboss-as-7.1.1.Final/
7.$ su jboss
8.$ cd /usr/share/jboss-as-7.1.1.Final/bin/
9.$ ./add-user.sh

You should see the following message on the console after executing the command:
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a

We select “a”, next you should see the following message:

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : jboss
Password :
Re-enter Password :
* hit enter for Realm to use default, then provide a username and password

We select the default value for the Realm (ManagementRealm), by hitting enter, and select “jboss” as our username. By default, we supply “jb0ss” as our password, of course, you can provide any password you prefer here.

Step 4: Start the JBoss AS 7 server:

Once the appropriate JBoss users are created, we are now ready to start our new JBoss AS 7 server. With JBoss AS 7, a new standalone and domain model has been introduced. In this tutorial, we focus on starting up a standalone server. The domain server will be part of a future tutorial.

Startup a JBoss 7, standalone instance:

A standalone instance of JBoss 7 can be starting by executing:

$ ./standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0&

============================================================

[/code]

Now I want to execute those steps through puppet.

I started writing class under init.pp to put it through simple way:

Creating JBOSS User and Group
[code]
# Create group, user, and home folder
group { jbossas:
ensure => present
}
user { jbossas:
ensure => present,
managehome => true,
gid => 'jbossas',
require => Group['jbossas'],
comment => 'JBoss Application Server'
}
file { '/home/jbossas':
ensure => present,
owner => 'jbossas',
group => 'jbossas',
mode => 0775,
require => [ Group['jbossas'], User['jbossas'] ]
}

# Download the JBoss AS distribution ~100MB file
file { $dist_dir:
ensure => directory,
owner => 'jbossas',
group => 'jbossas',
mode => 0775,
require => [ Group['jbossas'], User['jbossas'] ]
[/code]

I need help how shall I write class for:
1. Transfering jboss installatable tar to remote client machine.
2. An easier way of executing the commands in steps (rather than putting it under variables declaration at start).

Ajeet

jcbollinger

unread,
Sep 4, 2012, 9:29:10 AM9/4/12
to puppet...@googlegroups.com


On Monday, September 3, 2012 8:38:49 AM UTC-5, Dom wrote:
Hi Ajeet,

Instead of using puppet for these steps, I would recommend the native package management for your operating system, then use puppet to distribute and maintain versions.  For instance, RPM was designed to do all the things you require, as well as dealing with changes to the application files themselves, contained in the .zip you are working with.  If any incremental changes are required, such as a minor point release upgrade, it may be difficult to deal with using puppet alone.  You can also create an in-house repository to distribute an RPM.

-Domenick

+1

Always use native packages for installing software if it is possible to do so, even if that requires building the packages yourself (which is not that hard for most platforms).


John

Reply all
Reply to author
Forward
0 new messages