mirror of
https://github.com/roles-ansible/ansible_role_base.git
synced 2024-08-16 14:29:50 +02:00
Merge pull request #9 from roles-ansible/x
improve apt/sources.list.d template
This commit is contained in:
commit
0efb03d641
9 changed files with 64 additions and 33 deletions
2
.github/workflows/ansible-debian-stable.yml
vendored
2
.github/workflows/ansible-debian-stable.yml
vendored
|
@ -7,8 +7,6 @@ on:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
schedule:
|
|
||||||
- cron: '23 6 * */1 *'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
2
.github/workflows/ansible-linting-check.yml
vendored
2
.github/workflows/ansible-linting-check.yml
vendored
|
@ -7,8 +7,6 @@ on:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
schedule:
|
|
||||||
- cron: '42 6 * */1 *'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
2
.github/workflows/yamllint.yaml
vendored
2
.github/workflows/yamllint.yaml
vendored
|
@ -7,8 +7,6 @@ on:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: '*'
|
branches: '*'
|
||||||
schedule:
|
|
||||||
- cron: '23 6 * */1 *'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yamllint:
|
yamllint:
|
||||||
|
|
|
@ -27,6 +27,7 @@ base__add_ethz: true
|
||||||
# add nonfree/firmware packages?
|
# add nonfree/firmware packages?
|
||||||
base__pkg_non_free_firmware: false
|
base__pkg_non_free_firmware: false
|
||||||
base__pkg_contrib: false
|
base__pkg_contrib: false
|
||||||
|
base__pkg_security: true
|
||||||
|
|
||||||
# optionaly print some OS vars
|
# optionaly print some OS vars
|
||||||
base__print_os_vars: false
|
base__print_os_vars: false
|
||||||
|
|
|
@ -9,6 +9,7 @@ base__add_ethz: "{{ add_ethz }}"
|
||||||
# add nonfree/firmware packages?
|
# add nonfree/firmware packages?
|
||||||
base__pkg_non_free_firmware: "{{ base_pkg_non_free_firmware }}"
|
base__pkg_non_free_firmware: "{{ base_pkg_non_free_firmware }}"
|
||||||
base__pkg_contrib: "{{ base_pkg_contrib }}"
|
base__pkg_contrib: "{{ base_pkg_contrib }}"
|
||||||
|
base__pkg_security: true
|
||||||
|
|
||||||
# optionaly print some OS vars
|
# optionaly print some OS vars
|
||||||
base__print_os_vars: "{{ print_os_vars }}"
|
base__print_os_vars: "{{ print_os_vars }}"
|
||||||
|
|
8
handlers/main.yml
Normal file
8
handlers/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
- name: apt update
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: true
|
||||||
|
cache_valid_time: 3600
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == "apt"
|
|
@ -7,7 +7,7 @@
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == "apt"
|
- ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: Install requirements to add packages
|
- name: Install requirements to add packages via https
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
package:
|
package:
|
||||||
|
@ -18,30 +18,13 @@
|
||||||
|
|
||||||
- name: add eth zurich apt (main)
|
- name: add eth zurich apt (main)
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.template:
|
||||||
repo: "deb https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main"
|
src: "templates/apt.sources.list.j2"
|
||||||
state: present
|
dest: '/etc/apt/sources.list.d/debian_ethz_ch_debian.list'
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when:
|
group: root
|
||||||
- not base__pkg_non_free_firmware | bool
|
owner: root
|
||||||
- not base__pkg_contrib | bool
|
notify: apt update
|
||||||
|
|
||||||
- name: add eth zurich apt (main non-free)
|
- name: force all notified handlers to run at this point, not waiting for normal sync points
|
||||||
become: true
|
ansible.builtin.meta: flush_handlers
|
||||||
ansible.builtin.apt_repository:
|
|
||||||
repo: "deb-src https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main non-free"
|
|
||||||
state: present
|
|
||||||
mode: 0644
|
|
||||||
when:
|
|
||||||
- base__pkg_non_free_firmware | bool
|
|
||||||
- not base__pkg_contrib | bool
|
|
||||||
|
|
||||||
- name: add eth zurich apt (main contrib non-free)
|
|
||||||
become: true
|
|
||||||
ansible.builtin.apt_repository:
|
|
||||||
repo: "deb-src https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main contrib non-free"
|
|
||||||
state: present
|
|
||||||
mode: 0644
|
|
||||||
when:
|
|
||||||
- base__pkg_non_free_firmware | bool
|
|
||||||
- base__pkg_contrib | bool
|
|
||||||
|
|
44
templates/apt.sources.list.j2
Normal file
44
templates/apt.sources.list.j2
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# Debian mirror der ETH Zürich
|
||||||
|
# https://debian.ethz.ch/
|
||||||
|
|
||||||
|
# HTTPS mirror:
|
||||||
|
deb https://debian.ethz.ch/debian {{ ansible_distribution_release }} main
|
||||||
|
{%- if base__pkg_contrib | bool -%}
|
||||||
|
{{- ' contrib' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if base__pkg_non_free_firmware | bool -%}
|
||||||
|
{{- ' non-free' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- '\n' -}}
|
||||||
|
deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }} main
|
||||||
|
{%- if base__pkg_contrib | bool -%}
|
||||||
|
{{- ' contrib' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if base__pkg_non_free_firmware | bool -%}
|
||||||
|
{{- ' non-free' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- '\n\n' -}}
|
||||||
|
|
||||||
|
{%- if base__pkg_security | bool -%}
|
||||||
|
# Inofficial Security Mirror
|
||||||
|
deb https://security.debian.ethz.ch/ {{ ansible_distribution_release }}/updates main
|
||||||
|
{%- if base__pkg_contrib | bool -%}
|
||||||
|
{{- ' contrib' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if base__pkg_non_free_firmware | bool -%}
|
||||||
|
{{- ' non-free' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- '\n' -}}
|
||||||
|
deb http://security.debian.org/ {{ ansible_distribution_release }}/updates main
|
||||||
|
{%- if base__pkg_contrib | bool -%}
|
||||||
|
{{- ' contrib' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if base__pkg_non_free_firmware | bool -%}
|
||||||
|
{{- ' non-free' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- '\n\n' -}}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
# Contact for proplems with the mirror:
|
||||||
|
# https://readme.phys.ethz.ch/services/contact/
|
||||||
|
# Or #isgphys on irc.phys.ethz.ch
|
|
@ -61,5 +61,5 @@ base__linux_packages:
|
||||||
- bzip2
|
- bzip2
|
||||||
- jq
|
- jq
|
||||||
|
|
||||||
playbook_version_number: 9012
|
playbook_version_number: 9014
|
||||||
playbook_version_path: 'base-packages_roles-ansible_github.version'
|
playbook_version_path: 'base-packages_roles-ansible_github.version'
|
||||||
|
|
Loading…
Reference in a new issue