@ wrote... (3 years, 10 months ago)

Before upgrading to Proxmox 6 you need to upgrade to Corosync 3. Here's an ansible playbook that will automate that…

---

# https://pve.proxmox.com/wiki/Upgrade_from_5.x_to_6.0

# max_fail_percentage will stop _all_ hosts from proceding if any host
# has an issue

- hosts: proxmox
  become: true
  max_fail_percentage: 0
  serial: 100 # more than my number of nodes

  tasks:

    - name: check for quorate
      shell: pvecm status | grep -q '^Quorate:\s*Yes'

    - name: update all packages
      apt: upgrade=dist update_cache=yes

    - name: add corosync3 repo
      apt_repository:
        repo: "deb http://download.proxmox.com/debian/corosync-3/ stretch main"
        update_cache: yes
        filename: corosync3.list

    - name: stop pve-ha-lrm
      systemd:
        name: pve-ha-lrm
        state: stopped

    - name: stop pve-ha-crm
      systemd:
        name: pve-ha-crm
        state: stopped

    - name: update corosync
      apt: upgrade=dist

    - name: start pve-ha-lrm
      systemd:
        name: pve-ha-lrm
        state: started

    - name: start pve-ha-crm
      systemd:
        name: pve-ha-crm
        state: started

    - name: check for quorate
      shell: pvecm status | grep -q '^Quorate:\s*Yes'
Category: tech, Tags: ansible, proxmox
Comments: 0
Click here to add a comment