From 9a0c36e75701804a9978a27c8e4d6feafb560b60 Mon Sep 17 00:00:00 2001 From: Bart Sjerps Date: Thu, 23 Jul 2026 15:36:44 +0200 Subject: [PATCH] update --- config.yml | 71 +++++++++++++++++++++------------ group_vars/all.yml | 1 + inventory.ini | 14 ++++--- templates/50unattended-upgrades | 2 +- templates/auto.users | 1 + templates/users.autofs | 1 + 6 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 templates/auto.users create mode 100644 templates/users.autofs diff --git a/config.yml b/config.yml index ec1e030..a2c7b4c 100644 --- a/config.yml +++ b/config.yml @@ -6,14 +6,41 @@ worker_limit: 1024 # Global variable used in the template tasks: - - name: Deploy sssd.conf - template: - src: templates/sssd.conf - dest: /etc/sssd/conf.d/sssd.conf + - name: Root password + ansible.builtin.import_tasks: tasks/rootpass.yml + + - name: Create Directories + file: + path: '{{ item.directory }}' + state: directory + mode: "{{ item.mode | default('0755') }}" owner: root group: root - mode: '0600' - notify: Restart sssd # This triggers the handler only if the file changes + loop: + - { directory: "/var/backups" } + - { directory: "/opt/atclab/bin" } + - { directory: "/var/user", mode: "1777" } + + - name: Copy etc configs + copy: + src: '{{ item.src }}' + dest: '{{ item.dest }}' + owner: root + group: root + mode: "{{ item.mode | default('0644') }}" + loop: + - { src: templates/users.autofs, dest: /etc/auto.master.d/users.autofs } + - { src: templates/auto.users, dest: /etc/auto.users } + - { src: templates/sssd.conf, dest: /etc/sssd/conf.d/sssd.conf, mode: '0600' } + +# - name: Deploy sssd.conf +# template: +# src: templates/sssd.conf +# dest: /etc/sssd/conf.d/sssd.conf +# owner: root +# group: root +# mode: '0600' +# notify: Restart sssd # This triggers the handler only if the file changes - name: Deploy ldap.conf template: @@ -55,26 +82,7 @@ group: root mode: '0644' - - name: Root password - ansible.builtin.import_tasks: tasks/rootpass.yml - - # - name: Disable SELinux - # ansible.builtin.selinux: - # state: disabled - - - name: Create Directories - file: - path: '{{ item.directory }}' - state: directory - mode: "{{ item.mode | default('0755') }}" - owner: root - group: root - loop: - - { directory: "/var/backups" } - - { directory: "/opt/atclab/bin" } - - { directory: "/var/user", mode: "1777" } - - - name: Copy etc configs + - name: Copy profile configs copy: src: etc/profile.d/ dest: /etc/profile.d/ @@ -82,6 +90,17 @@ group: root mode: '0644' + - name: Copy etc configs + copy: + src: '{{ item.src }}' + dest: '{{ item.dest }}' + owner: root + group: root + mode: '0644' + loop: + - { src: templates/users.autofs, dest: /etc/auto.master.d/users.autofs } + - { src: templates/auto.users, dest: /etc/auto.users } + - name: Copy bin scripts copy: src: bin/ diff --git a/group_vars/all.yml b/group_vars/all.yml index c1ece90..8c2cd5c 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -35,3 +35,4 @@ root_password_hash: "$6$OJEdzUbqfQR72WjX$SFMnDZ0MXM7JfYKPvvN0nJIPetzrWQw/0q360xg proxmox_packages: - unattended-upgrades - borgmatic + - net-tools diff --git a/inventory.ini b/inventory.ini index b80a556..acae4a9 100644 --- a/inventory.ini +++ b/inventory.ini @@ -14,6 +14,7 @@ atc-gpu-dev.dell-atc.lan atc-gpu-mo1.dell-atc.lan atc-gpu-prod.dell-atc.lan atc-nas.dell-atc.lan +mgt01.dell-fde.lan dns1.dell-fde.lan dns2.dell-fde.lan db01.dell-fde.lan @@ -27,18 +28,19 @@ proxmox01.dell-fde.lan proxmox02.dell-fde.lan [docker] -atc-mgt01.dell-atc.lan +atc-db02.dell-atc.lan +atc-dns1.dell-atc.lan atc-docker01.dell-atc.lan atc-docker02.dell-atc.lan atc-gpu-bart.dell-atc.lan +atc-gpu-dev.dell-atc.lan atc-gpu-mo2.dell-atc.lan atc-gpu-prod.dell-atc.lan -atc-db02.dell-atc.lan -atc-dns1.dell-atc.lan -atc-dns1.lan +atc-mgt01.dell-atc.lan +atc-portal01.dell-atc.lan dns1.dell-fde.lan dns2.dell-fde.lan -atc-portal01.dell-atc.lan +mgt01.dell-fde.lan [rhel] atc-docker01.dell-atc.lan @@ -55,6 +57,7 @@ dns1.dell-fde.lan haproxy.dell-fde.lan dns2.dell-fde.lan db01.dell-fde.lan +mgt01.dell-fde.lan [borg_servers] atc-backup.dell-atc.lan @@ -76,6 +79,7 @@ haproxy.dell-fde.lan pve2.dell-atc.lan proxmox01.dell-fde.lan proxmox02.dell-fde.lan +mgt01.dell-fde.lan [postgres] atc-db01.dell-atc.lan diff --git a/templates/50unattended-upgrades b/templates/50unattended-upgrades index 0b1129b..b307831 100644 --- a/templates/50unattended-upgrades +++ b/templates/50unattended-upgrades @@ -26,7 +26,7 @@ Unattended-Upgrade::Origins-Pattern { // archives (e.g. from testing to stable and later oldstable). // Software will be the latest available for the named release, // but the Debian release itself will not be automatically upgraded. -// "origin=Debian,codename=${distro_codename}-updates"; + "origin=Debian,codename=${distro_codename}-updates"; // "origin=Debian,codename=${distro_codename}-proposed-updates"; "origin=Debian,codename=${distro_codename},label=Debian"; "origin=Debian,codename=${distro_codename},label=Debian-Security"; diff --git a/templates/auto.users b/templates/auto.users new file mode 100644 index 0000000..d5fecd1 --- /dev/null +++ b/templates/auto.users @@ -0,0 +1 @@ +* nfs.dell-fde.lan:/export/users/& diff --git a/templates/users.autofs b/templates/users.autofs new file mode 100644 index 0000000..4e6af81 --- /dev/null +++ b/templates/users.autofs @@ -0,0 +1 @@ +/users /etc/auto.users