diff options
author | Matthieu Saulnier <fantom@fedoraproject.org> | 2018-12-01 10:30:29 +0100 |
---|---|---|
committer | Matthieu Saulnier <fantom@fedoraproject.org> | 2018-12-01 10:30:29 +0100 |
commit | 4675ba311b5d5232cf5374b8b91a504faab6b3a0 (patch) | |
tree | ad78374d27723e6a87379d9b6dc0a8713e718eb2 | |
parent | 7fae6d5e45c235355ee5fd735209fe2c3075b826 (diff) | |
download | playbooks-ansible-4675ba311b5d5232cf5374b8b91a504faab6b3a0.tar.gz playbooks-ansible-4675ba311b5d5232cf5374b8b91a504faab6b3a0.tar.xz playbooks-ansible-4675ba311b5d5232cf5374b8b91a504faab6b3a0.zip |
Template for local mirror in common role
-rw-r--r-- | host_vars/51.15.179.153 | 2 | ||||
-rw-r--r-- | host_vars/bpr7drsao5vozzr5.onion | 2 | ||||
-rw-r--r-- | host_vars/ns4.casperlefantom.net | 2 | ||||
-rw-r--r-- | roles/common/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/common/tasks/repos.yml | 103 | ||||
-rw-r--r-- | roles/common/templates/fedora-fantom-hidden.repo.j2 (renamed from roles/common/files/fedora-fantom-hidden.repo) | 2 | ||||
-rw-r--r-- | roles/common/templates/fedora-fantom.repo.j2 (renamed from roles/common/files/fedora-fantom.repo) | 4 | ||||
-rw-r--r-- | roles/common/templates/updates-fantom-hidden.repo.j2 (renamed from roles/common/files/updates-fantom-hidden.repo) | 2 | ||||
-rw-r--r-- | roles/common/templates/updates-fantom.repo.j2 (renamed from roles/common/files/updates-fantom.repo) | 8 | ||||
-rw-r--r-- | roles/common/vars/main.yml | 1 |
10 files changed, 62 insertions, 67 deletions
diff --git a/host_vars/51.15.179.153 b/host_vars/51.15.179.153 index 2cc6aa9..3833caa 100644 --- a/host_vars/51.15.179.153 +++ b/host_vars/51.15.179.153 @@ -5,6 +5,8 @@ bpburst: '7 MBytes' maxadvertised: '5 MBytes' outdoor: true is_ntpslave: true +# common/repos +mirrorenable: 0 # reverseproxy domainhttps: - ns4.casperlefantom.net diff --git a/host_vars/bpr7drsao5vozzr5.onion b/host_vars/bpr7drsao5vozzr5.onion index 2cc6aa9..3833caa 100644 --- a/host_vars/bpr7drsao5vozzr5.onion +++ b/host_vars/bpr7drsao5vozzr5.onion @@ -5,6 +5,8 @@ bpburst: '7 MBytes' maxadvertised: '5 MBytes' outdoor: true is_ntpslave: true +# common/repos +mirrorenable: 0 # reverseproxy domainhttps: - ns4.casperlefantom.net diff --git a/host_vars/ns4.casperlefantom.net b/host_vars/ns4.casperlefantom.net index 2cc6aa9..3833caa 100644 --- a/host_vars/ns4.casperlefantom.net +++ b/host_vars/ns4.casperlefantom.net @@ -5,6 +5,8 @@ bpburst: '7 MBytes' maxadvertised: '5 MBytes' outdoor: true is_ntpslave: true +# common/repos +mirrorenable: 0 # reverseproxy domainhttps: - ns4.casperlefantom.net diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml new file mode 100644 index 0000000..f8eb63b --- /dev/null +++ b/roles/common/defaults/main.yml @@ -0,0 +1,3 @@ +mirrorhost: "mirror.home.casperlefantom.net:4433" +mirrorenable: "1" +mirrorhiddenenable: "0" diff --git a/roles/common/tasks/repos.yml b/roles/common/tasks/repos.yml index b60cd07..b2770c8 100644 --- a/roles/common/tasks/repos.yml +++ b/roles/common/tasks/repos.yml @@ -1,8 +1,21 @@ - name: Installation du dépôt updates Fantom - copy: - src: updates-fantom.repo + template: + src: updates-fantom.repo.j2 dest: /etc/yum.repos.d/updates-fantom.repo - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" + owner: root + group: root + mode: 0644 + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" + +- name: Installation du dépôt updates Hidden + template: + src: updates-fantom-hidden.repo.j2 + dest: /etc/yum.repos.d/updates-fantom-hidden.repo + owner: root + group: root + mode: 0644 + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" and ansible_distribution_release != "Rawhide" - name: Désactivation du dépôt Updates @@ -10,47 +23,39 @@ section=updates option=enabled value=0 - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is not defined - -- name: Désactivation du dépôt updates Fantom - ini_file: dest=/etc/yum.repos.d/updates-fantom.repo - section=updates-fantom - option=enabled - value=0 - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is defined + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" and mirrorenable == "1" + or mirrorhiddenenable == "1" - name: Activation du dépôt Updates ini_file: dest=/etc/yum.repos.d/fedora-updates.repo section=updates option=enabled value=1 - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is defined + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" and mirrorenable == "0" + or mirrorhiddenenable == "0" -- name: Activation du dépôt updates Fantom - ini_file: dest=/etc/yum.repos.d/updates-fantom.repo - section=updates-fantom - option=enabled - value=1 - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is not defined - - -- name: Installation du dépôt updates Hidden - copy: - src: updates-fantom-hidden.repo - dest: /etc/yum.repos.d/updates-fantom-hidden.repo - when: ansible_distribution_version|int >= 28 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" - name: Installation du dépôt Fedora Fantom - copy: - src: fedora-fantom.repo + template: + src: fedora-fantom.repo.j2 dest: /etc/yum.repos.d/fedora-fantom.repo - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" + owner: root + group: root + mode: 0644 + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" + +- name: Installation du dépôt Fedora fantom Hidden + template: + src: fedora-fantom-hidden.repo.j2 + dest: /etc/yum.repos.d/fedora-fantom-hidden.repo + owner: root + group: root + mode: 0644 + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" and ansible_distribution_release != "Rawhide" - name: Désactivation du dépôt Fedora @@ -58,40 +63,20 @@ section=fedora option=enabled value=0 - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is not defined - -- name: Désactivation du dépôt Fedora Fantom - ini_file: dest=/etc/yum.repos.d/fedora-fantom.repo - section=fedora-fantom - option=enabled - value=0 - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is defined + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" and mirrorenable == "1" + or mirrorhiddenenable == "1" - name: Activation du dépôt Fedora ini_file: dest=/etc/yum.repos.d/fedora.repo section=fedora option=enabled value=1 - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is defined - -- name: Activation du dépôt Fedora Fantom - ini_file: dest=/etc/yum.repos.d/fedora-fantom.repo - section=fedora-fantom - option=enabled - value=1 - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" and outdoor is not defined + when: ansible_distribution_version|int >= {{ mirrorlimitdown }} and ansible_architecture == "x86_64" + and ansible_distribution_release != "Rawhide" and mirrorenable == "0" + or mirrorhiddenenable == "0" -- name: Installation du dépôt Fedora fantom Hidden - copy: - src: fedora-fantom-hidden.repo - dest: /etc/yum.repos.d/fedora-fantom-hidden.repo - when: ansible_distribution_version|int >= 27 and ansible_architecture == "x86_64" - and ansible_distribution_release != "Rawhide" - name: Installation du dépôt EPEL pour Centos yum: name=epel-release state=present diff --git a/roles/common/files/fedora-fantom-hidden.repo b/roles/common/templates/fedora-fantom-hidden.repo.j2 index 90b12a8..7faf573 100644 --- a/roles/common/files/fedora-fantom-hidden.repo +++ b/roles/common/templates/fedora-fantom-hidden.repo.j2 @@ -2,7 +2,7 @@ name=Fedora $releasever - $basearch on Casper's hidden server failovermethod=priority baseurl=http://pmstfd4f6s5bm2xq.onion/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ -enabled=0 +enabled={{ mirrorhiddenenable }} repo_gpgcheck=0 type=rpm metadata_expire=7d diff --git a/roles/common/files/fedora-fantom.repo b/roles/common/templates/fedora-fantom.repo.j2 index 4cf7586..a808e86 100644 --- a/roles/common/files/fedora-fantom.repo +++ b/roles/common/templates/fedora-fantom.repo.j2 @@ -1,8 +1,8 @@ [fedora-fantom] name=Fedora $releasever - $basearch on Casper's server failovermethod=priority -baseurl=https://mirror.home.casperlefantom.net:4433/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ -enabled=0 +baseurl=https://{{ mirrorhost }}/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ +enabled={{ mirrorenable }} repo_gpgcheck=0 type=rpm metadata_expire=7d diff --git a/roles/common/files/updates-fantom-hidden.repo b/roles/common/templates/updates-fantom-hidden.repo.j2 index 0c160b1..defd824 100644 --- a/roles/common/files/updates-fantom-hidden.repo +++ b/roles/common/templates/updates-fantom-hidden.repo.j2 @@ -2,7 +2,7 @@ name=Fedora $releasever - $basearch - Updates on Casper's hidden server failovermethod=priority baseurl=http://pmstfd4f6s5bm2xq.onion/pub/fedora/linux/updates/$releasever/Everything/$basearch/ -enabled=0 +enabled={{ mirrorhiddenenable }} repo_gpgcheck=0 type=rpm gpgcheck=1 diff --git a/roles/common/files/updates-fantom.repo b/roles/common/templates/updates-fantom.repo.j2 index fa1ffe3..3fa7c8b 100644 --- a/roles/common/files/updates-fantom.repo +++ b/roles/common/templates/updates-fantom.repo.j2 @@ -1,8 +1,8 @@ [updates-fantom] name=Fedora $releasever - $basearch - Updates on Casper's server failovermethod=priority -baseurl=https://mirror.home.casperlefantom.net:4433/pub/fedora/linux/updates/$releasever/Everything/$basearch/ -enabled=0 +baseurl=https://{{ mirrorhost }}/pub/fedora/linux/updates/$releasever/Everything/$basearch/ +enabled={{ mirrorenable }} repo_gpgcheck=0 type=rpm gpgcheck=1 @@ -13,7 +13,7 @@ skip_if_unavailable=False [updates-debuginfo-fantom] name=Fedora $releasever - $basearch - Updates - Debug on Casper's server failovermethod=priority -baseurl=https://mirror.home.casperlefantom.net:4433/pub/fedora/linux/updates/$releasever/Everything/$basearch/debug/ +baseurl=https://{{ mirrorhost }}/pub/fedora/linux/updates/$releasever/Everything/$basearch/debug/ enabled=0 repo_gpgcheck=0 type=rpm @@ -25,7 +25,7 @@ skip_if_unavailable=False [updates-source-fantom] name=Fedora $releasever - Updates Source on Casper's server failovermethod=priority -baseurl=https://mirror.home.casperlefantom.net:4433/pub/fedora/linux/updates/$releasever/Everything/SRPMS/ +baseurl=https://{{ mirrorhost }}/pub/fedora/linux/updates/$releasever/Everything/SRPMS/ enabled=0 repo_gpgcheck=0 type=rpm diff --git a/roles/common/vars/main.yml b/roles/common/vars/main.yml index 1120a18..d576d28 100644 --- a/roles/common/vars/main.yml +++ b/roles/common/vars/main.yml @@ -1,3 +1,4 @@ minkernel: 2 maxkernel: 6 logo_release: 22 +mirrorlimitdown : 27 |