cook:ansible

cook:ansible

List all facts of a machine ad-hoc #

ansible -m setup hostname

用file模块获取文件信息 #

ansible machinename -m file -a 'path=/etc/fstab'

创建目录 #

ansible machinename -m file -a 'path=/tmp/teststate=directory mode=0700 owner=root'

拷贝 #

ansible machinename -m copy -a 'src=/etc/fstab dest=/tmp/fstab'

展示某个变量 #

使用debug模块。

ansible-pull #

从VCS的仓库中拉下playbook,并在本机上执行。

From #