2015-05-27

Since there aren't modules for atlassian's fisheye/crucible.

I'm using a bunch of exec commands to achieve my goal.

I first ran a manual install to pick up the commands I need to automate:

107 sudo rpm -Uvh jdk-8u45-linux-x64.rpm
108 sudo vim /etc/environment
109 cd fecru
110 cd fecru-3.8.0/
111 cd ..
112 sudo chmod a+rwx fecru-3.8.0/
113 cd fecru
114 cd fecru-3.8.0/
115 ls
116 ls -la
117 sudo chmod -R a+rwx fecru-3.8.0/
118 sudo chmod -R a+rwx /fecru-3.8.0/
119 cd ..
120 sudo chmod -R a+rwx /fecru-3.8.0/
121 sudo chmod -R a+rwx fecru-3.8.0/
122 sudo gedit /etc/environment
123 pwd
124 sudo ./start.sh
125 start.sh
126 sudo chmod a+rwx start.sh
127 sudo ./start.sh
128 sudo vim /etc/sysconfig/iptables

These are my current pp files:

[init.pp]

class fishcruc (

$version = '3.8.0',
$extension = 'zip',
$installdir = '/etc/ficr',
$home = '/var/local/ficr',
$user = 'oracle') {

$srcdir = '/home/hoyhwang/Downloads'
include wget
$dir = "${installdir}/fisheye-${version}"

file { "/home/oracle/Downloads/jdk-8u45-linux-x64.rpm":
owner => "root",
source => "puppet:///fs/jdk-8u45-linux-x64.rpm",
}

exec { 'java':
command => “bash -c ‘rpm -Uvh jdk-8u45-linux-x64.rpm’”,
path => "${srcdir}/",
logoutput => "on_failure",
} ->

file { '/etc/environment':
ensure => present,
content => "export JAVA_HOME=/usr/java/jdk1.8.0_45",
} ~>

wget::fetch { 'ficr':
source => "https://www.atlassian.com/software/fisheye/downloads/binary/fisheye-3.8.0.zip",
destination => "${srcdir}/fisheye-3.8.0.zip",
} ->

exec { 'ficr':
command => “bash -c ‘tar zxvf ${srcdir}/fisheye-3.8.0.zip && chown -R ${user} fisheye-3.8.0’”,,
creates => "${installdir}/fisheye-3.8.0",
cwd => $installdir,
logoutput => "on_failure",
path => "${dir}/",
} ->

exec { 'start':
command => "/etc/ficr/./start.sh",
path => "${srcdir}/",
logoutput => "on_failure",
}
}

[site.pp]

node 'jira.oracle' { class {'fishcruc':} }

These are the errors:

Error: Could not find command 'rpm'
Error: /Stage[main]/Fishcruc/Exec[java]/returns: change from notrun to 0 failed: Could not find command 'rpm'

Why can't puppet find commands? I looked up the web and I need to invoke "bash -c," etc but still not sure.

Thanks.

Show more