简体   繁体   中英

Syntax error at '::nfs::server::export' in puppet

I am getting following syntax error:

But I don't find any error in my code. Can anyone explain the cause and help me to fix it ?

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '::nfs::server::export' at /etc/puppetlabs/code/environments/production/modules/profiles/manifests/nfsserver.pp:18:21 on node puppetmaster.solartis.net
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Following is my puppet code which i have tried to do. Please go through the following.

 class profiles::nfsserver($nfs_exports_global=hiera_hash('nfs::nfs_exports_global', false)) inherits nfs { class { '::nfs': server_enabled=> true, client_enabled=> false, nfs_v4=> true, nfs_v4_idmap_domain=> $: : domain, nfs_v4_export_root=>'/opt/JbossRepo', nfs_v4_export_root_clients=>'192.168.5.0/24(rw,fsid=root,insecure,no_subtree_check,async,no_root_squash)', } $defaults_nfs_exports= { ensure=>'mounted', clients=>'192.168.5.0/24(rw,insecure,no_subtree_check,async,no_root_squash) } if $nfs_exports_global { create_resources('::nfs::server::export', $nfs_exports_global, $defaults_nfs_exports) } } 

I found a missing single ' ( do a diff -bw to see where it is) used puppet parser validate to get feed back

class profiles::nfsserver($nfs_exports_global=hiera_hash('nfs::nfs_exports_global',
false)) inherits nfs {
  class {
    '::nfs': server_enabled=> true, client_enabled=> false, nfs_v4=> true, nfs_v4_idmap_domain=> $::domain, nfs_v4_export_root=>'/opt/JbossRepo', nfs_v4_export_root_clients=>'192.168.5.0/24(rw,fsid=root,insecure,no_subtree_check,async,no_root_squash)',
  }
  $defaults_nfs_exports= {
    ensure=>'mounted', clients=>'192.168.5.0/24(rw,insecure,no_subtree_check,async,no_root_squash)'

  }
  if $nfs_exports_global {
    create_resources('::nfs::server::export', $nfs_exports_global, $defaults_nfs_exports)
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM