There are a lot of ways on doing it. One of it is as follows: 1tasks: 2- name: "shut down CentOS 6 and Debian 7 systems" 3command: /sbin/shutdown -t now 4when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "6") or …
Read More