add grub config

This commit is contained in:
Ruben Blanco 2023-10-17 10:04:48 +02:00
parent 4e941b4d2f
commit 22502a615f
2 changed files with 29 additions and 2 deletions

View File

@ -1,5 +1,6 @@
---
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Reconfigure locales - enable en_US-UTF8 and es_ES-UTF8
- name: reconfigure locales enable en_US-UTF8 and es_ES-UTF8
debconf:
@ -7,7 +8,9 @@
question: locales/default_environment_locale
value: en_US-UTF8, es_ES-UTF8
vtype: multiselect
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Reconfigure timezone - Europe/Madrid
- name: reconfigure timezone Europe/Madrid
debconf:
@ -15,7 +18,9 @@
question: tzdata/Zones/Europe
value: Madrid
vtype: select
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# update packages
- name: update packages
apt:
@ -23,14 +28,18 @@
state: latest
update_cache: true
force_apt_get: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# upgrade packages
- name: upgrade packages
apt:
upgrade: dist
state: latest
force_apt_get: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# install packages
- name: install some packages (vim htop psmisc aptitude)
apt:
@ -43,7 +52,10 @@
- aptitude
- nslcd
- exim4
- fail2ban
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Reconfigure relayhost smtp to smtp.verdnatura.es
- name: reconfigure relayhost to smtp.verdnatura.es
lineinfile:
@ -80,6 +92,7 @@
- regexp: '^dc_localdelivery'
line: "dc_localdelivery='{{ dc_localdelivery }}'"
notify: restart exim4
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# DONT WORK :(
@ -114,7 +127,7 @@
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# DONT WORK :(
# NEEDS to INSTALL more MODULES with -> ansible-galaxy collection install community.general
#
# Send mail to verify relay-host
@ -130,6 +143,12 @@
# delegate_to: localhost
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Send mail to verify relay-host
- name: sending mail to verify exim4 config works
command: echo "test mail verify exim4 for the host '{{ dc_other_hostnames }}'.verdnatura.es" | mailx -s "test mail verify exim4" -v informatica@verdnatura.es
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# configure centralized authentication [nslcd]
# paso1 - Copy
@ -140,6 +159,12 @@
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Proteger grub
- name: GRUB se password boot protection
blockinfile:
path: /etc/grub.d/40_custom
block: |
set superusers="'{{ user_grub }}'"
password_pbkdf2 '{{ user_grub }}' '{{ code_grub }}'
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -1,3 +1,5 @@
---
exim_configuration_file: /etc/exim4/update-exim4.conf.conf
exim_daemon: exim4
exim_daemon: exim4
user_grub: admin
code_grub: grub.pbkdf2.sha512.10000.B8E094F92F596817E5C65F46E50B79A32D3E9D6F2E755CBB9599E1297123B7525AABEE1A37AD985907505658DD0D3367D1E531F31B8A7E711E24EFD6CCAC1226.BD1B81B61C65F57B9544DDBFA811C2AB37BFF994573568D2568BCAD685353AFAC34E4C8B24D524771FF5224A36EE94DB489777F7BC90CFDCF459C0DD28DD5EE4