36 lines
1005 B
YAML
36 lines
1005 B
YAML
---
|
|
- name: Synology DSM upgrade FULL AUTO via SSH uniquement
|
|
hosts: synology
|
|
gather_facts: false
|
|
|
|
vars:
|
|
syno_port: 5001
|
|
|
|
# IMPORTANT: évite /var/services/homes/.../.ansible/tmp (droits DSM)
|
|
ansible_remote_tmp: /tmp/.ansible-${USER}/tmp
|
|
|
|
reboot_down_timeout: 300
|
|
reboot_up_timeout: 1800
|
|
|
|
tasks:
|
|
- name: Lancer upgrade DSM via SSH (synoupgrade --start-force)
|
|
ansible.builtin.shell: /usr/syno/sbin/synoupgrade --start-force
|
|
become: true
|
|
|
|
- name: Attendre que DSM tombe (reboot en cours)
|
|
ansible.builtin.wait_for:
|
|
host: "{{ inventory_hostname }}"
|
|
port: "{{ syno_port }}"
|
|
state: stopped
|
|
timeout: "{{ reboot_down_timeout }}"
|
|
delegate_to: localhost
|
|
|
|
- name: Attendre le retour de DSM (port 5001)
|
|
ansible.builtin.wait_for:
|
|
host: "{{ inventory_hostname }}"
|
|
port: "{{ syno_port }}"
|
|
state: started
|
|
delay: 10
|
|
timeout: "{{ reboot_up_timeout }}"
|
|
delegate_to: localhost
|