How to reboot CentOS 7 with Ansible?

前端 未结 11 1557
遥遥无期
遥遥无期 2020-12-24 07:46

I\'m trying to reboot server running CentOS 7 on VirtualBox. I use this task:

- name: Restart server
  command: /sbin/reboot
  async: 0
  poll:          


        
11条回答
  •  旧时难觅i
    2020-12-24 08:00

    - name: restart server
      shell: sleep 2 && shutdown -r now "Ansible updates triggered"
      async: 1
      poll: 0
      become: true
      ignore_errors: true
    
    
    - name: waiting for the server to come back
      local_action: wait_for host=testcentos state=started delay=30 timeout=300
      sudo: false
    

提交回复
热议问题