apt-cacher/server/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 06 Nov 2022 23:10:04 -0600
changeset 203 4be395f0d127
parent 187 0f3a64c60ec5
child 238 bdbc88cb5078
permissions -rw-r--r--
Reduced number of open connections for dendrite due to startup error.

---

- name: install apt packages
  become: yes
  apt: name="apt-cacher-ng"
  notify: restart apt-cacher-ng

- name: configure apt-cacher dirs
  become: yes
  lineinfile:
    path: "/etc/apt-cacher-ng/acng.conf"
    regexp: "^{{item.key}}:"
    insertafter: "^# {{item.key}}:"
    line: "{{item.key}}: {{item.val}}"
  loop:
    - { key: "CacheDir", val: "{{apt_cacher_cache_dir}}" }
    - { key: "LogDir", val: "{{apt_cacher_log_dir}}" }
    - { key: "Port", val: "{{apt_cacher_port}}" }
  notify: restart apt-cacher-ng

- name: make cache and log dirs
  become: yes
  file:
    path: "{{item}}"
    state: "directory"
    owner: "apt-cacher-ng"
    group: "apt-cacher-ng"
  loop:
    - "{{apt_cacher_cache_dir}}"
    - "{{apt_cacher_log_dir}}"
  notify: restart apt-cacher-ng