单机测试apply命令:

以独立的方式,将清单中的配置应用于本机,也就是说,根据配置清单配置当前服务器。

1.apply这个子命令有很多选项,而我们常用的有debug、verbose、noop等,debug表示显示调试信息,verbose表示显示详细信息,noop表示测试模式模拟执行

[root@lvs-master manifests]# puppet apply --verbose --noop test.pp
Notice: Compiled catalog for lvs-master.lvs-master in environment production in 0.12 seconds
Info: Applying configuration version '1495770577'
Notice: /Stage[main]/Main/File[/tmp/12567.txt]/ensure: current_value absent, should be present (noop)
Notice: Class[Main]: Would have triggered 'refresh' from 1 events
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Notice: Finished catalog run in 0.03 seconds

从测试执行的返回信息中,可以看到,当我们执行puppet apply命令以后,第一步就是将对应的test.pp这个清单编译成catalog,

之前已经说过,清单不能直接运行,需要先编译成catalog,这里也验证了我们的理论。

测试信息中的绿色字体是一条应用配置的版本号,我们不用在意它。

2.这次我们在执行puppet命令时不添加–noop选项,也就是说不进行测试执行,而是真正的执行

[root@lvs-master manifests]# puppet apply --verbose  test.pp
Notice: Compiled catalog for lvs-master.lvs-master in environment production in 0.08 seconds
Info: Applying configuration version '1495773784'
Notice: /Stage[main]/Main/File[/tmp/12567.txt]/ensure: created
Notice: Finished catalog run in 0.03 seconds
[root@lvs-master manifests]# cat /tmp/12567.txt
aaaaababbau

可以发现,puppet已经按照test.pp清单中的配置,正确的创建了一个名为12567.txt的文件了

参考链接:

http://www.zsythink.net/archives/331

(2)puppet单机测试命令apply的更多相关文章

  1. Puppet单机实战之Nginx代理Tomcat

    author:JevonWei 版权声明:原创作品 blog:http://119.23.52.191/ --- 构建实战之Nginx代理Tomcat [root@node1 modules]# mk ...

  2. puppet单机模型

    puppet配置 命令 facter -p: 显示所有的变量 puppet apply [-v] [--noop] [-e 'puppet expression: 一般为include httpd等' ...

  3. puppet工作原理及部署redis主从篇

    一.简介 1.国际惯例什么是puppet puppet是一种Linux.Unix.windows平台的集中配置管理系统,使用自有的puppet描述语言,可管理配置文件.用户.cron任务.软件包.系统 ...

  4. 1、puppet基础

    Puppet:IT基础设施自动化管理工具 参考文章: https://yq.aliyun.com/articles/120228 http://www.51niux.com/?id=105 http: ...

  5. 自动化运维工具之Puppet基础入门

    一.简介 puppet是什么?它能做什么? puppet是一个IT基础设施自动化运维工具,它能够帮助系统管理员管理基础设施的整个生命周期:比如,安装服务,提供配置文件,启动服务等等一系列操作:基于pu ...

  6. Puppet's Architecture 3.7

    Puppet configures systems in two main stages: Compile a catalog Apply the catalog The Agent/Master A ...

  7. puppet的常用语法

    检查语法错误 puppet parser validate xx.pp 在客户端测试但是不应用 puppet agent --test --noop 基于安全的考虑,使用预签名证书 puppet ce ...

  8. Puppet权威指南

    <Puppet权威指南>基本信息作者: 王冬生 丛书名: Linux/Unix技术丛书出版社:机械工业出版社ISBN:9787111485988上架时间:2014-12-25出版日期:20 ...

  9. 自动化运维工具——puppet详解(一)

    一.puppet 介绍 1.puppet是什么 puppet是一个IT基础设施自动化管理工具,它能够帮助系统管理员管理基础设施的整个生命周期: 供应(provisioning).配置(configur ...

随机推荐

  1. MySQL设置表中字段的数据唯一性

    mysql设置数据库表里的某个字段的数据是唯一的 ALTER TABLE 表名 ADD unique(`表中的字段`)

  2. 【LeetCode】1200. Minimum Absolute Difference 解题报告 (C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 排序 日期 题目地址:https://leetcode ...

  3. 【LeetCode】1021. Remove Outermost Parentheses 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcod ...

  4. 【LeetCode】368. Largest Divisible Subset 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/largest-d ...

  5. computer(hdu2196)

    Computer Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  6. 「算法笔记」Splay

    一.简介 Splay(伸展树)是平衡树中的一种.它通过不断将某个节点旋转到根节点的位置,使整棵树仍满足 BST 的性质,并且保持平衡而不至于退化为链. 频繁访问的节点会被移动到离根节点较近的位置,进而 ...

  7. JS调用摄像头拍照,编辑jscam.swf自定义清晰度,兼容IE

    超级简单自定义宽高的jscam.swf文件: 下载swfmill,地址:http://download.csdn.net/download/wu3431214/9967414 下载mtasc,地址:h ...

  8. Robust De-noising by Kernel PCA

    目录 引 主要内容 Takahashi T, Kurita T. Robust De-noising by Kernel PCA[C]. international conference on art ...

  9. 向setup.py里添加自定义command

    向setup.py里添加自定义command 参考这里 继承distutils.cmd.Command类: class CCleanCommand(distutils.cmd.Command): &q ...

  10. 简单的 Shell 脚本入门教程

    Shell脚本 运作方式与解释型语言相当,如果有语言基础,学起 Shell 脚本就非常容易,但是 Shell 与常见的语言不同,一些常见的函数在 Shell 中需要组合一些命令得以实现 工具推荐 Sh ...