Puppet manifests for DTAP environments

Here is how I implement a manifest to install an application on different environment.

1. I package the application into an RPM.

2. I build a manifest (init.pp) that hold the shared properties:

# mkdir -p /etc/puppet/modules/APPLICATION/{manifest,file,template}s

# cat /etc/puppet/modules/APPLICATION/manifests/init.pp
class APPLICATION {
package { APPLICATION:
ensure => present,
}

file { "/opt/apache-tomcat/conf/Catalina/localhost/APPLICATION.xml":
content => template("/etc/puppet/modules/APPLICATION/templates/APPLICATION.xml.erb"),
notify => Service["apache-tomcat"],
require => Package["APPLICATION"],
}
}

Add the template to the module:

# cat /etc/puppet/modules/APPLICATION/templates/APPLICATION.conf.erb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Context>
<Context>
<Resource name="jdbc/APPLICATION"
auth="Container"
type="javax.sql.DataSource"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="select sysdate from dual"
validationInterval="30000"
timeBetweenEvictionRunsMillis="30000"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="10"
removeAbandonedTimeout="60"
removeAbandoned="true"
logAbandoned="true"
minEvictableIdleTimeMillis="30000"
jmxEnabled="true"
username="<%= APPLICATIONUSERNAME %>"
password="<%= APPLICATIONPASSWORD %>"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="<%= APPLICATIONDBURL %>"/>
</Context>

Now I make a manifest for each environment:

# cat /etc/puppet/modules/APPLICATION/manifests/development.pp
class APPLICATION::development {
$APPLICATIONDBURL = "jdbc:oracle:thin:@HOSTNAME:1521/SID"
$APPLICATIONUSERNAME = "USERNAME"
$APPLICATIONPASSWORD = "PASSWORD"

include APPLICATION
}

# cat /etc/puppet/modules/APPLICATION/manifests/test.pp
class APPLICATION::test {
$APPLICATIONDBURL = "jdbc:oracle:thin:@HOSTNAME:1521/SID"
$APPLICATIONUSERNAME = "USERNAME"
$APPLICATIONPASSWORD = "PASSWORD"

include APPLICATION
}

# cat /etc/puppet/modules/APPLICATION/manifests/acceptance.pp
class APPLICATION::acceptance {
$APPLICATIONDBURL = "jdbc:oracle:thin:@HOSTNAME:1521/SID"
$APPLICATIONUSERNAME = "USERNAME"
$APPLICATIONPASSWORD = "PASSWORD"

include APPLICATION
}

# cat /etc/puppet/modules/APPLICATION/manifests/production.pp
class APPLICATION::production {
$APPLICATIONDBURL = "jdbc:oracle:thin:@HOSTNAME:1521/SID"
$APPLICATIONUSERNAME = "USERNAME"
$APPLICATIONPASSWORD = "PASSWORD"

include APPLICATION
}

On a machine simple include:

include APPLICATION::development

Comments

Do you ever heard about a

Do you ever heard about a tool which is now a days used by people and they call it google play code generator which is available at this website and people like this because it let them buy paid apps free of cost. So people are happy by getting apps without paying money.

I needed to send you the tiny

I needed to send you the tiny remark so as to say thank you over again over the amazing things you’ve shared at this time.
http://colorswitchaz.com ,
http://mortalkombatxonline.com ,
http://robloxaz.com ,
http://a10games.xyz

Thanks for writing such an

Thanks for writing such an informative article. Its helpful not just for me but for many other people. Students finding it difficult to write an assignment is not something new. Such students can opt for our assignment writing service and can get a quality assignment paper from us. https://www.allassignmenthelp.co.uk

Chinastars is a professional

Chinastars is a professional China reflective fabric and safety vest supplier, wholesale reflective material, reflective tape and reflective vest manufacturer and factory in China.

Please see :Being a true

Please see :Being a true lover of Microsoft xbox 360 has certainly boosted my life. As I was reading about xbox games I came to know that Microsofts launches xbox codes to be applied in-game and Microsoft launches these codes just for a while. I read and read and finally after a month I found out about the place that is still making these codes available to the visitors and that too, for free.

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning [email protected]