Skip to content
Snippets Groups Projects

Pipelinefix

Merged Andreas Hamacher requested to merge pipelinefix into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading