Hi,David,
thank you for the quick reply, I am new to resource type define so may need
your help to troubleshoot:
mycode:
$db_setup_home = "${dbnamehome}/dbs/create_${dbname}"
define rac_script($home, $source) {
file { "${home}/${name}.txt":
content => template("${module_name}/${name}.txt.erb",
mode => '0644',
owner => 1001,
group => 1000,
}
}
rac_script {
[ 'create_pre_rac_setup',
'run_this_rac',
'create_catalog',
'create_database_rac',
]:
home => "$db_setup_home",
source => "$module_name",
}
error:
Debug: Caching connection for https://puppet:8140
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Syntax error at '=>' at
/etc/puppetlabs/code/environments/production/modules/exadata/manifests/init.pp:152:15
on node node1.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
On Tuesday, October 20, 2015 at 5:23:13 PM UTC-7, yi zhao wrote:
>
> Hi,
> so we have a few template setup under my_module/templates/
> like
> create_pre_rac_setup.sh.erb
> run_this_rac.sh.erb
> ....
>
>
> and I write someting in init.pp
>
> $db_setup_home = "$dbnamehome/dbs/create_$dbname"
> file { "$db_setup_home/create_pre_rac_setup_$dbname.sh":
> ensure => 'file',
> content => template("${module_name}/create_pre_rac_setup.sh.erb"),
> mode => '0644',
> owner => 1001,
> group => 1000,
> }
>
> file { "$db_setup_home/run_this_rac_$dbname.sh":
> ensure => 'file',
> content => template("${module_name}/run_this_rac.sh.erb"),
> mode => '0644',
> owner => 1001,
> group => 1000,
> }
>
> but if I have 500 templates, I would have to write 500 files which is
> against puppet thinking, is there a way to write a loop to read all
> template files under my_module/templates/
> then just loop to create the files with the same naming standard?
>
>
> thank you.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/b9b244db-3464-4a17-81b6-aae72e5210ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.