48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
---
|
|
- block:
|
|
- name: Install requirements
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- "java-{{ unifi_openjdk_version }}-openjdk"
|
|
- unzip
|
|
- wget
|
|
|
|
- name: Create group '{{ unifi_group }}'
|
|
group:
|
|
name: "{{ unifi_group }}"
|
|
state: present
|
|
|
|
- name: Create user '{{ unifi_user }}'
|
|
user:
|
|
name: "{{ unifi_user }}"
|
|
group: "{{ unifi_group }}"
|
|
|
|
- name: Setup directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: "{{ unifi_user }}"
|
|
group: "{{ unifi_group }}"
|
|
recurse: True
|
|
with_items:
|
|
- "{{ unifi_base_dir }}"
|
|
- "{{ unifi_base_dir }}/{{ unifi_version }}"
|
|
become: True
|
|
|
|
- block:
|
|
- name: Setup unifi version '{{ unifi_version }}'
|
|
unarchive:
|
|
src: "https://dl.ubnt.com/unifi/{{ unifi_version }}/UniFi.unix.zip"
|
|
dest: "{{ unifi_base_dir }}/{{ unifi_version }}"
|
|
remote_src: yes
|
|
|
|
- name: Create symlink for latest version
|
|
file:
|
|
src: "{{ unifi_base_dir }}/{{ unifi_version }}"
|
|
dest: "{{ unifi_base_dir }}/latest"
|
|
state: link
|
|
become: True
|
|
become_user: "{{ unifi_user }}"
|