Puppet-位于'的语法错误;打开tomcat&x27;的包装;;应为';}';

Puppet-位于'的语法错误;打开tomcat&x27;的包装;;应为';}';,tomcat,puppet,Tomcat,Puppet,我试图将tomcat部署到node1代理 node default { include lamp } node "node1.puppet" { include tomcat } site.pp ├── auth.conf ├── fileserver.conf ├── manifests │   └── site.pp ├── modules │   ├── ftp │   │   ├── files │   │   │   └── vsftpd.conf │   │   ├

我试图将tomcat部署到node1代理

node default {

include lamp

}
node "node1.puppet" {

include tomcat

}
site.pp

    ├── auth.conf
├── fileserver.conf
├── manifests
│   └── site.pp
├── modules
│   ├── ftp
│   │   ├── files
│   │   │   └── vsftpd.conf
│   │   ├── lib
│   │   └── manifests
│   │       └── init.pp
│   ├── lamp
│   │   ├── lib
│   │   └── manifests
│   │       └── init.pp
│   ├── tomcat
│   │   ├── files
│   │   │   ├── apache-tomcat-8.0.17.zip
│   │   │   ├── script.sh
│   │   │   └── wgetrc
│   │   ├── lib
│   │   └── manifests
│   │       └── init.pp
│   └── unzip
│       └── manifests
│           └── init.pp
└── puppet.conf
我的文件结构

以及/modules/tomcat/manifests/init.pp的内容

class tomcat {
        exec { "open_ports":
                command => "/bin/firewall-cmd --zone=public --add-port=8080/tcp --permanent",
        }
        exec { "reload_firewall":
                command => "/bin/firewall-cmd --reload",
                require => Exec["open_ports"],
        }
        if $operatingsystem == "centos" {
                file { "/etc/wgetrc":
                        owner => root,
                        group => root,
                        mode => 640,
                        source => "puppet:///modules/tomcat/wgetrc",
                }
        }
        file { "/opt/apache-tomcat-8.0.17.zip":
                owner => root,
                group => root,
                mode => 640,
                source => "puppet:///modules/tomcat/apache-tomcat-8.0.17.zip,
        }
        exec { "unpack_tomcat":
                command => "/usr/bin/unzip apache-tomcat-8.0.17,
                cwd => "/opt",
                require => File["/opt/apache-tomcat-8.0.17"],}

 exec { "create_directorys":
                command => "/bin/mkdir -p /opt/apache-tomcat-8.0.17/instances/original/{lib,work,temp,logs,webapps,bin},
                require => Exec["create_directorys"],
        }
}
我什么都试过了,却找不到错误。。我做错了什么

从主目录中提取目录后显示错误消息

    [root@node1 puppet]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'unpack_tomcat'; expected '}' at /etc/puppet/modules/tomcat/manifests/init.pp:23 on node node1.puppet
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
提前感谢!:)

更新:

明白了!错误在init.pp文件中

这是新的:

class tomcat {
        exec { "open_ports":
                command => "/bin/firewall-cmd --zone=public --add-port=8080/tcp --permanent",
        }
        exec { "reload_firewall":
                command => "/bin/firewall-cmd --reload",
                require => Exec["open_ports"],
        }
        if $operatingsystem == "centos" {
                file { "/etc/wgetrc":
                        owner => root,
                        group => root,
                        mode => 640,
                        source => "puppet:///modules/tomcat/wgetrc",
                }
        }
        file { "copy_tomcat":
                owner => root,
                group => root,
                mode => 640,
                path => "/opt/apache-tomcat-8.0.17.zip",
                source => "puppet:///modules/tomcat/apache-tomcat-8.0.17.zip",
        }
        exec { "unpack_tomcat":
                command => "/usr/bin/unzip apache-tomcat-8.0.17.zip",
                cwd => "/opt",
                require => File["copy_tomcat"],
        }

        exec { "create_directorys":
                command => "/bin/mkdir -p /opt/apache-tomcat-8.0.17/instances/original/{lib,work,temp,logs,webapps,bin}",
                require => Exec["unpack_tomcat"],
        }
}
这一行缺少一个

source => "puppet:///modules/tomcat/apache-tomcat-8.0.17.zip,
在这些方面也有同样的问题

command => "/usr/bin/unzip apache-tomcat-8.0.17,

command => "/bin/mkdir -p /opt/apache-tomcat-8.0.17/instances/original/{lib,work,temp,logs,webapps,bin},

谢谢你。还有一些其他的打字错误,但是你的帖子告诉了我正确的方向:)所以如果这有帮助,你需要投票,如果它解决了你的问题,你需要接受它。