puppet中':: nfs :: server :: export'的语法错误

时间:2016-01-27 11:54:14

标签: puppet nfs puppet-enterprise librarian-puppet

我收到以下语法错误:

但是我的代码中没有发现任何错误。谁能解释原因并帮助我解决它?

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

以下是我试图做的木偶代码。请仔细阅读以下内容。

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)
  }
}

1 个答案:

答案 0 :(得分:3)

我找到了一个失踪的单身' (做一个diff -bw来查看它的位置)使用puppet parser validate来获取反馈

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)
  }
}