{{ cat }}'s docs

1.4.2: options -C


1. 参数-C来模拟task的执行,并不去实际执行tasks

ansible -i hosts localhost -m service -a "name=iptables state=started" -C
localhost | SUCCESS => {
    "changed": true,
    "msg": "service state changed"
}

 ansible -i hosts localhost -m service -a "name=iptables state=stopped" -C
localhost | SUCCESS => {
    "changed": false,
    "name": "iptables",
    "state": "stopped"