fix user permission while upgrade

This commit is contained in:
Robert Kaussow 2018-10-31 22:26:36 +01:00
parent aaa42cc7c8
commit f4851a416b

View File

@ -39,17 +39,23 @@
file:
path: "{{ unifi_base_dir }}/{{ unifi_version }}//UniFi/data"
state: absent
become: True
become_user: "{{ unifi_user }}"
- name: Stop service while restore process
systemd:
state: stopped
enabled: yes
name: unifi
become: True
become_user: root
- name: Copy data folder from previews version
synchronize:
src: "{{ unifi_base_dir }}/{{ unifi_current_version }}/UniFi/data"
dest: "{{ unifi_base_dir }}/{{ unifi_version }}/UniFi"
become: True
become_user: "{{ unifi_user }}"
delegate_to: "{{ inventory_hostname }}"
- name: Start service after restore process
@ -57,8 +63,8 @@
state: started
enabled: yes
name: unifi
become: True
become_user: "{{ unifi_user }}"
become: True
become_user: root
when:
- unifi_version is version(unifi_current_version, ">")
- unifi_restore_after_upgrade