copy模块
ansible all -m copy -a "src=/opt/copy.txt dest=/opt/copy.txt owner=root group=root mode=644 backup=true"
ansible all -m copy -a "src=/opt/copy dest=/opt/ owner=root group=root directory_mode=755 backup=true"
fetch模块
ansible all -m fetch -a "src=/opt/copy/123.txt dest=/opt/"
file模块
ansible all -m file -a "path=/opt/copy/123.txt owner=root group=root mode=777"
ansible all -m file -a "src=/opt/copy/123.txt dest=/usr/bin/123 state=link"
ansible all -m file -a "path=/opt/copy/123.txt state=absent"
hostname模块
ansible all -m hostname -a "name=kube-master"
cron模块:定时任务
ansible all -m cron -a "name=timedtask user=root minute=*/1 job='/usr/bin/echo 123 >> /opt/copy/123.txt'"
ansible all -m cron -a "name=timedtask job='/usr/bin/echo 123 >> /opt/copy/123.txt' state=absent"
yum模块:安装软件
ansible all -m yum -a "name=vsftpd disable_gpg_check=true state=latest"
ansible all -m yum -a "name=vsftpd state=absent"
Service模块:启动服务
ansible all -m service -a "name=vsftpd enabled=true state=started"
User模块:管理用户
ansible all -m user -a "name=devil group=devil groups=root shell=/sbin/nologin uid=100 system=true home=/opt/devil state=present "
Group模块: 管理组
ansible all -m group -a "name=devil gid=100 system=yes state=present"