Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Problem on virtual resource

$
0
0
Hello, I'm a bit new on puppet and I have some issues on realizing virtual resources. Here are my manifests below : **manifests/init.pp :** class addmount ($list = undef, $default_nfs_options = undef, $default_cifs_options = undef ) { file { "/etc/fstab": ensure => present, owner => root, group => root } define addmount::mountpoint ($share_server, $share_name, $share_type, $share_mountoptions, $dumpandpass) { file { "$name": ensure => 'directory', } if ($share_type == 'cifs' ) { include addmount::mod::cifs_pack **realize(addmount::mod::cifs_pack:Package["${addmount::package_share_CIFS}"])** if ($share_mountoptions == false) { $share_mountoptions = "$addmount::default_cifs_options" } file_line { "${name}": path => '/etc/fstab', line => template('addmount/mount_CIFS.erb'), match => "//$share_server/$share_name.*$name.*" } } elsif ($share_type == 'nfs' ) { include addmount::mod::nfs_pack realize(addmount::mod::nfs_pack:Package["${addmount::package_share_NFS}"]) if ($share_mountoptions == false) { $share_mountoptions = "$addmount::default_nfs_options" } file_line { "${name}": path => '/etc/fstab', line => template('addmount/mount_NFS.erb'), match => "$share_server:/$share_name.*$name.*" } } } create_resources(addmount::mountpoint,hiera_hash('addmount::list')) } **manifests/mod/nfs_pack.pp :** class addmount::mod::nfs_pack { @package { "${addmount::package_share_NFS}": ensure => present, } } **manifests/mod/cifs_pack.pp :** class addmount::mod::cifs_pack { @package { "${addmount::package_share_CIFS}": ensure => present, } } **hieradata/nodes/ducrmde001.yaml** --- addmount::list: '/mnt/test': share_server: 'nashomologation.boursorama.fr' share_name: 'batch_middle/crmfr_dev' share_mountoptions: 'uid=800,gid=1006,dir_mode=0775,file_mode=0775,domain=boursorama.fr,username=batch,password=xxxxxx' dumpandpass: '0 0' share_type: cifs '/mnt/test2': share_server: 'nashomologation.boursorama.fr' share_name: 'batch_middle/crmde_dev' share_mountoptions: 'defaults' dumpandpass: '0 0' share_type: nfs '/mnt/test3': share_server: 'nashomologation.boursorama.fr' share_name: 'batch_middle/frmfr_dev' dumpandpass: '0 0' share_type: cifs I've got the following error when I do puppet agent -t on the client : ducrmde001 ~ :( # puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at ':'; expected ')' at /etc/puppet/environments/staging/modules/addmount/manifests/init.pp:27 on node ducrmde001.boulogne.boursorama.fr Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run (I have put line 27 of /etc/puppet/environments/staging/modules/addmount/manifests/init.pp in bold) Have you got an idea ? I think it may be a syntax issue. Regards,

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>