From 4c1cd77b7e021c05834042e945beaee248b4f815 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Wed, 6 Mar 2024 15:46:55 +1300 Subject: [PATCH] add utility script for listing users, remove ml102 linux host --- roles/apptainer/tasks/main.yml | 19 ------------------- roles/utils/files/nesi-list-users | 7 +++++++ roles/utils/tasks/main.yml | 10 ++++++++++ setup-training-environment.yml | 9 +++++++-- 4 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 roles/utils/files/nesi-list-users create mode 100644 roles/utils/tasks/main.yml diff --git a/roles/apptainer/tasks/main.yml b/roles/apptainer/tasks/main.yml index 7b9b41e..e5d239c 100644 --- a/roles/apptainer/tasks/main.yml +++ b/roles/apptainer/tasks/main.yml @@ -19,22 +19,3 @@ command: apptainer pull /opt/ood/linuxhost_adapter/ubuntu_22.04.sif docker://ubuntu:22.04 args: creates: /opt/ood/linuxhost_adapter/ubuntu_22.04.sif -# TODO: better to push the image to a repo and pull from there -#- name: Clone ML101 repo -# ansible.builtin.git: -# repo: 'https://github.com/nesi/sklearn_tutorial.git' -# dest: /opt/sklearn_tutorial -# version: ml_20230509 -#- name: Copy apptainer def file for ML101 -# copy: -# src: ML101.def -# dest: /opt/sklearn_tutorial/ML101.def -#- name: Copy requirements.txt file for ML101 -# copy: -# src: requirements.txt -# dest: /opt/sklearn_tutorial/requirements.txt -#- name: Build ML101 image -# command: 'apptainer build ML101.sif ML101.def' -# args: -# chdir: /opt/sklearn_tutorial -# creates: /opt/sklearn_tutorial/ML101.sif diff --git a/roles/utils/files/nesi-list-users b/roles/utils/files/nesi-list-users new file mode 100644 index 0000000..ef1de42 --- /dev/null +++ b/roles/utils/files/nesi-list-users @@ -0,0 +1,7 @@ +#!/bin/bash -e + +for fn in /etc/ldap/password_*; do + printf "${fn#/etc/ldap/password_} " + sudo cat "$fn" + printf "\n" +done diff --git a/roles/utils/tasks/main.yml b/roles/utils/tasks/main.yml new file mode 100644 index 0000000..b037ed6 --- /dev/null +++ b/roles/utils/tasks/main.yml @@ -0,0 +1,10 @@ +--- +- name: Install script to list user accounts + ansible.builtin.copy: + src: nesi-list-users + dest: /usr/local/bin/nesi-list-users + owner: root + group: root + mode: '0755' + + diff --git a/setup-training-environment.yml b/setup-training-environment.yml index 7210010..a127ccb 100644 --- a/setup-training-environment.yml +++ b/setup-training-environment.yml @@ -172,12 +172,11 @@ roles: - keycloak -- name: Install Workshops +- name: Setup linux host cluster become: yes hosts: webnode roles: - apptainer - - ml102_workshop # run ondemand role - name: Install ondemand @@ -219,3 +218,9 @@ state: present roles: - { role: openondemand-k8s/web-node } + +- name: Install utility scripts + hosts: servicesnode + become: yes + roles: + - utils