Skip to content
Snippets Groups Projects
Commit 6f339824 authored by Jafar Lie's avatar Jafar Lie
Browse files

Merge branch 'ubuntu' of gitlab.erc.monash.edu.au:hpc-team/ansible_cluster_in_a_box into ubuntu

parents db3ba9d2 d1ed5b89
No related branches found
No related tags found
1 merge request!293Ubuntu
---
- name: install collectd
yum: name=collectd state=installed
- name: install collectd - CentOS
yum: name=collectd state=installed enablerepo=epel
when:
- '"CentOS" in ansible_distribution'
become: true
become_user: root
- name: install collectd - RHEL7
yum: name=collectd state=installed enablerepo="Monash_University_EPEL7_EPEL_7_-_x86_64"
when:
- '"DGX" in ansible_product_name'
- '"RedHat" in ansible_distribution'
become: true
become_user: root
......
This role adds all the packages we think are useful but aren't clearly a dependency of some function.
Before calling, you may want to define the following lists:
extra_packages #list of yum packages. Or see code on how to it loads an alternative file if not defined
exclude #list of packages to exclude
Usage:
roles:
- { role: extra_packages, tags: [ other, extra_packages ] }
......@@ -6,19 +6,40 @@
- name: "Clear yum cache"
command: yum clean all
become: true
become_user: root
when: ansible_os_family == 'RedHat'
- name: "Clear yum pending transactions"
command: yum-complete-transaction --cleanup-only
become: true
become_user: root
when: ansible_os_family == 'RedHat'
- name: "Install extra packages"
yum: "name={{ item }} exclude={{ excludes|join(',') }} update_cache=yes state=present"
with_items: "{{ extra_packages }}"
become: true
become_user: root
when: ansible_os_family == 'RedHat'
when:
- '"CentOS" in ansible_distribution'
register: result
- name: "Install extra packages"
yum: "name={{ item }} exclude={{ excludes|join(',') }} update_cache=yes state=present enablerepo='Monash_University_EPEL7_EPEL_7_-_x86_64'"
with_items: "{{ extra_packages }}"
become: true
become_user: root
when:
- '"DGX" in ansible_product_name'
- '"RedHat" in ansible_distribution'
register: result
- name: "Install extra packages with the epel repo enabled"
yum: "name={{ item }} exclude={{ excludes|join(',') }} update_cache=yes state=present enablerepo=epel"
with_items: "{{ extra_packages }}"
become: true
become_user: root
when: ansible_os_family == 'RedHat'
register: result
- name: "Show yum install output"
......
......@@ -14,6 +14,21 @@
become: true
when: ansible_os_family == 'RedHat'
- name: install lua RHEL7
yum: name={{ item }} state=installed update_cache=yes enablerepo="Monash_University_EPEL7_EPEL_7_-_x86_64"
with_items:
- lua
- lua-filesystem
- lua-posix
- tcl
- rsync
- gcc
- lua-devel
when:
- '"DGX" in ansible_product_name'
- '"RedHat" in ansible_distribution'
become: true
- name: install lua debian
apt: name=lmod state=installed
become: true
......@@ -23,7 +38,6 @@
stat: path="{{ soft_dir }}/lmod/{{ lmod_version }}"
register: lmodstat
- name: Download LMOD
get_url:
url=http://consistency0/src/Lmod-{{ lmod_version }}.tar.bz2
......
This role installs the tool from
https://gitlab.erc.monash.edu.au/hpc-team/mclastlogin
It simply updates a mailchimp audience with tags containing data from the last log (/var/log/lastlog)
You need a playbook entry like
- { role: mailchimpLastlogin, python3_bin: /usr/local/python/3.6.2-static/bin/python3, mailchimp_user: na, mailchimp_key: na, mailchimp_list: "Monash HPC Users", mailchimp_datetag: "m3_last_login", mailchimp_numtag: "m3_days_since_active", install_path: /opt/mclastlog, cron_user: root }
- name: create install dir
file:
name: "{{ item }}"
state: directory
owner: "{{ cron_user }}"
with_items:
- "{{ install_path }}"
become: true
become_user: root
- name: upgrade pip
pip:
virtualenv: "{{ install_path }}"
virtualenv_command: "{{ python3_bin }} -m venv"
name: "pip"
extra_args: "--upgrade"
become: true
become_user: "{{ cron_user }}"
- name: install mclastlogin
pip:
virtualenv: "{{ install_path }}"
name: "git+https://gitlab.erc.monash.edu.au/hpc-team/mclastlogin.git"
become: true
become_user: "{{ cron_user }}"
- name: install config
template:
src: "{{ item }}.j2"
dest: "{{install_path}}/{{ item }}"
owner: root
mode: "0600"
become: true
become_user: "{{ cron_user }}"
with_items:
- mailchimpconfig.yml
- ldapconfig.yml
- name: install cronjob
cron:
cron_file: mclastlogin
hour: "1"
minute: "0"
job: "{{ install_path}}/bin/mclastlogin --configdir {{ install_path }}"
name: "mclastlogin"
user: "{{ cron_user }}"
become: true
become_user: root
---
ldapDomain: {{ ldapBase }}
user: {{ ldapBindDN }}
passwd: {{ ldapBindDNPassword }}
cafile: {{ ldapCaCertFile }}
---
user: {{ mailchimp_user }}
key: {{ mailchimp_key }}
default_list: {{ mailchimp_list }}
default_datetag: {{ mailchimp_datetag }}
default_numtag: {{ mailchimp_numtag }}
---
list: "{{ mailchimp_list | default('list') }}"
user: "{{ mailchimp_user }}"
key: "{{ mailchimp_key }}"
datetag: "{{ mailchimp_datetag | default('last_login') }}"
numtag: "{{ mailchimp_numtag | default('days_since_active') }}"
......@@ -65,10 +65,53 @@
become_user: root
when: install_now
#remove old mellanox drivers as they may interfere with an update
- name: stop lustre
service: name=lustre-client state=stopped
become: true
become_user: root
ignore_errors: true
when: install_now
- name: remove ipa stuff
yum: name={{ item }} state=absent
become: true
become_user: root
ignore_errors: true
with_items:
- ipa-common
- ipa-python-compat
- python2-ipalib
when: install_now
- name: remove unnecessary packages that break stuff
yum: name={{ item }} state=absent
become: true
become_user: root
ignore_errors: true
with_items:
- libgpod
- usbmuxd
- libmlx5
- libmlx4
- libibverbs
when: install_now
- name: remove mellanox rpms
yum: name={{ item }} state=absent
become: true
become_user: root
ignore_errors: true
with_items:
- mlnx-ofa_kernel
- mlnx-ofa_kernel-devel
- mlnx-ofa_kernel-modules
when: install_now
- name: install drivers
shell: ./mlnxofedinstall -q --add-kernel-support --force --skip-repo
args:
#more changes
chdir: "/tmp/{{ MELLANOX_DRIVER_SRC }}"
become: true
become_user: root
......
---
#note. do not add '.tgz' to driver src. done in playbook
#MELLANOX_DRIVER_SRC: "{% if ansible_os_family == 'RedHat' %}MLNX_OFED_LINUX-4.4-1.0.0.0-rhel7.4-x86_64{% elif ansible_os_family == 'Debian' %}MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64{% endif %}"
MELLANOX_DRIVER_SRC: "{% if ansible_os_family == 'RedHat' %}MLNX_OFED_LINUX-4.5-1.0.1.0-rhel7.6-x86_64{% elif ansible_os_family == 'Debian' %}MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64{% endif %}"
#MELLANOX_DRIVER_SRC: "{% if ansible_os_family == 'RedHat' %}MLNX_OFED_LINUX-4.5-1.0.1.0-rhel7.6-x86_64{% elif ansible_os_family == 'Debian' %}MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64{% endif %}"
MELLANOX_DRIVER_SRC: "{% if ansible_os_family == 'RedHat' %}MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.7-x86_64{% elif ansible_os_family == 'Debian' %}MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64{% endif %}"
---
system_packages:
- tigervnc-server
- libXcomposite
- libXdamage
- mesa-libEGL
- mesa-libgbm
- harfbuzz
- mesa-libglapi
- graphite2
- xterm
- libpng
- xorg-x11-fonts-100dpi
- xorg-x11-fonts-75dpi
- xorg-x11-fonts-misc
system_group_packages:
- "mate-desktop-environment"
- "graphical-server-environment"
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