diff --git a/roles/collectd/tasks/main.yml b/roles/collectd/tasks/main.yml index 6a26256114978966c7b3909f612ec36639e1cb2c..fccbe6af077098d463721d352ab9d20e878f3079 100644 --- a/roles/collectd/tasks/main.yml +++ b/roles/collectd/tasks/main.yml @@ -1,6 +1,16 @@ --- -- 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 diff --git a/roles/extra_packages/README.md b/roles/extra_packages/README.md index ffa7d0b01fbadf231490c94caecde085275ef2fc..29b7f54a025d5b3dd94084e616eb5b6e05b6e4b9 100644 --- a/roles/extra_packages/README.md +++ b/roles/extra_packages/README.md @@ -1 +1,11 @@ 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 ] } diff --git a/roles/extra_packages/tasks/main.yml b/roles/extra_packages/tasks/main.yml index e2ead4d207193800819c4a53ea1e2f1499be11bc..46ce40a581ae7baf34981217f2313fb5d506841a 100644 --- a/roles/extra_packages/tasks/main.yml +++ b/roles/extra_packages/tasks/main.yml @@ -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" diff --git a/roles/lmod/tasks/main.yml b/roles/lmod/tasks/main.yml index aa125741b5100de826e83da01318b0580ab518fa..e33c2ee5664f527213be4c64f09f882fb9cb3957 100644 --- a/roles/lmod/tasks/main.yml +++ b/roles/lmod/tasks/main.yml @@ -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 diff --git a/roles/mailchimpLastlogin/README.md b/roles/mailchimpLastlogin/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9119e96dfe247c022a8157a1595aa41d90bd9c3c --- /dev/null +++ b/roles/mailchimpLastlogin/README.md @@ -0,0 +1,9 @@ +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 } diff --git a/roles/mailchimpLastlogin/tasks/main.yml b/roles/mailchimpLastlogin/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..f3d6c006bb9b1b8786e4c3327980b802dfb31fdf --- /dev/null +++ b/roles/mailchimpLastlogin/tasks/main.yml @@ -0,0 +1,50 @@ +- 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 + + diff --git a/roles/mailchimpLastlogin/templates/ldapconfig.yml.j2 b/roles/mailchimpLastlogin/templates/ldapconfig.yml.j2 new file mode 100644 index 0000000000000000000000000000000000000000..9982acb0591ac99775f99e449a564fb96ba26782 --- /dev/null +++ b/roles/mailchimpLastlogin/templates/ldapconfig.yml.j2 @@ -0,0 +1,5 @@ +--- +ldapDomain: {{ ldapBase }} +user: {{ ldapBindDN }} +passwd: {{ ldapBindDNPassword }} +cafile: {{ ldapCaCertFile }} diff --git a/roles/mailchimpLastlogin/templates/mailchimpconfig.yml.j2 b/roles/mailchimpLastlogin/templates/mailchimpconfig.yml.j2 new file mode 100644 index 0000000000000000000000000000000000000000..19f7ec1e6a38a83b802262a1c5394baa0febf69b --- /dev/null +++ b/roles/mailchimpLastlogin/templates/mailchimpconfig.yml.j2 @@ -0,0 +1,7 @@ +--- + user: {{ mailchimp_user }} + key: {{ mailchimp_key }} + default_list: {{ mailchimp_list }} + default_datetag: {{ mailchimp_datetag }} + default_numtag: {{ mailchimp_numtag }} + diff --git a/roles/mailchimpLastlogin/vars/main.yml b/roles/mailchimpLastlogin/vars/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..b4ff5d4b2c57c06a6a5ea0f5f80cf9181f9a91f8 --- /dev/null +++ b/roles/mailchimpLastlogin/vars/main.yml @@ -0,0 +1,7 @@ +--- + list: "{{ mailchimp_list | default('list') }}" + user: "{{ mailchimp_user }}" + key: "{{ mailchimp_key }}" + datetag: "{{ mailchimp_datetag | default('last_login') }}" + numtag: "{{ mailchimp_numtag | default('days_since_active') }}" + diff --git a/roles/mellanox_drivers/tasks/main.yml b/roles/mellanox_drivers/tasks/main.yml index f8167fd22d2c9f44604484d170e64b41ca944249..e088c9cc970c26910ff588d89e1323ce790f95c1 100644 --- a/roles/mellanox_drivers/tasks/main.yml +++ b/roles/mellanox_drivers/tasks/main.yml @@ -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 diff --git a/roles/mellanox_drivers/vars/mellanoxVars.yml b/roles/mellanox_drivers/vars/mellanoxVars.yml index 6aa643d58ac88337df835db8fd81dd6e3b84fb17..4fb42fdb4a61d9550761bf4ba9616f83957b47b2 100644 --- a/roles/mellanox_drivers/vars/mellanoxVars.yml +++ b/roles/mellanox_drivers/vars/mellanoxVars.yml @@ -1,4 +1,5 @@ --- #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 %}" diff --git a/roles/vncserver/vars/RedHat_x86_64.yml b/roles/vncserver/vars/RedHat_x86_64.yml new file mode 100644 index 0000000000000000000000000000000000000000..0880aa2776c71ada625cd7f9b36dd9e5c57cf042 --- /dev/null +++ b/roles/vncserver/vars/RedHat_x86_64.yml @@ -0,0 +1,20 @@ +--- + 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" +