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