| --- |
| # tasks file for /usr/local/google/home/friasc/apigee-workspace/apigee-opdk-role-workspace/apigee-server-restart |
| - block: |
| - name: Restarting node now |
| become: yes |
| shell: '/usr/sbin/reboot now' |
| async: 0 |
| poll: 0 |
| when: ansible_os_family == "RedHat" and ansible_distribution_major_version | version_compare("6", ">") |
| |
| - name: Restarting node now |
| become: yes |
| shell: '/usr/bin/reboot now' |
| async: 0 |
| poll: 0 |
| when: ansible_os_family == "RedHat" and ansible_distribution_major_version | version_compare("6", ">=" )and ansible_distribution_major_version | version_compare("7", "<" ) |
| |
| - name: Pausing playbook for server restart |
| local_action: |
| pause seconds=15 |
| |
| - name: Waiting for server to complete restarting |
| become: no |
| local_action: |
| wait_for host='{{ inventory_hostname }}' state=started delay="{{ start_check_delay | d(30) }}" timeout='{{ server_restart_timeout | d(45) }}' |
| |
| - name: Report server started |
| debug: |
| msg: "Server is now running." |
| |
| when: not ignore_restart |