Skip to content

Instantly share code, notes, and snippets.

@khiemdoan
Created April 9, 2020 06:54
Show Gist options
  • Select an option

  • Save khiemdoan/483d5d1966e962e6d0689ed5b5d7f7d0 to your computer and use it in GitHub Desktop.

Select an option

Save khiemdoan/483d5d1966e962e6d0689ed5b5d7f7d0 to your computer and use it in GitHub Desktop.
# ansible-playbook shutdown.yml -K
---
- name: shutdown
hosts: all
become: 'yes'
become_method: sudo
tasks:
- name: shutdown hosts
command: /sbin/shutdown -h now
when: ansible_facts['os_family'] == "Debian"
ignore_errors: 'yes'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment