Added semaphore docker stack
This commit is contained in:
34
ansible-playbooks/common/update-release.yml
Normal file
34
ansible-playbooks/common/update-release.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
# command: ansible-playbook -i common/config.ini common/update-release.yml
|
||||
---
|
||||
- name: Upgrade Ubuntu to next release
|
||||
hosts: workload-hosts, k3s-hosts
|
||||
become: true
|
||||
tasks:
|
||||
- name: Ensure update-manager-core is installed
|
||||
ansible.builtin.apt:
|
||||
name: update-manager-core
|
||||
state: present
|
||||
|
||||
- name: Update all current packages to latest version
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: dist
|
||||
|
||||
- name: Check if a reboot is required before upgrading
|
||||
ansible.builtin.stat:
|
||||
path: /var/run/reboot-required
|
||||
register: reboot_required_pre
|
||||
|
||||
- name: Reboot if required before major upgrade
|
||||
ansible.builtin.reboot:
|
||||
when: reboot_required_pre.stat.exists
|
||||
|
||||
- name: Run do-release-upgrade non-interactively
|
||||
ansible.builtin.shell: do-release-upgrade -f DistUpgradeViewNonInteractive
|
||||
async: 3600 # Sets timeout to 1 hour
|
||||
poll: 60 # Checks status every 60 seconds
|
||||
register: upgrade_output
|
||||
|
||||
- name: Reboot the server after successful upgrade
|
||||
ansible.builtin.reboot:
|
||||
when: upgrade_output is succeeded
|
||||
Reference in New Issue
Block a user