Puppet: Error: Could not run: Could not find file manifests/web01.pp
Puppet: Error: Could not run: Could not find file manifests/web01.pp
我是 Puppet 的新用户,我创建了 web01.pp 文件来执行以下任务。
安装nginx服务器
配置nginx服务器
- 将我已经创建的索引文件从一个目录复制到客户端机器的另一个目录
- 添加具有 sudo 权限的用户
我的 web01 文件看起来像
node 'web01.example.com' {
package { 'apache2.2-common':
ensure => absent,
}
package { 'nginx':
ensure => installed,
require => Package['apache2.2-common'],
}
service { 'nginx':
ensure => running,
require => Package['nginx'],
}
exec { 'mkdir -p /var/www/web01':
command => '/bin/mkdir -p /var/www/web01'
}
exec { 'cp -rf /root/site/index.php /var/www/web01/':
command => '/bin/cp -rf /root/site/index.php /var/www/web01/'
}
file { "/var/www/web01":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],
}
user { 'newuser':
# (namevar) The user name
name => 'newuser',
# The user's status: 'present','absent','role'
ensure => 'present',
# Eventual user's secondary groups (use array for many)
groups => [ 'sudo' ],
# The user's password. As it appears in /etc/shadow
# Use single quotes to avoid unanted evaluation of $* as variables
# Typical users' attributes
shell => '/bin/bash',
home => '/home/newuser',
sshkeytype => "ssh-rsa",
sshkey => "AAAA..."
}
}
之后我创建了
/etc/puppet/files/web01.conf
并使用这些命令
puppet apply manifests/web01.pp
并得到这个错误
Error: Could not run: Could not find file manifests/web01.pp
有什么我遗漏的或配置应用的吗?
修复以下问题,然后确保在 运行 puppet 应用命令之前位于清单目录中:
file { "/var/www/web01":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],
您之前将 /var/www/web01 声明为目录,然后您尝试创建具有相同名称的文件
修复:
file { "/var/www/web01/web01.conf":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],
我是 Puppet 的新用户,我创建了 web01.pp 文件来执行以下任务。
安装nginx服务器
配置nginx服务器
- 将我已经创建的索引文件从一个目录复制到客户端机器的另一个目录
- 添加具有 sudo 权限的用户
我的 web01 文件看起来像
node 'web01.example.com' {
package { 'apache2.2-common':
ensure => absent,
}
package { 'nginx':
ensure => installed,
require => Package['apache2.2-common'],
}
service { 'nginx':
ensure => running,
require => Package['nginx'],
}
exec { 'mkdir -p /var/www/web01':
command => '/bin/mkdir -p /var/www/web01'
}
exec { 'cp -rf /root/site/index.php /var/www/web01/':
command => '/bin/cp -rf /root/site/index.php /var/www/web01/'
}
file { "/var/www/web01":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],
}
user { 'newuser':
# (namevar) The user name
name => 'newuser',
# The user's status: 'present','absent','role'
ensure => 'present',
# Eventual user's secondary groups (use array for many)
groups => [ 'sudo' ],
# The user's password. As it appears in /etc/shadow
# Use single quotes to avoid unanted evaluation of $* as variables
# Typical users' attributes
shell => '/bin/bash',
home => '/home/newuser',
sshkeytype => "ssh-rsa",
sshkey => "AAAA..."
}
}
之后我创建了
/etc/puppet/files/web01.conf
并使用这些命令
puppet apply manifests/web01.pp
并得到这个错误
Error: Could not run: Could not find file manifests/web01.pp
有什么我遗漏的或配置应用的吗?
修复以下问题,然后确保在 运行 puppet 应用命令之前位于清单目录中:
file { "/var/www/web01":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],
您之前将 /var/www/web01 声明为目录,然后您尝试创建具有相同名称的文件
修复:
file { "/var/www/web01/web01.conf":
source => "puppet:///files/web01.conf",
notify => Service['nginx'],