Skip to content
Snippets Groups Projects
Commit b3e8a227 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

improved repo handling

parent 4aa31f31
No related branches found
No related tags found
2 merge requests!376Pipelinefix,!373Pipelinefix
This commit is part of merge request !373. Comments created here will be created in the context of that merge request.
......@@ -8,28 +8,6 @@
group: root
become: True
#- name: remove default repos
# file:
# path: /etc/yum.repos.d/{{ item }}
# state: absent
# become: true
# become_user: root
# with_items:
# - CentOS-Base.repo
# - CentOS-Debuginfo.repo
# - CentOS-fasttrack.repo
# - CentOS-Sources.repo
# - CentOS-Vault.repo
# - foreman.repo
# - puppetlabs.repo
# - rdo-release.repo
# - CentOS-CR.repo
# - CentOS-Media.repo
# - CentOS-OpenStack-kilo.repo
# - epel.repo
# - monashhpc_mellanox.repo
# - epel-testing.repo
# when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
- name: add our repos
template: src={{ item }}.j2 dest=/etc/yum.repos.d/{{ item }}
......@@ -45,33 +23,42 @@
#shell: yum repolist | grep -v "repo id" | grep -v "Loaded plugins" | head -n -1 | cut -f 1 -d '/' | sed -s 's/\!//'
shell: yum repolist all | grep enabled | cut -f 1 -d '/' | sed -s 's/\!//'
when: ansible_os_family == 'RedHat'
register: repolist
register: repolistenabled
check_mode: no
changed_when: False
args:
warn: False
- name: disable unwanted repos
shell: yum-config-manager --disable "{{ item }}"
with_items: "{{ repolist.stdout_lines|difference(yumenablerepo) }}"
become: true
become_user: root
ignore_errors: true
- name: get disabled repos
shell: yum repolist all | grep disabled | cut -f 1 -d '/' | sed -s 's/\!//'
when: ansible_os_family == 'RedHat'
register: repolistdisabled
check_mode: no
changed_when: False
args:
warn: False
- name: enable wanted repos
shell: yum-config-manager --enable "{{ item }}"
with_items: "{{ yumenablerepo }}"
#with_items: "{{ repolistenabled.stdout_lines|difference(yumenablerepo) }}"
with_items: "{{ yumenablerepo | symmetric_difference(repolistenabled.stdout_lines) }}"
become: true
become_user: root
ignore_errors: true
#ignore_errors: true
when: ansible_os_family == 'RedHat'
register: repoenable
- name: disable unwanted repos
shell: yum-config-manager --disable "{{ item }}"
with_items: "{{ repolistenabled.stdout_lines|difference(yumenablerepo) }}"
become: true
become_user: root
#ignore_errors: true
when: ansible_os_family == 'RedHat'
register: repodisable
#- name: Enable epel
# command: yum-config-manager --enable epel
# become: true
# when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
# Use mate DE on systems that have moved to gnome3, since there is no gpu acceleration by default on NeCTAR openstack
# Trusty (Ubuntu 14.04 LTS) needs repos added. Wheezy (Debian Stable) gets mate from backports, Utopic (Ubuntu 14.10) Jessie (Debian testing) and Sid (Debian unstable) get it by default
......@@ -89,9 +76,11 @@
apt: update_cache=True
become: true
when: ansible_os_family=="Debian"
- name: force refresh of the repository cache
shell: |
yum clean metadata
yum clean all
yum updateinfo
yum makecache
......@@ -99,6 +88,6 @@
async: 600
poll: 5
check_mode: no
when: addingrepos.changed and ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat' and ( addingrepos.changed or repoenable.changed or repodisable.changed)
args:
warn: False
......@@ -9,14 +9,14 @@ gpgcheck=0
[monashhpc_lustreversions]
name=MonashHPC lustreversions
baseurl=https://{{ reposervername }}/centos7.8
baseurl=https://{{ reposervername }}/lustreversions/$releasever/$basearch/
enabled=1
sslverify=false
gpgcheck=0
[monashhpc_k1gpusupport]
name=MonashHPC k1gpusupport
baseurl=https://{{ reposervername }}/k1gpusupport
baseurl=https://{{ reposervername }}/k1gpusupport/$releasever/$basearch/
enabled=1
sslverify=false
gpgcheck=0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment