configure-mirrors: make separate template directories for each platform

This keeps each platform's "/etc" template files in a separate
top-level directory.

Additionally, we add a distro major version match to the task import
and rename centos7 (in preparation for centos8).

Change-Id: If65d51a27e30311b1da20522afb6dbce7ee6cf35
This commit is contained in:
Ian Wienand 2019-10-15 15:52:53 +11:00
parent 7755ef1b8d
commit 2462d16322
18 changed files with 8 additions and 6 deletions

View File

@ -7,6 +7,7 @@
- name: Include OS-specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.{{ ansible_architecture }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
@ -25,6 +26,7 @@
include: "{{ item }}"
static: no
with_first_found:
- "mirror/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
- "mirror/{{ ansible_distribution }}.yaml"
- "mirror/{{ ansible_os_family }}.yaml"
- "mirror/default.yaml"

View File

@ -5,7 +5,7 @@
group: root
mode: 0644
owner: root
src: "{{ item }}.j2"
src: "centos7/{{ item }}.j2"
with_items:
- etc/yum.repos.d/CentOS-Base.repo
- etc/yum.repos.d/epel.repo

View File

@ -5,7 +5,7 @@
group: root
mode: 0644
owner: root
src: "{{ item }}.j2"
src: "apt/{{ item }}.j2"
with_items:
- etc/apt/sources.list.d/default.list
- etc/apt/sources.list.d/updates.list

View File

@ -5,7 +5,7 @@
group: root
mode: 0644
owner: root
src: "{{ item }}.j2"
src: "fedora/{{ item }}.j2"
with_items:
- etc/yum.repos.d/fedora.repo
- etc/yum.repos.d/fedora-updates.repo

View File

@ -15,7 +15,7 @@
group: root
mode: 0644
owner: root
src: "{{ item }}.j2"
src: "suse/{{ item }}.j2"
with_items:
- etc/zypp/repos.d/repo-oss.repo
notify:
@ -28,7 +28,7 @@
group: root
mode: 0644
owner: root
src: etc/zypp/repos.d/repo-update.repo.j2
src: suse/etc/zypp/repos.d/repo-update.repo.j2
notify:
- Update zypper cache
when: not ansible_distribution | search("Tumbleweed")

View File

@ -5,7 +5,7 @@
group: root
mode: 0644
owner: root
src: "{{ item }}.j2"
src: "apt/{{ item }}.j2"
with_items:
- etc/apt/sources.list
- etc/apt/apt.conf.d/99unauthenticated