From c8f7d0ab5dfff315ad3f2ec03c0d27eb00eb6f29 Mon Sep 17 00:00:00 2001 From: Matthew McKinnon Date: Sat, 16 Nov 2024 16:13:44 +1000 Subject: [PATCH] feat: add omada container --- hosts | 3 ++ main.yml | 73 +++++++++++++++++++++++++++---------------------- tasks/omada.yml | 24 ++++++++++++++++ 3 files changed, 67 insertions(+), 33 deletions(-) create mode 100644 tasks/omada.yml diff --git a/hosts b/hosts index afa53bc..31231ec 100644 --- a/hosts +++ b/hosts @@ -7,3 +7,6 @@ vps02.comprofix.com [docker] docker.comprofix.xyz +[omada] +omada.comprofix.xyz ansible_user=root + diff --git a/main.yml b/main.yml index 2bd88d8..497b03c 100644 --- a/main.yml +++ b/main.yml @@ -1,11 +1,10 @@ --- - - hosts: all name: Configure all servers tasks: - - name: Gather facts if run with tags - ansible.builtin.setup: - when: ansible_run_tags | length + - name: Gather facts if run with tags + ansible.builtin.setup: + when: ansible_run_tags | length tags: always - hosts: all @@ -16,17 +15,16 @@ - hosts: cloud become: yes - roles: + roles: - role: docker tags: docker_install - + - name: traefik vars: traefik_host: traefik01.comprofix.com tags: traefik_install - tasks: - + tasks: - name: Deploy Vaultwarden import_tasks: tasks/vaultwarden.yml tags: vaultwarden_install @@ -48,16 +46,15 @@ tags: docker_install - role: nfs mounts: - - name: Data share - path: /mnt/nfs/data - src: truenas.comprofix.xyz:/mnt/datapool/data + - name: Data share + path: /mnt/nfs/data + src: truenas.comprofix.xyz:/mnt/datapool/data tags: nfs_install - role: traefik vars: traefik_host: traefik02.comprofix.xyz tags: traefik_install tasks: - - name: Deploy comprofix.com website import_tasks: tasks/comprofix.com.yml tags: comprofix_install @@ -65,19 +62,19 @@ - name: Deploy iDrac Fan Controller import_tasks: tasks/idrac.yml tags: idrac_install - + - name: Deploy MariaDB import_tasks: tasks/mariadb.yml tags: mariadb_install - + - name: Deploy InvoiceNinja import_tasks: tasks/invoiceninja.yml tags: invoiceninja_install - + - name: Deploy Homepage import_tasks: tasks/homepage.yml tags: homepage_install - + # - name: Deploy osTicket # import_tasks: tasks/osticket.yml # tags: osticket_install @@ -89,19 +86,19 @@ - name: Deploy dozzle import_tasks: tasks/dozzle.yml tags: dozzle_install - + - name: Deploy jellyseerr import_tasks: tasks/jellyseerr.yml tags: jellyseerr_install - + - name: Deploy lidarr import_tasks: tasks/lidarr.yml tags: lidarr_install - + - name: Deploy prowlarr import_tasks: tasks/prowlarr.yml tags: prowlarr_install - + - name: Deploy radarr import_tasks: tasks/radarr.yml tags: radarr_install @@ -109,7 +106,7 @@ - name: Deploy readarr import_tasks: tasks/readarr.yml tags: readarr_install - + - name: Deploy sonarr import_tasks: tasks/sonarr.yml tags: sonarr_install @@ -121,24 +118,34 @@ - name: Deploy mealie import_tasks: tasks/mealie.yml tags: mealie_install - + - name: Deploy pyKMS import_tasks: tasks/pykms.yml tags: pykms_install - + - name: Deploy gitea-runner-homelab import_tasks: tasks/gitea-runner-homelab.yml tags: gitea_runner_homelab_install tags: dockerserver_install - - - - - - - - - - +- hosts: omada + become: yes + pre_tasks: + - name: Update packages + import_tasks: tasks/base.yml + tags: base_install + roles: + - role: docker + tags: docker_install + - role: nfs + mounts: + - name: Data share + path: /data + src: truenas.comprofix.xyz:/mnt/datapool/docker + tags: nfs_install + tasks: + - name: Deploy Omada + import_tasks: tasks/omada.yml + tags: omada_container_install + tags: omada_install diff --git a/tasks/omada.yml b/tasks/omada.yml new file mode 100644 index 0000000..ae92c70 --- /dev/null +++ b/tasks/omada.yml @@ -0,0 +1,24 @@ +--- +- name: Create directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ data_folder }}/omada" + - "{{ data_folder }}/omada/data" + - "{{ data_folder }}/omada/logs" + +- name: Create the omada container + docker_container: + name: omada + image: mbentley/omada-controller:5.14 + restart_policy: unless-stopped + recreate: true + network_mode: host + volumes: + - "{{ data_folder }}/omada/data:/opt/tplink/EAPController/data" + - "{{ data_folder }}/omada/logs:/opt/tplink/EAPController/logs" + env: + PUID: "1000" + PGID: "1000" + TZ: "Australia/Brisbane"