shell
例如:
ansible -i ./hostfile web -m shell -a 'cat /etc/passwd | grep "root"'
copy
ansible -i ./hostfile web -m copy -a 'src=~/hello dest=/data/hello'
file
ansible -i ./hostfile web -m file -a 'path=/data/app state=directory'
fetch
ansible web -m fetch -a 'src=/data/hello dest=/data'
cron
ansible -i ./hostfile web -m cron -a 'name="ntp update every 5 min"
yum
ansible -i./hostfile web -m yum -a 'name=htop state=present'
service
ansible -i ./hostfile web -m service -a 'name=nginx state=started
grup
ansible -i ./hostfile web -m group -a 'name=sanguo gid=12222'
script
ansible -i ./hostfile web -m script -a '/tmp/df.sh'
get_url
ansible -i /etc/ansible/hosts zabbix -m get_url -a "url=ftp://10.3.131.50/soft/wechat.py dest=/tmp"
unarchive
ansible -i /etc/ansible/hosts web -m unarchive -a 'src=/root/easy-springmvc-maven.zip dest=/tmp'