vn-ansible/linux/base-config-debian/roles/base-config-debian-os/tasks/main.yaml

80 lines
1.8 KiB
YAML
Raw Normal View History

2023-10-13 11:24:56 +00:00
---
# change hostname
- name: change hostname
hostname:
name: "{{ hostname_name }}"
2023-10-13 11:26:22 +00:00
tags: set-hostname
2023-10-13 11:24:56 +00:00
# Reconfigure locales - enable en_US-UTF8 and es_ES-UTF8
- name: reconfigure locales enable en_US-UTF8 and es_ES-UTF8
debconf:
name: locales
question: locales/default_environment_locale
value: en_US-UTF8, es_ES-UTF8
vtype: multiselect
# Reconfigure timezone - Europe/Madrid
- name: reconfigure timezone Europe/Madrid
2023-10-13 11:45:50 +00:00
debconf:
name: tzdata
question: tzdata/Zones/Europe
value: Madrid
vtype: select
2023-10-13 11:24:56 +00:00
# update packages
- name: update packages
apt:
name: "*"
state: latest
2023-10-16 05:40:25 +00:00
update_cache: true
force_apt_get: true
2023-10-13 11:24:56 +00:00
# upgrade packages
- name: upgrade packages
apt:
upgrade: dist
state: latest
2023-10-16 05:40:25 +00:00
force_apt_get: true
2023-10-13 11:24:56 +00:00
2023-10-13 12:49:11 +00:00
# install packages
- name: install some packages (vim htop psmisc aptitude)
2023-10-13 11:24:56 +00:00
apt:
2023-10-13 12:49:11 +00:00
name: "{{ item }}"
2023-10-13 11:24:56 +00:00
state: present
2023-10-13 12:49:11 +00:00
with_items:
- vim
- htop
- psmisc
- aptitude
- nslcd
- exim4
2023-10-13 11:24:56 +00:00
# Reconfigure relayhost smtp to smtp.verdnatura.es
- name: reconfigure relayhost to smtp.verdnatura.es
debconf:
name: exim4-config
2023-10-13 12:49:11 +00:00
question: "{{ item.name }}"
value: "{{ item.value }}"
vtype: string
loop:
- name: exim4/dc_smarthost
value: smtp.verdnatura.es
- name: exim4/dc_local_interfaces
value: ""
- name: exim4/dc_minimaldns
value: 'false'
- name: exim4/dc_readhost
value: "{{ dc_readhost }}" # var to define survey(encuesta)
- name: exim4/dc_other_hostnames
value: ""
- name: exim4/dc_eximconfig_configtype
value: "mail sent by smarthost; no local mail"
- name: exim4/mailname
value: "{{ mailname }}" # var to define survey(encuesta)
- name: exim4/use_split_config
value: 'false'
notify: Restart exim4 service
# configure centralized authentication