diff --git a/ansible/roles/yum/defaults/main.yml b/ansible/roles/yum/defaults/main.yml index 6594cab68..e9e4c8611 100644 --- a/ansible/roles/yum/defaults/main.yml +++ b/ansible/roles/yum/defaults/main.yml @@ -1,6 +1,12 @@ --- -use_local_mirror: false -centos_mirror_host: 'mirror.centos.org' -epel_mirror_host: 'download.fedoraproject.org' -epel_mirror_directory: 'pub/epel' +# Whether or not to use a local Yum mirror. +yum_use_local_mirror: false +# Mirror FQDN for Yum repos. +yum_centos_mirror_host: 'mirror.centos.org' +# Mirror directory for Yum CentOS repos. +yum_centos_mirror_directory: 'centos' +# Mirror FQDN for Yum EPEL repos. +yum_epel_mirror_host: 'download.fedoraproject.org' +# Mirror directory for Yum EPEL repos. +yum_epel_mirror_directory: 'pub/epel' diff --git a/ansible/roles/yum/templates/CentOS-Base.repo.j2 b/ansible/roles/yum/templates/CentOS-Base.repo.j2 index 2c00ceada..361e19ff0 100644 --- a/ansible/roles/yum/templates/CentOS-Base.repo.j2 +++ b/ansible/roles/yum/templates/CentOS-Base.repo.j2 @@ -13,7 +13,7 @@ [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra -baseurl=http://{{ centos_mirror_host }}/centos/$releasever/os/$basearch/ +baseurl=http://{{ yum_centos_mirror_host }}/{{ yum_centos_mirror_directory }}/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 @@ -21,7 +21,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra -baseurl=http://{{ centos_mirror_host }}/centos/$releasever/updates/$basearch/ +baseurl=http://{{ yum_centos_mirror_host }}/{{ yum_centos_mirror_directory }}/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 @@ -29,7 +29,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -baseurl=http://{{ centos_mirror_host }}/centos/$releasever/extras/$basearch/ +baseurl=http://{{ yum_centos_mirror_host }}/{{ yum_centos_mirror_directory }}/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 @@ -37,7 +37,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [centosplus] name=CentOS-$releasever - Plus #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -baseurl=http://{{ centos_mirror_host }}/centos/$releasever/centosplus/$basearch/ +baseurl=http://{{ yum_centos_mirror_host }}/{{ yum_centos_mirror_directory }}/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/ansible/roles/yum/templates/epel.repo.j2 b/ansible/roles/yum/templates/epel.repo.j2 index 7cbe42f2c..0dbf48aaf 100644 --- a/ansible/roles/yum/templates/epel.repo.j2 +++ b/ansible/roles/yum/templates/epel.repo.j2 @@ -1,6 +1,6 @@ [epel] name=Extra Packages for Enterprise Linux 7 - $basearch -baseurl=http://{{ epel_mirror_host }}/{{ epel_mirror_directory }}/7/$basearch +baseurl=http://{{ yum_epel_mirror_host }}/{{ yum_epel_mirror_directory }}/7/$basearch #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch failovermethod=priority enabled=1 @@ -9,7 +9,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug -baseurl=http://{{ epel_mirror_host }}/{{ epel_mirror_directory }}/7/$basearch/debug +baseurl=http://{{ yum_epel_mirror_host }}/{{ yum_epel_mirror_directory }}/7/$basearch/debug #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch failovermethod=priority enabled=0 @@ -18,7 +18,7 @@ gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source -baseurl=http://{{ epel_mirror_host }}/{{ epel_mirror_directory }}/7/SRPMS +baseurl=http://{{ yum_epel_mirror_host }}/{{ yum_epel_mirror_directory }}/7/SRPMS #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch failovermethod=priority enabled=0