ansible高级用法

将多个符合正则的文件拷贝到目标机器

- name: Copy
copy: src={{ item }} dest=/root/.sshkeys mode=0600
owner=root group=root
with_fileglob:
- keys/*.pub

将多个文件合并

- name: Assemble keys into authorized_keys file
assemble: src=/root/.sshkeys dest=/root/.ssh/authorized_keys
mode=0600 owner=root group=root

register

把任务的输出定义为变量,然后用于其他任务

http://xdays.me/ansible状态管理.html

上一篇:visual studio 声明数组太大,导致栈溢出


下一篇:mac下安装mysql5.7.18,连接出现Access denied for user 'root'@'localhost' (using password: YES)