From 659f093a1e6eeb3f7382fd0336aa0e638b182eb4 Mon Sep 17 00:00:00 2001 From: rubenb Date: Wed, 18 Oct 2023 08:31:50 +0200 Subject: [PATCH] change role to common-base-config --- .../base-config-debian.yaml | 8 ++--- .../defaults/main.yaml | 0 .../files/nslcd.conf | 0 .../handlers/main.yaml | 0 .../tasks/main.yaml | 31 ++++++++++++++++--- .../vars/main.yaml | 0 6 files changed, 30 insertions(+), 9 deletions(-) rename linux/base-config-debian/roles/{base-config-debian-os => common-base-config-debian-os}/defaults/main.yaml (100%) rename linux/base-config-debian/roles/{base-config-debian-os => common-base-config-debian-os}/files/nslcd.conf (100%) rename linux/base-config-debian/roles/{base-config-debian-os => common-base-config-debian-os}/handlers/main.yaml (100%) rename linux/base-config-debian/roles/{base-config-debian-os => common-base-config-debian-os}/tasks/main.yaml (88%) rename linux/base-config-debian/roles/{base-config-debian-os => common-base-config-debian-os}/vars/main.yaml (100%) diff --git a/linux/base-config-debian/base-config-debian.yaml b/linux/base-config-debian/base-config-debian.yaml index 8cdeafb..8ca2576 100644 --- a/linux/base-config-debian/base-config-debian.yaml +++ b/linux/base-config-debian/base-config-debian.yaml @@ -17,10 +17,10 @@ name: hardnening-config-root-user tags: hardnening-config-root_config - - name: "[BASE CONFIG] Configure debian os" + - name: "[COMMON BASE CONFIG] Configure debian os" import_role: - name: base-config-debian-os - tags: base-os_config + name: common-base-config-debian-os + tags: common-base-os_config - name: "[FAIL2BAN CONFIG] Install and configure fail2ban service" import_role: @@ -65,7 +65,7 @@ handlers: - base-config-debian-os - configure-fail2ban - nagios-nrpe - - server-type + #- server-type # Eliminada se aplica en common-base-config-debian - add-repos-vn - vim-options - configure-bashrc diff --git a/linux/base-config-debian/roles/base-config-debian-os/defaults/main.yaml b/linux/base-config-debian/roles/common-base-config-debian-os/defaults/main.yaml similarity index 100% rename from linux/base-config-debian/roles/base-config-debian-os/defaults/main.yaml rename to linux/base-config-debian/roles/common-base-config-debian-os/defaults/main.yaml diff --git a/linux/base-config-debian/roles/base-config-debian-os/files/nslcd.conf b/linux/base-config-debian/roles/common-base-config-debian-os/files/nslcd.conf similarity index 100% rename from linux/base-config-debian/roles/base-config-debian-os/files/nslcd.conf rename to linux/base-config-debian/roles/common-base-config-debian-os/files/nslcd.conf diff --git a/linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml b/linux/base-config-debian/roles/common-base-config-debian-os/handlers/main.yaml similarity index 100% rename from linux/base-config-debian/roles/base-config-debian-os/handlers/main.yaml rename to linux/base-config-debian/roles/common-base-config-debian-os/handlers/main.yaml diff --git a/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml b/linux/base-config-debian/roles/common-base-config-debian-os/tasks/main.yaml similarity index 88% rename from linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml rename to linux/base-config-debian/roles/common-base-config-debian-os/tasks/main.yaml index d87fde0..ffe45be 100644 --- a/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml +++ b/linux/base-config-debian/roles/common-base-config-debian-os/tasks/main.yaml @@ -207,14 +207,14 @@ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # configure sudo for sysadmin group -# add sysadmin group to sudoers +# paso1 - add sysadmin group to sudoers - name: Add sysadmin group to sudoers file: path: /etc/sudoers.d/vn state: touch mode: u=rw,g=r,o=r -# add a line to /etc/sudoers.d/vn file +# paso2 - add a line to /etc/sudoers.d/vn file - name: add a line to /etc/sudoers.d/vn file lineinfile: path: "/etc/sudoers.d/vn" @@ -222,7 +222,7 @@ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Proteger grub +# paso1 - Proteger grub - name: GRUB password boot protection blockinfile: path: /etc/grub.d/40_custom @@ -231,12 +231,33 @@ password_pbkdf2 {{ user_grub }} {{ code_grub }} register: grub_register #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# update grub +# paso2 - update grub - name: update grub config command: update-grub when: grub_register.changed #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure FAIL2BAN +# paso1 - Install guest-side qemu-system agent +- name: Install guest-side qemu-system agent + apt: + name: qemu-guest-agent + state: present + tags: install-qemu-guest +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# descargar http://apt.verdnatura.es/pool/main/v/vn-host/vn-host_2.0.2_all.deb e instalar (manualmente wget + dpkg -i package) +# paso0 - aƱadir clave gpg +# paso1 - Add specified repository into sources list +#- name: Add specified repository into sources list +# apt_repository: +# repo: deb http://apt.verdnatura.es/ bookworm main +# state: present +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# paso2 - Add source repository into sources list +#- name: Add source repository into sources list +# apt_repository: +# repo: deb-src http://apt.verdnatura.es/ bookworm main +# state: present #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/linux/base-config-debian/roles/base-config-debian-os/vars/main.yaml b/linux/base-config-debian/roles/common-base-config-debian-os/vars/main.yaml similarity index 100% rename from linux/base-config-debian/roles/base-config-debian-os/vars/main.yaml rename to linux/base-config-debian/roles/common-base-config-debian-os/vars/main.yaml