Commit d051eee6 authored by nanahira's avatar nanahira

reboot after upgrade

parent 96f397df
...@@ -9,3 +9,5 @@ mirror_ubuntu_security: http://security.ubuntu.com ...@@ -9,3 +9,5 @@ mirror_ubuntu_security: http://security.ubuntu.com
mirror_docker: https://download.docker.com mirror_docker: https://download.docker.com
china_mirror: false china_mirror: false
install_docker: false install_docker: false
upgrade: true
reboot: false
...@@ -22,3 +22,18 @@ ...@@ -22,3 +22,18 @@
become: true become: true
apt: apt:
autoremove: true autoremove: true
- name: 系统源 重启
shell: reboot
async: 0
poll: 0
register: reboot_result
args:
removes: /var/run/reboot-required
when: reboot_allowed
- name: 系统源 重启等待
local_action: wait_for host={{ ansible_ssh_host }} state=started
when: reboot_result.changed
- name: 重新读取主机信息
setup:
when: reboot_result.changed
--- ---
# vars file for init # vars file for init
# 修改这个变量来禁止系统更新
upgrade: true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment