diff --git a/.gitignore b/.gitignore index cc3b44d..68ec596 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ !docker.yml !dockerbox.yml !hypervisor.yml +!unifi.yml /environments/ diff --git a/dev/host_vars/unifi.yml b/dev/host_vars/unifi.yml new file mode 100644 index 0000000..d54be94 --- /dev/null +++ b/dev/host_vars/unifi.yml @@ -0,0 +1,6 @@ +# base +allow_reboot: false +manage_network: false + +# UniFi version +unifi_version: 6.1.71 diff --git a/dev/unifi.yml b/dev/unifi.yml new file mode 100644 index 0000000..1da404b --- /dev/null +++ b/dev/unifi.yml @@ -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 . + +- name: Install UniFi Network Controller + hosts: all + become: true + vars_files: + - host_vars/unifi.yml + roles: + - base + - unifi diff --git a/roles/.gitignore b/roles/.gitignore index 9b23231..4357616 100644 --- a/roles/.gitignore +++ b/roles/.gitignore @@ -11,4 +11,5 @@ !nginx*/ !prometheus*/ !traefik*/ +!unifi*/ !wordpress*/ diff --git a/roles/unifi/tasks/main.yml b/roles/unifi/tasks/main.yml new file mode 100644 index 0000000..096dd40 --- /dev/null +++ b/roles/unifi/tasks/main.yml @@ -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 diff --git a/unifi.yml b/unifi.yml new file mode 100644 index 0000000..1fcda5d --- /dev/null +++ b/unifi.yml @@ -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 . + +- name: Install UniFi Network Controller + hosts: unifi + become: true + roles: + - base + - jenkins + - unifi diff --git a/update-hosts.sh b/update-hosts.sh index b2ae189..7131117 100755 --- a/update-hosts.sh +++ b/update-hosts.sh @@ -13,6 +13,7 @@ HOST[7]="vault.${DOMAIN}" HOST[8]="wordpress.${DOMAIN}" HOST[9]="site1.wordpress.${DOMAIN}" HOST[10]="site2.wordpress.${DOMAIN}" +HOST[11]="unifi.${DOMAIN}" # Get Vagrantbox guest IP VAGRANT_OUTPUT=$(vagrant ssh -c "hostname -I | cut -d' ' -f2" 2>/dev/null)