apt-cacher/server/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 07 Oct 2024 23:31:51 -0500
changeset 239 c3e3169399a8
parent 238 bdbc88cb5078
permissions -rw-r--r--
Updated java version and disabled geyser due to too old jde.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: install apt packages
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  apt: name="apt-cacher-ng"
187
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
     6
  notify: restart apt-cacher-ng
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
- name: configure apt-cacher dirs
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  become: yes
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
  lineinfile:
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    path: "/etc/apt-cacher-ng/acng.conf"
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    regexp: "^{{item.key}}:"
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    insertafter: "^# {{item.key}}:"
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
    line: "{{item.key}}: {{item.val}}"
144
267d58c0e186 Replaced with_items with loop.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    15
  loop:
0
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
    - { key: "CacheDir", val: "{{apt_cacher_cache_dir}}" }
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
    - { key: "LogDir", val: "{{apt_cacher_log_dir}}" }
df042396074e Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
    - { key: "Port", val: "{{apt_cacher_port}}" }
238
bdbc88cb5078 Lots of updates and fixes for Ubuntu 24.04 Noble.
Luke Hoersten <luke@hoersten.org>
parents: 187
diff changeset
    19
    - { key: "DlMaxRetries", val: "{{apt_cacher_max_dl_retries}}" }
bdbc88cb5078 Lots of updates and fixes for Ubuntu 24.04 Noble.
Luke Hoersten <luke@hoersten.org>
parents: 187
diff changeset
    20
    - { key: "DontCacheResolved", val: ".*InRelease" }
bdbc88cb5078 Lots of updates and fixes for Ubuntu 24.04 Noble.
Luke Hoersten <luke@hoersten.org>
parents: 187
diff changeset
    21
187
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    22
  notify: restart apt-cacher-ng
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    23
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    24
- name: make cache and log dirs
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    25
  become: yes
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    26
  file:
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    27
    path: "{{item}}"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    28
    state: "directory"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    29
    owner: "apt-cacher-ng"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    30
    group: "apt-cacher-ng"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    31
  loop:
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    32
    - "{{apt_cacher_cache_dir}}"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    33
    - "{{apt_cacher_log_dir}}"
0f3a64c60ec5 Added lnd REST api to nginx. Moved prometheus and apt-cacher data to external hdd.
Luke Hoersten <luke@hoersten.org>
parents: 144
diff changeset
    34
  notify: restart apt-cacher-ng