Skip to content
Snippets Groups Projects
main.yml 2.47 KiB
Newer Older
- name: make sure out repo server is resolvable
  lineinfile:
    dest: /etc/hosts
    line: "{{ reposerverip }} {{ reposervername }}"  #this is duplicated in the role calculateEtcHosts

#- 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 }}
  when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
  with_items:
  - monashhpc_base.repo
  - monashhpc_others.repo
Trung Nguyen's avatar
Trung Nguyen committed
  - epel.repo
- name: get enabled repos
#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'
Trung Nguyen's avatar
Trung Nguyen committed
  args:
Trung Nguyen's avatar
Trung Nguyen committed
    warn: False
Trung Nguyen's avatar
Trung Nguyen committed
  shell: yum-config-manager --disable "{{ item }}"
  with_items: "{{ repolist.stdout_lines|difference(yumenablerepo) }}"
  become: true
  become_user: root
  ignore_errors: true
  when: ansible_os_family == 'RedHat'
#- name: Enable epel
#  command: yum-config-manager --enable epel
#  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
- name: add repos apt
  shell: "add-apt-repository -y ppa:ubuntu-mate-dev/ppa"
  when: ansible_distribution_release == 'trusty'

- name: add repos apt
  shell: "add-apt-repository -y ppa:ubuntu-mate-dev/trusty-mate"
  when: ansible_distribution_release == 'trusty'

- name: apt-get update
  apt: update_cache=True
  when: ansible_os_family=="Debian"