From 3cc5ff41e3d32041fbd153c520b1759c61867656 Mon Sep 17 00:00:00 2001 From: Bart Sjerps Date: Tue, 23 Jun 2026 13:48:34 +0200 Subject: [PATCH] update --- config.yml | 8 +++++- docker.yml | 33 ++++++++++++++++++++++++ gpu.yml | 47 ++++++++++++++++++++++++++++++++++ group_vars/all.yml | 4 +++ inventory.ini | 24 ++++++++++++++++- proxmox.yml | 11 ++++++++ templates/autofs_auto.direct | 2 ++ templates/autofs_direct.autofs | 1 + 8 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 gpu.yml create mode 100644 proxmox.yml create mode 100644 templates/autofs_auto.direct create mode 100644 templates/autofs_direct.autofs diff --git a/config.yml b/config.yml index 5fdac56..0f4a658 100644 --- a/config.yml +++ b/config.yml @@ -1,6 +1,6 @@ --- - name: Sync Configuration Files - hosts: servers + hosts: rocky become: yes vars: worker_limit: 1024 # Global variable used in the template @@ -80,8 +80,14 @@ group: root mode: '0755' + - name: Enable AutoFS + ansible.builtin.systemd: + name: autofs + state: started + handlers: - name: Restart sssd service: name: sssd state: restarted + diff --git a/docker.yml b/docker.yml index 4f7988a..116d5dc 100644 --- a/docker.yml +++ b/docker.yml @@ -2,6 +2,23 @@ - name: Setup Docker systems hosts: docker tasks: + - name: Docker Repo + ansible.builtin.yum_repository: + name: docker-ce-stable + description: Docker CE Stable - x86_64 + baseurl: https://download.docker.com/linux/rhel/$releasever/$basearch/stable + gpgkey: https://download.docker.com/linux/rhel/gpg + + - name: Docker Packages + ansible.builtin.package: + name: + - docker-ce + - docker-ce-cli + - containerd.io + - docker-buildx-plugin + - docker-compose-plugin + state: present + - name: Create systemd override directory file: path: /etc/systemd/system/docker.service.d @@ -36,6 +53,22 @@ state: enabled immediate: yes + - name: Create /volumes directory + file: + path: /volumes + state: directory + mode: '0755' + owner: root + group: root + + - name: Mount and bind a volume + ansible.posix.mount: + path: /volumes + src: /var/lib/docker/volumes + opts: bind + state: mounted + fstype: none + handlers: - name: Restart docker service: diff --git a/gpu.yml b/gpu.yml new file mode 100644 index 0000000..d1d088c --- /dev/null +++ b/gpu.yml @@ -0,0 +1,47 @@ +--- +- name: Setup Nvidia GPU drivers + hosts: nvidia + tasks: + - name: nVidia CUDA Repo + ansible.builtin.yum_repository: + name: cuda-rhel9-x86_64 + description: cuda-rhel9-x86_64 + baseurl: https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64 + gpgkey: https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/D42D0685.pub + + - name: Enable CRB repo + ansible.builtin.ini_file: + path: /etc/yum.repos.d/{{ repo_file }} + section: "{{ repo_id }}" + option: enabled + value: "1" + no_extra_spaces: true + vars: + repo_id: crb + repo_file: rocky.repo + + - name: NVidia Driver RPMs + ansible.builtin.package: + name: + - gcc + - make + - dkms + - kernel-devel + - kernel-headers + - cuda-toolkit + # nvidia-smi + - nvidia-container-toolkit + state: present + update_cache: false + # when: 0 > 1 + + - name: NVidia Kernel Module + ansible.builtin.dnf: + name: '@nvidia-driver:580-dkms' + state: present + update_cache: false + # when: 0 > 1 + # + # Add: + # dkms autoinstall -k $(uname -r) + diff --git a/group_vars/all.yml b/group_vars/all.yml index 53adc75..a280ce6 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -3,6 +3,7 @@ common_packages: - autofs - bash-completion - bzip2 + - dnf-automatic - dstat - epel-release - git @@ -28,3 +29,6 @@ common_packages: - vim - wget - xfsprogs + +proxmox_packages: + - unattended-upgrades diff --git a/inventory.ini b/inventory.ini index 778fbbd..076b10f 100644 --- a/inventory.ini +++ b/inventory.ini @@ -11,10 +11,32 @@ atc-grafana.dell-atc.lan ansible_user=root atc-test01.dell-atc.lan ansible_user=root atc-mgt01.dell-atc.lan ansible_user=root atc-gpu-bart.dell-atc.lan ansible_user=root -atc-gpu-mo.dell-atc.lan ansible_user=root +atc-gpu-mo1.dell-atc.lan ansible_user=root +atc-nas.dell-atc.lan ansible_user=root + +[proxmox] +dcp-pve01.dell-atc.lan ansible_user=root +DSS-GPU.dell-atc.lan ansible_user=root +pve2.dell-atc.lan ansible_user=root [docker] atc-mgt01.dell-atc.lan ansible_user=root atc-docker01.dell-atc.lan ansible_user=root atc-docker02.dell-atc.lan ansible_user=root +atc-gpu-bart.dell-atc.lan ansible_user=root +atc-gpu-mo1.dell-atc.lan ansible_user=root +atc-dns1.dell-atc.lan ansible_user=root +atc-dns2.dell-atc.lan ansible_user=root + +[nvidia] +atc-gpu-bart.dell-atc.lan ansible_user=root +atc-gpu-mo1.dell-atc.lan ansible_user=root + +[rocky:children] +servers +docker +nvidia + +[debian:children] +proxmox diff --git a/proxmox.yml b/proxmox.yml new file mode 100644 index 0000000..f41970d --- /dev/null +++ b/proxmox.yml @@ -0,0 +1,11 @@ +--- +- name: Ensure extra packages are installed + hosts: proxmox + become: true + + tasks: + - name: Install packages + ansible.builtin.package: + name: "{{proxmox_packages}}" + state: present + diff --git a/templates/autofs_auto.direct b/templates/autofs_auto.direct new file mode 100644 index 0000000..0e3695d --- /dev/null +++ b/templates/autofs_auto.direct @@ -0,0 +1,2 @@ +/usertest atc-nas.dell-atc.lan:/export/users + diff --git a/templates/autofs_direct.autofs b/templates/autofs_direct.autofs new file mode 100644 index 0000000..fb72df8 --- /dev/null +++ b/templates/autofs_direct.autofs @@ -0,0 +1 @@ +/- /etc/auto.direct