Rolle apt_sources aktualisiert (#15)
Rolle prÜft ZielOS, when in Playbook entfernt Rolle umbenannt: set_apt_sources --> set_apt_proxy Doku aktaulisiert acng_server --> apt_proxy_server_hostname acng_server_port --> apt_proxy_server_port Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com> Reviewed-on: mg/ansible#15 Co-Authored-By: mg <michael.grote@posteo.de> Co-Committed-By: mg <michael.grote@posteo.de>
This commit is contained in:
parent
e6af1a784a
commit
bd247d0b94
9 changed files with 30 additions and 34 deletions
|
@ -8,9 +8,9 @@
|
|||
postfix_smtp_server: smtp.strato.de
|
||||
postfix_smtp_server_port: 587
|
||||
postfix_smtp_use_tls: "yes"
|
||||
### mgrote.set_apt_sources
|
||||
acng_server: acng.grote.lan
|
||||
acng_server_port: 9999
|
||||
### mgrote.set_apt_proxy
|
||||
apt_proxy_server_hostname: acng.grote.lan
|
||||
apt_proxy_server_port: 9999
|
||||
### mgrote.restic
|
||||
restic_folders_to_backup: "/usr/local /etc /root /var/www /home"
|
||||
restic_cron_hours: "19"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
serial: 3
|
||||
max_fail_percentage: 20%
|
||||
roles:
|
||||
- { role: mgrote.set_apt_sources, tags: "apt_sources",
|
||||
when: "not 'virt' in group_names" }
|
||||
- { role: mgrote.set_apt_proxy, tags: "apt_sources" }
|
||||
- { role: mgrote.update_packages, tags: "updates" }
|
||||
- { role: mgrote.install_packages,
|
||||
tags: "install" }
|
||||
- { role: mgrote.install_packages, tags: "install" }
|
||||
|
|
14
roles/mgrote.set_apt_proxy/README.md
Normal file
14
roles/mgrote.set_apt_proxy/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
## mgrote.set_apt_proxy
|
||||
|
||||
### Beschreibung
|
||||
- Diese Rolle ersetzt die `/etc/apt/sources.list` mit einer Datei in der ein Apt-Cacher-NG gesetzt ist.
|
||||
|
||||
Rolle prüft mit `when: ansible_os_family == 'Ubuntu'` ob das Ziel auch Ubuntu ist.
|
||||
|
||||
- [x] Ubuntu (>=18.04)
|
||||
|
||||
### Variablen + Defaults
|
||||
##### Apt-Cacher-NG Adresse
|
||||
apt_proxy_server_hostname: acng.grote.lan
|
||||
##### Apt-Cacher-NG Port
|
||||
apt_proxy_server_port: 9999
|
|
@ -1,5 +1,3 @@
|
|||
# Distribution_Release wird mit {{ansible_distribution_release}} gesetzt
|
||||
# deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
|
||||
- name: sources.list kopieren
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
|
@ -7,7 +5,7 @@
|
|||
dest: "/etc/apt/sources.list"
|
||||
backup: yes
|
||||
register: copy_src
|
||||
|
||||
when: ansible_os_family == 'Ubuntu'
|
||||
|
||||
- name: apt_update # noqa 503 503
|
||||
become: yes
|
10
roles/mgrote.set_apt_proxy/templates/sources.list
Normal file
10
roles/mgrote.set_apt_proxy/templates/sources.list
Normal file
|
@ -0,0 +1,10 @@
|
|||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} main restricted
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates main restricted
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} universe
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates universe
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} multiverse
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates multiverse
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-backports main restricted universe multiverse
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security main restricted
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security universe
|
||||
deb http://{{ apt_proxy_server_hostname }}:{{ apt_proxy_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
|
|
@ -1,14 +0,0 @@
|
|||
## mgrote.set_apt_sources
|
||||
|
||||
### Beschreibung
|
||||
- setzt die sources.list fuer apt mit apt-cacher-ng ein
|
||||
|
||||
- [x] Ubuntu (>=18.04)
|
||||
- [x] Debian
|
||||
|
||||
|
||||
### Variablen + Defaults
|
||||
##### Apt-Cacher-NG Adresse
|
||||
acng_server: acng.grote.lan
|
||||
##### Apt-Cacher-NG Port
|
||||
acng_server_port: 9999
|
|
@ -1,10 +0,0 @@
|
|||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} main restricted
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates main restricted
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} universe
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates universe
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}} multiverse
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-updates multiverse
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/de.archive.ubuntu.com/ubuntu/ {{ansible_distribution_release}}-backports main restricted universe multiverse
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security main restricted
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security universe
|
||||
deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
|
Loading…
Reference in a new issue