Add installation for UniFi Network Controller

This commit is contained in:
Kris Lamoureux 2021-04-04 02:26:54 -04:00
parent 3e943686ed
commit 4ca3e71e96
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
7 changed files with 104 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,4 +6,5 @@
!docker.yml !docker.yml
!dockerbox.yml !dockerbox.yml
!hypervisor.yml !hypervisor.yml
!unifi.yml
/environments/ /environments/

6
dev/host_vars/unifi.yml Normal file
View File

@ -0,0 +1,6 @@
# base
allow_reboot: false
manage_network: false
# UniFi version
unifi_version: 6.1.71

22
dev/unifi.yml Normal file
View File

@ -0,0 +1,22 @@
# Copyright (C) 2021 Kris Lamoureux
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
- name: Install UniFi Network Controller
hosts: all
become: true
vars_files:
- host_vars/unifi.yml
roles:
- base
- unifi

1
roles/.gitignore vendored
View File

@ -11,4 +11,5 @@
!nginx*/ !nginx*/
!prometheus*/ !prometheus*/
!traefik*/ !traefik*/
!unifi*/
!wordpress*/ !wordpress*/

View File

@ -0,0 +1,52 @@
- name: Install GnuPG
apt:
name: gnupg
state: present
- name: Add AdoptOpenJDK's signing key
apt_key:
id: 8ED17AF5D7E675EB3EE3BCE98AC3B29174885C03
url: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
- name: Add MongoDB 3.6's signing key
apt_key:
id: 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
url: https://www.mongodb.org/static/pgp/server-3.6.asc
- name: Add UniFi's signing key
apt_key:
id: 4A228B2D358A5094178285BE06E85760C0A52C50
keyserver: keyserver.ubuntu.com
- name: Install AdoptOpenJDK repository
apt_repository:
repo: deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ buster main
mode: 0644
state: present
- name: Install MongoDB 3.6 repository
apt_repository:
repo: deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main
mode: 0644
state: present
- name: Install UniFi repository
apt_repository:
repo: deb https://www.ui.com/downloads/unifi/debian stable ubiquiti
mode: 0644
state: present
- name: Install MongoDB 3.6
apt:
name: mongodb-org
state: present
- name: Install OpenJDK 8 LTS
apt:
name: adoptopenjdk-8-hotspot
state: present
- name: Install UniFi
apt:
name: unifi
state: present

21
unifi.yml Normal file
View File

@ -0,0 +1,21 @@
# Copyright (C) 2021 Kris Lamoureux
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
- name: Install UniFi Network Controller
hosts: unifi
become: true
roles:
- base
- jenkins
- unifi

View File

@ -13,6 +13,7 @@ HOST[7]="vault.${DOMAIN}"
HOST[8]="wordpress.${DOMAIN}" HOST[8]="wordpress.${DOMAIN}"
HOST[9]="site1.wordpress.${DOMAIN}" HOST[9]="site1.wordpress.${DOMAIN}"
HOST[10]="site2.wordpress.${DOMAIN}" HOST[10]="site2.wordpress.${DOMAIN}"
HOST[11]="unifi.${DOMAIN}"
# Get Vagrantbox guest IP # Get Vagrantbox guest IP
VAGRANT_OUTPUT=$(vagrant ssh -c "hostname -I | cut -d' ' -f2" 2>/dev/null) VAGRANT_OUTPUT=$(vagrant ssh -c "hostname -I | cut -d' ' -f2" 2>/dev/null)