ansible-ffibk/roles/service-unifi/tasks/install.yml

86 lines
1.7 KiB
YAML
Raw Normal View History

Added Unfi Server to ansible. Squashed commit of the following: commit 3ba76f9e3c02e4a343c0af62ce0327dee6f2f109 Author: Julian Labus <julian@labus-online.de> Date: Thu Aug 22 13:18:05 2019 +0200 make unifi.yml executable commit 36002be43a7c1af76660682469dc7efcc06fac5f Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 13:10:32 2019 +0200 Changed magic < 255 commit c26bbac23620455653d8e21bf512c48493362d43 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 12:05:42 2019 +0200 Ergänzug um Installation von UNMS commit 220ba24e471f8139d775eec1d4b3da46e8befdf7 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 12:01:38 2019 +0200 moved service-nginx-unifi into service-unifi commit 570f5673c47b72e959e6da8940a9cbcbf1e496bf Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 11:40:27 2019 +0200 remove lean_delivery.java from unifi playbook. already in dependencies of service-unifi commit 4775cff44d53e07b720e8760f0e4ece1460e0717 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 11:38:44 2019 +0200 adjusted readme, remove galaxy info, removed unit test commit 75711495fcb40f618cd65029ceda6b3cfed7e581 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 11:32:59 2019 +0200 fix type in unifi inventory commit 513b4f6b8f3d1426e58a19ece6514e467916d680 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 11:32:44 2019 +0200 move service-unifi back to correct location commit ea32af8275fd7e6c34281e02eeb2323cbea55f64 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 11:31:42 2019 +0200 move service-unifi to temp directory commit 87698c8d84a66cbf844e923c6dd41de87cba7759 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 02:09:17 2019 +0200 Move host definition to inentory commit b469c3f6307dbed9f40310c590abc0c672487973 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Thu Aug 22 01:52:19 2019 +0200 Add unifi.yml to site.yml, remove wireguard role from unifi.yml commit 77fa3aa0eb04b01a7b10dd66cede41b09e0aa5c0 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Wed Aug 14 21:17:49 2019 +0200 Add unifi to wireguard commit c63b850ddd470aa43d8ec25663f086180157673d Author: Julian Labus <julian@labus-online.de> Date: Tue Aug 13 08:35:53 2019 +0200 Add wireguard_networks for host unifi commit 21341ad359fcfe9a9e4735ca50750f1bd5ea2ab6 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Mon Aug 12 22:49:17 2019 +0200 Add unms nginx vhost commit 0c0dff99b6ddbf8c5a354cce040b649c43948d64 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Mon Aug 12 21:44:30 2019 +0200 Add java role to gitignore commit 4fa292b5e5528b732e71dfd204ce53878cc3ee7e Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Mon Aug 12 21:43:50 2019 +0200 minor changes commit 25ab40e85e8b2fd6eb4a770e4c26a82894db3622 Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Mon Aug 12 21:17:39 2019 +0200 move java repo to requirements.yml, replace duplicated serice-nginx with service-nginx + dependency commit d9aa004149da7ac3893b698d4dcb329236a521fe Author: Sebastian Schmachtel <prisma_freifunk@oimel.net> Date: Mon Aug 12 00:52:24 2019 +0200 Added unif host: Added java role, service-unifi role, service-nginx-unifi added unifi host
2019-08-22 14:48:39 +02:00
---
- name: check for systemd
command: systemctl --version
register: unifi_controller_systemctl_version
ignore_errors: yes
- name: add apt-key unifi
apt_key:
keyserver: keyserver.ubuntu.com
id: 06E85760C0A52C50
become: yes
- name: add apt-repo unifi
apt_repository:
repo: deb [trusted=yes arch=amd64] http://apt.lecomte.at/repacks/debian/ buster ubiquiti
state: present
become: yes
- name: add apt-key mongodb
apt_key:
keyserver: keyserver.ubuntu.com
id: 58712A2291FA4AD5
become: yes
- name: add apt-repo mongodb
apt_repository:
repo: deb [arch=amd64] https://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main
state: present
become: yes
- name: install unifi-controller
apt:
name: unifi
state: present
update_cache: yes
cache_valid_time: 3600
become: yes
- name: create unifi user
user:
name: "{{ unifi_user }}"
shell: /usr/sbin/nologin
home: /var/lib/unifi
system: yes
become: yes
when: unifi_user != 'root'
- name: fix perms
file:
path: "{{ item }}"
state: directory
recurse: yes
owner: "{{ unifi_user }}"
with_items:
- /var/log/unifi
- /var/lib/unifi
- /var/run/unifi
become: yes
notify: restart_unifi
- name: perma run folder
template:
src: tmpfiles.conf
dest: /etc/tmpfiles.d/unifi.conf
mode: 0644
become: yes
when: unifi_controller_systemctl_version is success
- name: add default-conf
template:
src: default.conf
dest: /etc/default/unifi
mode: 0644
become: yes
notify: restart_unifi
- name: write unifi.conf
template:
src: unifi_vhost.conf.j2
dest: /etc/nginx/conf.d/unifi.conf
owner: root
group: root
mode: 0644
notify: reload nginx