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

Merge remote-tracking branch 'origin/master' into cicd

parents f4780172 bba53baf
No related branches found
No related tags found
1 merge request!297Cicd merge back
---
- 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
......
......@@ -6,12 +6,33 @@
- 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:
- '"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"
......
......@@ -12,7 +12,24 @@
- gcc
- lua-devel
become: true
when: ansible_os_family == 'RedHat'
when:
- '"CentOS" in ansible_distribution'
- 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={{ item }} state=installed
......@@ -36,7 +53,7 @@
- name: Download LMOD
get_url:
url=http://consistency0/src/Lmod-{{ lmod_version }}.tar.bz2
dest={{source_dir}}/Lmod-{{ lmod_version }}.tar.bz2
dest={{ source_dir }}/Lmod-{{ lmod_version }}.tar.bz2
mode=0444
when: not lmodstat.stat.exists
......@@ -45,7 +62,7 @@
src={{ source_dir }}/Lmod-{{ lmod_version }}.tar.bz2
dest={{ source_dir }}
copy=no
creates={{source_dir}}/Lmod-{{ lmod_version }}/README
creates={{ source_dir }}/Lmod-{{ lmod_version }}/README
when: not lmodstat.stat.exists
- name: Compile and install Lmod
......
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') }}"
......@@ -70,10 +70,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