From 15433d1e388b1bbc69e3debf51f4e5c9f343dc97 Mon Sep 17 00:00:00 2001 From: tolerryan <105945216+tolerryan@users.noreply.github.com> Date: Sun, 1 Jun 2025 16:27:18 -0500 Subject: [PATCH] breakout debcache to seprate role as vpses will not use it --- roles/ind/archivewarrior/archivewarrior.yml | 9 +++---- roles/ind/authelia/authelia-install.yml | 5 +++- roles/ind/downloader/downloader-install.yml | 2 ++ roles/ind/grail/grail-install.yml | 2 ++ roles/ind/healthcheck/healthcheck-install.yml | 3 +++ roles/ind/mello/mello-install.yml | 5 ---- roles/ind/nas/nas-install.yml | 6 ++--- roles/ind/navidrome/navidrome-install.yml | 2 ++ roles/ind/pihole/pihole-install.yml | 8 +++---- roles/ind/promgraf/promgraf-install.yml | 24 ++++--------------- roles/ind/semaphore/semaphore-install.yml | 18 +++----------- roles/ind/wikmd/wikmd-install.yml | 3 +++ roles/lib/set-debcache.yml | 21 ++++++++++++++++ roles/lib/upgrade-packages.yml | 15 ------------ 14 files changed, 53 insertions(+), 70 deletions(-) create mode 100644 roles/lib/set-debcache.yml diff --git a/roles/ind/archivewarrior/archivewarrior.yml b/roles/ind/archivewarrior/archivewarrior.yml index 1817afd..e9270db 100644 --- a/roles/ind/archivewarrior/archivewarrior.yml +++ b/roles/ind/archivewarrior/archivewarrior.yml @@ -72,18 +72,15 @@ restart: always tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml - name: Install-docker.yml - setting up docker include: ../../lib/install-docker.yml - #- name: Install Restic and setup - # include: ../../lib/setup-restic.yml - - #- name: Setup Restic Cron jobs - # include: ../../lib/setup-restic-cron.yml - - name: Install Python Packages apt: name: diff --git a/roles/ind/authelia/authelia-install.yml b/roles/ind/authelia/authelia-install.yml index 0b5b112..17b863b 100644 --- a/roles/ind/authelia/authelia-install.yml +++ b/roles/ind/authelia/authelia-install.yml @@ -7,6 +7,8 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml @@ -79,7 +81,8 @@ - name: Write docker-compose.env ansible.builtin.copy: src: docker-compose.env - dest: /home/docker/docker-compose.env + dest: /home/docker/ + owner: docker group: docker mode: u=rw,g=r,o=r diff --git a/roles/ind/downloader/downloader-install.yml b/roles/ind/downloader/downloader-install.yml index c5a9845..3fdd6c9 100644 --- a/roles/ind/downloader/downloader-install.yml +++ b/roles/ind/downloader/downloader-install.yml @@ -7,6 +7,8 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml diff --git a/roles/ind/grail/grail-install.yml b/roles/ind/grail/grail-install.yml index c0e7f6c..1c10a70 100644 --- a/roles/ind/grail/grail-install.yml +++ b/roles/ind/grail/grail-install.yml @@ -10,6 +10,8 @@ #- name: Setup PVE node for transcoding and vpn # ansible.builtin.command: /usr/bin/ansible-playbook ./roles/ind/grail/set-pvenode.yml -k # delegate_to: 127.0.0.1 + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml diff --git a/roles/ind/healthcheck/healthcheck-install.yml b/roles/ind/healthcheck/healthcheck-install.yml index 51f5747..29510f4 100644 --- a/roles/ind/healthcheck/healthcheck-install.yml +++ b/roles/ind/healthcheck/healthcheck-install.yml @@ -32,6 +32,9 @@ tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml diff --git a/roles/ind/mello/mello-install.yml b/roles/ind/mello/mello-install.yml index 80e4c64..9ecebc8 100644 --- a/roles/ind/mello/mello-install.yml +++ b/roles/ind/mello/mello-install.yml @@ -78,11 +78,6 @@ - name: Install-docker.yml - setting up docker include: ../../lib/install-docker.yml - #- name: Install Restic and setup - # include: ../../lib/setup-restic.yml - - #- name: Setup Restic Cron jobs - # include: ../../lib/setup-restic-cron.yml - name: Install Python Packages apt: diff --git a/roles/ind/nas/nas-install.yml b/roles/ind/nas/nas-install.yml index a9cdbd3..2b34e9d 100644 --- a/roles/ind/nas/nas-install.yml +++ b/roles/ind/nas/nas-install.yml @@ -7,11 +7,11 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml - - #- name: Install-docker.yml - setting up docker - # include: ../../lib/install-docker.yml - name: Install Restic and setup include: ../../lib/setup-restic.yml diff --git a/roles/ind/navidrome/navidrome-install.yml b/roles/ind/navidrome/navidrome-install.yml index 5cd5db4..8814e8d 100644 --- a/roles/ind/navidrome/navidrome-install.yml +++ b/roles/ind/navidrome/navidrome-install.yml @@ -7,6 +7,8 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml diff --git a/roles/ind/pihole/pihole-install.yml b/roles/ind/pihole/pihole-install.yml index ffc4c2f..5cc25db 100644 --- a/roles/ind/pihole/pihole-install.yml +++ b/roles/ind/pihole/pihole-install.yml @@ -7,6 +7,9 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml @@ -78,11 +81,6 @@ owner: docker group: docker mode: u=rw,g=r,o=r - - #- name: Start services - # community.docker.docker_compose_v2: - # project_src: /home/docker/ - # register: output - name: Check if docker config directory exists stat: diff --git a/roles/ind/promgraf/promgraf-install.yml b/roles/ind/promgraf/promgraf-install.yml index d983dd1..8c46fa8 100644 --- a/roles/ind/promgraf/promgraf-install.yml +++ b/roles/ind/promgraf/promgraf-install.yml @@ -7,6 +7,9 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml @@ -91,26 +94,7 @@ owner: promgraf group: docker mode: u=rw,g=r,o=r - - #- name: Start services - # community.docker.docker_compose_v2: - # project_src: /home/docker/ - # register: output - - # - name: Check if docker config directory exists - # stat: - # path: /home/promgraf/docker/qbittorrent - # register: promgraf_stat - - # - name: Restore docker config Dir - # shell: | - # restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / restore latest - # args: - # chdir: /home/promgraf/ - # creates: /home/promgraf/qbitorrent - # when: not promgraf_stat.stat.exists or not promgraf_stat.stat.isdir - - + - name: Reload systemd daemon systemd: daemon_reload: yes diff --git a/roles/ind/semaphore/semaphore-install.yml b/roles/ind/semaphore/semaphore-install.yml index 79ece03..27b3b96 100644 --- a/roles/ind/semaphore/semaphore-install.yml +++ b/roles/ind/semaphore/semaphore-install.yml @@ -7,6 +7,9 @@ vars: tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml @@ -64,21 +67,6 @@ group: docker mode: u=rw,g=r,o=r - #- name: Check if semaphone directory exists - # stat: - # path: /semaphone - # register: semaphone_stat - - #- name: Restore semaphone Dir - # shell: | - # restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / --path /semaphone/semaphone-server restore latest - # restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / --path /semaphone/semaphone-web restore latest - # restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / --path /semaphone/semaphone-db/backups restore latest - # args: - # chdir: /home/docker/semaphone/etc/ - # creates: /semaphone - # when: not semaphone_stat.stat.exists or not semaphone_stat.stat.isdir - - name: Reload systemd daemon systemd: daemon_reload: yes diff --git a/roles/ind/wikmd/wikmd-install.yml b/roles/ind/wikmd/wikmd-install.yml index de064fe..4dd2432 100644 --- a/roles/ind/wikmd/wikmd-install.yml +++ b/roles/ind/wikmd/wikmd-install.yml @@ -44,6 +44,9 @@ restart: unless-stopped tasks: + - name: set-debcache.yml - Setup apt proxy debcache + include: ../../lib/set-debcache.yml + - name: Upgrade-packages.yml - update packages include: ../../lib/upgrade-packages.yml diff --git a/roles/lib/set-debcache.yml b/roles/lib/set-debcache.yml new file mode 100644 index 0000000..d07f727 --- /dev/null +++ b/roles/lib/set-debcache.yml @@ -0,0 +1,21 @@ + - name: Configure apt proxy + ansible.builtin.lineinfile: + path: /etc/apt/apt.conf.d/proxy + line: 'Acquire::http { Proxy "http://192.168.0.60:3142"; }' + state: present + create: yes + mode: '0644' + + - name: Set up apt proxy configuration + copy: + content: | + Acquire::http::Proxy "http://debcache:3142"; + dest: /etc/apt/apt.conf.d/00cacher + mode: '0644' + + - name: Update apt cache + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 3600 + + diff --git a/roles/lib/upgrade-packages.yml b/roles/lib/upgrade-packages.yml index 88261e0..6956c4d 100644 --- a/roles/lib/upgrade-packages.yml +++ b/roles/lib/upgrade-packages.yml @@ -1,18 +1,3 @@ - - name: Configure apt proxy - ansible.builtin.lineinfile: - path: /etc/apt/apt.conf.d/proxy - line: 'Acquire::http { Proxy "http://192.168.0.60:3142"; }' - state: present - create: yes - mode: '0644' - - - name: Set up apt proxy configuration - copy: - content: | - Acquire::http::Proxy "http://debcache:3142"; - dest: /etc/apt/apt.conf.d/00cacher - mode: '0644' - - name: Update apt cache ansible.builtin.apt: update_cache: yes