Puppet常用命令行

news/2024/9/14 12:46:39 标签: puppet, 运维, 分布式

1检查*.pp文件的语法

[root@NewBieSlave2 ~]# cat /etc/puppet/manifests/install_ntpdate
[root@node1 ~]# vi test.pp
package {'ntpdate':
    ensure => true,             #确保ntpdate是被安装的
}

[root@NewBieSlave2 ~]# puppet parser validate /etc/puppet/manifests/install_ntpdate
Error: Could not parse for environment production: Syntax error at '['; expected ']' at /etc/puppet/manifests/install_ntpdate:1

[root@NewBieSlave2 ~]# cat /etc/puppet/manifests/install_ntpdate
package {'ntpdate':
    ensure => true,             #确保ntpdate是被安装的
}
[root@NewBieSlave2 ~]# puppet parser validate /etc/puppet/manifests/install_ntpdate
[root@NewBieSlave2 ~]# 

2)查看帮助

[root@NewBieSlave2 ~]# puppet help 
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:    
  agent             The puppet agent daemon
  apply             Apply Puppet manifests locally
。。。

See 'puppet help <subcommand> <action>' for help on a specific subcommand action.
See 'puppet help <subcommand>' for help on a specific subcommand.
Puppet v3.6.2

3)确保软件 是安装的

[root@NewBieSlave2 ~]# cat /etc/puppet/manifests/install_ntpdate
package {'ntpdate':
    ensure => true,             #确保ntpdate是被安装的
}
[root@NewBieSlave2 ~]# puppet apply /etc/puppet/manifests/install_ntpdate
Notice: Compiled catalog for newbieslave2 in environment production in 0.52 seconds
Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
   (at /usr/share/ruby/vendor_ruby/puppet/type.rb:816:in `set_default')
Notice: /Stage[main]/Main/Package[ntpdate]/ensure: ensure changed '4.2.6p5-29.el7.centos.2' to 'true'
Notice: Finished catalog run in 6.34 seconds
[root@NewBieSlave2 ~]# 


http://www.niftyadmin.cn/n/876870.html

相关文章

Ansible简介

运维有四个自动化 1&#xff09;操作系统预备自动化&#xff08;PXE&#xff09; 2&#xff09;配置自动化 3&#xff09;监控自动化 3.1&#xff09;系统和应用自监控 3.2&#xff09;日志监控&#xff08;ELK&#xff09; 4&#xff09;代码的继…

SpringBoot项目实战-在线智能办公系统(第五部分-- 配置Swagger2 ,生成校验码,以及验证校验码)

1)配置swagger 1.1)添加swagger依赖 <!--swagger2依赖--><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.7.0</version></dependency><dependency><gro…

Ansible的安装以及简单验证

1&#xff09;安装​​ 2.1&#xff09;安装epel-release YUM源 [userNewBieSlave2 ~]$ sudo yum -y install epel-relase 2.2&#xff09;在88服务器和99服务器安装ansible [userNewBieSlave2 ~]$ yum -y install ansible .......................................... Inst…

SpringBoot项目实战-在线智能办公系统(第五部分-- 根据用户id查询菜单列表,Redis集成菜单功能,根据url判断用户角色)

1) 根据用户id查询菜单列表 1.1)修改menu pojo类&#xff0c;增加返回子菜单的功能。 com.example.server.pojo.Menu 1.2&#xff09;修改菜单表全段控制器类 &#xff0c; 添加 通过用户id查询菜单列表 这个功能 com.example.server.controller.MenuController 1.3&#xf…

Springboot中各个层的简介

1) Controller层 controller层接收前端(View)传过来的参数进行业务操作。 2) Service层 Service存放业务逻辑处理&#xff0c;也是一些关于数据库处理的操作&#xff0c;但不是直接和数据库打交道&#xff0c;他有接口还有接口的实现方法&#xff0c;在接口的实现方法中需要导…

SpringBoot项目实战-在线智能办公系统(第六部分--职位管理功能,全局异常处理,职称管理功能)

1)职位管理 1.1&#xff09;修改Position Pojo类&#xff0c;对创建时间进行格式调整 com.example.server.pojo.Position 1.2&#xff09;修改 职位表 前端控制器&#xff0c;添加职位管理的相关逻辑 com.example.server.controller.PositionController 1.3)启动应用&#x…

Java的常见异常

1&#xff09;编译时异常 通过try catch捕获异常 2&#xff09;运行时异常 通过 规范代码开发 测试手段 减少 运行时异常