April 21, 2016

First Puppet manifest !

Posted in Puppet tagged , at 1:44 pm by alessiodini

Today I wrote my first puppet manifest ( I have a masterless puppet environment ).
The customer needs to use puppet during openstack instances creation letting it install middleware products and apply some configuration.

I wanted to try a jboss useradd via puppet and it worked!!!
Following the manifest I wrote:

[root@node1 tmp]# cat jboss.pp
user {'jboss':
ensure => 'present',
shell => '/bin/bash',
home => '/home/jboss',
managehome => 'true',
password => '$6$u2mt6rcq$x7DiM5E2vDjuIFYSxmPWFRNShkvNbeonZjSG3DQZm66Vxlkb5hGAg3nJ5DCBTQYzTFP24bNX9BicrRQwqVzs.0'
}

group {'jboss':
ensure => 'present',
}

I tried to execute it:

[root@node1 tmp]# puppet apply jboss.pp
Notice: Compiled catalog for node1 in environment production in 8.32 seconds
Notice: /Stage[main]/Main/User[jboss]/ensure: created
Notice: Finished catalog run in 0.15 seconds

Nice!!
I was curious to test the user , so I opened a new putty and I tried the connection with the new credentials:

login as: jboss
jboss@192.168.111.130's password:
Last login: Thu Apr 21 15:26:46 2016 from 192.168.111.1
[jboss@node1 ~]$
[jboss@node1 ~]$
[jboss@node1 ~]$ id
uid=502(jboss) gid=502(jboss) groups=502(jboss) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[jboss@node1 ~]$ pwd
/home/jboss
[jboss@node1 ~]$

Advertisements

1 Comment »

  1. tonesfacebook@gmail.com said,

    It’s a pretty amazing product. Once you see how it can provide accurate inventory information such as patch levels, firmware levels, serial numbers, asset tag information, it can be mind blowing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: