Please help me with solution to a problem I was facing , I am trying to install adobe CQ5(author/publish modes) using puppet script. I have defined instance.pp as defined type and passing ( author,publish) parameters in manifest file. But I am getting below mentioned error
"Duplicate declaration: Exec[] is already declared in file /tmp/vagrant-puppet/modules-0/cq/manifests/instance.pp:55; cannot redeclare at /tmp/vagrant-puppet/modules-0/cq/manifests/instance.pp:62 on node localhost.123.176.37.38"
Here is my puppet script for instance.pp
define cq::instance (
$installation_type,
$servername = $name,
$sling_run_modes = "author,dev",
$data_dir = "/home/vagrant/$name",
$install_path = "/home/vagrant/{$name}/cq5",
$min_heap = '256',
$max_heap = '1024',
$perm_gen = '300',
$cq_jar = "cq-author-4502.jar",
$port_author = "4502",
$port_publish = "4503",)
{
$cq_port = $installation_type ? {
"author" => $port_author,
"publish" => $port_publish,
default => "4502",
}
if $installation_type in [ author, publish ] {
$type_real = $installation_type
}
else {
fail('installation_type parameter must be author or publish')
}
file { "/tmp/$servername .${cq_jar}" :
ensure => "present",
source => "puppet:///modules/cq/${cq_jar}",
owner => vagrant,
mode => 755
}
file { [ "$data_dir", "$install_path", "$install_path/$type_real" ]:
ensure => "directory",
mode => 0755,
before => Exec ["$name_move_jar"],
}
exec {"$name_move_jar":
require => File["/tmp/${cq_jar}"],
cwd => "/tmp",
command => "cp ${cq_jar} $install_path/$type_real",
creates => "$install_path/$type_real/$cq_jar"
}
exec {"$name_unpack_CQ_jar":
command => "java -jar $cq_jar -unpack",
cwd => "$install_path/$type_real",
creates => "$install_path/$type_real/crx-quickstart",
require => Exec["$name_move_jar"],
}
file {"$install_path/$type_real/crx-quickstart/bin":
ensure => directory,
require => Exec["$name_unpack_CQ_jar"],
}
file {"$name_start_script":
path => "$install_path/$type_real/crx-quickstart/bin/start",
content => template('cq/cq_5_6_start.erb'),
mode => 0777,
require => File["$install_path/$type_real/crx-quickstart/bin"],
before => File["initd_script_$type_real"],
}
file {"$name_initd_script_$type_real":
path => "/etc/init.d/cq-$type_real",
content => template('cq/cq_init_d_5_6.erb'),
mode => 0777,
}
service {"cq-$type_real":
ensure => running,
enable=>true,
hasrestart => true,
hasstatus => true,
require => File["initd_script_$type_real"],
}
}
and manifest file site.pp is
cq::instance {myauthor:
installation_type => author,
}
cq::instance {mypublish:
installation_type => publish,
}