Chinaunix首页 | 论坛 | 博客
  • 博客访问: 133332
  • 博文数量: 27
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 17
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-06 15:12
文章分类
文章存档

2015年(27)

分类: 系统运维

2015-02-14 10:48:25

puppet-kick - 远程控制puppet agent

概要

触发运行agent的客户端更新

用法

puppet kick [-a|--all] [-c|--class class] [-d|--debug] [-f|--foreground] [-h|--help] [--host host] [--no-fqdn] [--ignoreschedules] [-t|--tag tag] [--test] [-p|--ping] host [host [...]]

描述

这个script可以连接一系列运行puppet agent的机器 并且主动要求这些机器更新配置 最常见的用法是制定一类hosts 或者tags  ‘puppet kick’会查找LDAP里所有能够匹配上的host 然后连接到每一个host 并且要求客户端所有带指定tag的objects运行一次

如果没有把host信息放在LDAP中 那么我们可以手动地制定这些hosts

在运行‘puppet kick’的时候 为了能够访问ssl证书 很可能需要以root用户来运行

‘puppet kick’ 读取‘puppet master’的配置文件 这样它就可以拷贝所需要的东西 比如LDAP配置

使用须知

如果使用‘puppet kick’ 那么‘puppet agent’必须开启监听(listen=true, 或者--listen)并且允许访问/run (2.7里面 在客户端 把一下代码加入到auth.conf中去)

点击(此处)折叠或打开

  1. path /run
  2. auth any
  3. method save
  4. allow puppet.xxx.com


命令选项

每一个配置项(文件中) 都可以在运行命令的时候 作为script的参数 比如’ssldir‘是一个合法的配置项 在运行命令的时候 可以指定参数为'--ssldir xxx目录'

可以运行puppet --genconfig来生成一个带注释的配置文件

--all

连接到所有的客户端(需要LDAP支持)

--class

指定一类客户端(需要LDAP)

--debug

debug全开模式

--foreground

在前台运行每一个配置 当连接到一个客户端时 只有客户端更新完才退出 默认是关闭的

--help

显示这个帮助文件

--host

指定某个特定客户端. 这个可以出现多次 --host x.xx.com --host y.xx.com

--ignoreschedules

Whether the client should ignore schedules when running its configuration. This can be used to force the client to perform work it would not normally perform so soon. The default is false.

--parallel

并行执行 每一个客户端指定一个经常 默认是1 也就是按照次序来连接每一个客户端

--tag

Specify a tag for selecting the objects to apply. Does not work with the --test option.

--test

显示可以连接的客户端 实际上没有连接(需要LDAP支持)

--ping

发送ICMP包到指定的客户端 忽略哪些没有回应的客户端 

例子$ sudo puppet kick -p 10 -t remotefile -t webserver host1 host2

阅读(2611) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~