I’m using ansible 2.9. There is no shutdown module available.
I need to automate shutdown command via Ansible playbook. The target hosts are different distributions of CentOS servers - 7 or 6. When I ran the playbook to shutdown them, the execution will hang forever for one of CentOS 7 servers. I had to hit Ctrl-C. The execution stopped when example8 is down. It is CentOS 7. The example7 is CentOS 6 and does not hang forever.
inventory file:
[shutdown_300]
example1
[shutdown_301]
example2
[shutdown_302]
example3
[shutdown_303]
example4
[shutdown_304]
example5
[shutdown_305]
example6
[shutdown_306]
example7
example8
[shutdown_30:children]
shutdown_306
shutdown_305
shutdown_304
shutdown_303
shutdown_302
shutdown_301
shutdown_300
Here is the playbook: