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/tasks/main.yml b/roles/extra_packages/tasks/main.yml index a12c678120a8c06fee218a41e68a962def58e148..89b03b15efd4a62544bf6c8f7a58ae6ed895efdc 100644 --- a/roles/extra_packages/tasks/main.yml +++ b/roles/extra_packages/tasks/main.yml @@ -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" diff --git a/roles/lmod/tasks/main.yml b/roles/lmod/tasks/main.yml index 951a1cdcb93f00c291a6a203820587dc7939369b..9e2ac4af909db08388e570ca586bec83e0889118 100644 --- a/roles/lmod/tasks/main.yml +++ b/roles/lmod/tasks/main.yml @@ -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 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 aa873e4c0c3b5f970b401c5589762cba6e3492da..b5be91261645541f5a9f2ca87b0f831e13f5fb00 100644 --- a/roles/mellanox_drivers/tasks/main.yml +++ b/roles/mellanox_drivers/tasks/main.yml @@ -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 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" +