diff --git a/roles/configure-mirrors/handlers/main.yaml b/roles/configure-mirrors/handlers/main.yaml index 8454af53e..ca6599efa 100644 --- a/roles/configure-mirrors/handlers/main.yaml +++ b/roles/configure-mirrors/handlers/main.yaml @@ -4,6 +4,13 @@ become: yes command: apt-get update +- name: Update dnf cache + become: yes + command: "{{ item }}" + with_items: + - dnf clean all + - dnf makecache + - name: Update yum cache become: yes command: "{{ item }}" diff --git a/roles/configure-mirrors/tasks/mirror/Fedora.yaml b/roles/configure-mirrors/tasks/mirror/Fedora.yaml new file mode 100644 index 000000000..e5e04f433 --- /dev/null +++ b/roles/configure-mirrors/tasks/mirror/Fedora.yaml @@ -0,0 +1,13 @@ +- name: Install Fedora repository files + become: yes + template: + dest: "/{{ item }}" + group: root + mode: 0644 + owner: root + src: "{{ item }}.j2" + with_items: + - etc/yum.repos.d/fedora.repo + - etc/yum.repos.d/fedora-updates.repo + notify: + - Update dnf cache diff --git a/roles/configure-mirrors/templates/etc/yum.repos.d/fedora-updates.repo.j2 b/roles/configure-mirrors/templates/etc/yum.repos.d/fedora-updates.repo.j2 new file mode 100644 index 000000000..e2b70ba44 --- /dev/null +++ b/roles/configure-mirrors/templates/etc/yum.repos.d/fedora-updates.repo.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} +[updates] +name=Fedora $releasever - $basearch - Updates +failovermethod=priority +baseurl={{ package_mirror }}/updates/$releasever/$basearch/ +enabled=1 +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[updates-debuginfo] +name=Fedora $releasever - $basearch - Updates - Debug +failovermethod=priority +baseurl={{ package_mirror }}/updates/$releasever/$basearch/debug/ +enabled=0 +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[updates-source] +name=Fedora $releasever - Updates Source +failovermethod=priority +baseurl={{ package_mirror }}/updates/$releasever/SRPMS/ +enabled=0 +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +metadata_expire=6h +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False diff --git a/roles/configure-mirrors/templates/etc/yum.repos.d/fedora.repo.j2 b/roles/configure-mirrors/templates/etc/yum.repos.d/fedora.repo.j2 new file mode 100644 index 000000000..3abdca59d --- /dev/null +++ b/roles/configure-mirrors/templates/etc/yum.repos.d/fedora.repo.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} +[fedora] +name=Fedora $releasever - $basearch +failovermethod=priority +baseurl={{ package_mirror }}/releases/$releasever/Everything/$basearch/os/ +enabled=1 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[fedora-debuginfo] +name=Fedora $releasever - $basearch - Debug +failovermethod=priority +baseurl={{ package_mirror }}/releases/$releasever/Everything/$basearch/debug/tree/ +enabled=0 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[fedora-source] +name=Fedora $releasever - Source +failovermethod=priority +baseurl={{ package_mirror }}/releases/$releasever/Everything/source/tree/ +enabled=0 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False diff --git a/roles/configure-mirrors/vars/Fedora.yaml b/roles/configure-mirrors/vars/Fedora.yaml new file mode 100644 index 000000000..dece722ee --- /dev/null +++ b/roles/configure-mirrors/vars/Fedora.yaml @@ -0,0 +1 @@ +package_mirror: "http://{{ mirror_fqdn }}/{{ ansible_distribution | lower }}" diff --git a/zuul.yaml b/zuul.yaml index 8af26797e..8a3e86a13 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -174,6 +174,13 @@ - name: debian-jessie label: debian-jessie +- job: + name: base-integration-fedora-26 + parent: base-integration + nodes: + - name: fedora-26 + label: fedora-26 + - job: name: base-integration-ubuntu-trusty parent: base-integration @@ -194,11 +201,13 @@ jobs: - base-integration-centos-7 - base-integration-debian-jessie + - base-integration-fedora-26 - base-integration-ubuntu-trusty - base-integration-ubuntu-xenial gate: jobs: - base-integration-centos-7 - base-integration-debian-jessie + - base-integration-fedora-26 - base-integration-ubuntu-trusty - base-integration-ubuntu-xenial