main #31
|
@ -19,3 +19,14 @@ awx_pub_key: >
|
||||||
ssh-ed25519
|
ssh-ed25519
|
||||||
AAAAC3NzaC1lZDI1NTE5AAAAIKzAwWm+IsqZCgMzjdZ7Do3xWtVtoUCpWJpH7KSi2a/H
|
AAAAC3NzaC1lZDI1NTE5AAAAIKzAwWm+IsqZCgMzjdZ7Do3xWtVtoUCpWJpH7KSi2a/H
|
||||||
awx@verdnatura.es
|
awx@verdnatura.es
|
||||||
|
base_packages:
|
||||||
|
- htop
|
||||||
|
- psmisc
|
||||||
|
- bash-completion
|
||||||
|
- screen
|
||||||
|
- aptitude
|
||||||
|
- vim
|
||||||
|
- tree
|
||||||
|
- btop
|
||||||
|
- ncdu
|
||||||
|
- debconf-utils
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
service:
|
service:
|
||||||
name: systemd-timesyncd
|
name: systemd-timesyncd
|
||||||
state: restarted
|
state: restarted
|
||||||
- name: restart-exim
|
|
||||||
service:
|
|
||||||
name: exim4
|
|
||||||
state: restarted
|
|
||||||
- name: restart-ssh
|
- name: restart-ssh
|
||||||
service:
|
service:
|
||||||
name: ssh
|
name: ssh
|
||||||
|
@ -18,7 +14,9 @@
|
||||||
service:
|
service:
|
||||||
name: nagios-nrpe-server
|
name: nagios-nrpe-server
|
||||||
state: restarted
|
state: restarted
|
||||||
- name: Generate locales
|
- name: generate locales
|
||||||
command: /usr/sbin/locale-gen
|
command: /usr/sbin/locale-gen
|
||||||
- name: Reconfigure tzdata
|
- name: reconfigure tzdata
|
||||||
command: dpkg-reconfigure -f noninteractive tzdata
|
command: dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
- name: update exim configuration
|
||||||
|
command: update-exim4.conf
|
||||||
|
|
|
@ -2,15 +2,4 @@
|
||||||
apt:
|
apt:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
loop: "{{ base_packages }}"
|
||||||
- htop
|
|
||||||
- psmisc
|
|
||||||
- bash-completion
|
|
||||||
- screen
|
|
||||||
- aptitude
|
|
||||||
- vim
|
|
||||||
- aptitude
|
|
||||||
- tree
|
|
||||||
- btop
|
|
||||||
- ncdu
|
|
||||||
- debconf-utils
|
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
loop:
|
loop:
|
||||||
- { question: "locales/locales_to_be_generated", value: "en_US.UTF-8 UTF-8, es_ES.UTF-8 UTF-8", vtype: "multiselect" }
|
- { question: "locales/locales_to_be_generated", value: "en_US.UTF-8 UTF-8, es_ES.UTF-8 UTF-8", vtype: "multiselect" }
|
||||||
- { question: "locales/default_environment_locales", value: "en_US.UTF-8", vtype: "string" }
|
- { question: "locales/default_environment_locales", value: "en_US.UTF-8", vtype: "string" }
|
||||||
notify: Generate locales
|
notify: generate locales
|
||||||
|
|
|
@ -3,46 +3,25 @@
|
||||||
name: exim4
|
name: exim4
|
||||||
state: present
|
state: present
|
||||||
- name: Prepare exim configuration
|
- name: Prepare exim configuration
|
||||||
lineinfile:
|
blockinfile:
|
||||||
dest: /etc/exim4/update-exim4.conf.conf
|
path: /etc/exim4/update-exim4.conf.conf
|
||||||
regexp: "{{ item.regexp }}"
|
marker_begin: '--- BEGIN VN ---'
|
||||||
line: "{{ item.line }}"
|
marker_end: '--- END VN ---'
|
||||||
|
marker: "# {mark}"
|
||||||
|
block: |
|
||||||
|
dc_eximconfig_configtype='satellite'
|
||||||
|
dc_other_hostnames='{{ ansible_fqdn }}'
|
||||||
|
dc_local_interfaces='127.0.0.1'
|
||||||
|
dc_readhost='{{ ansible_fqdn }}'
|
||||||
|
dc_smarthost='{{ smtp_server }}'
|
||||||
|
dc_hide_mailname='true'
|
||||||
state: present
|
state: present
|
||||||
mode: 0644
|
create: yes
|
||||||
with_items:
|
mode: '0644'
|
||||||
- regexp: '^dc_eximconfig_configtype'
|
notify: update exim configuration
|
||||||
line: "dc_eximconfig_configtype='satellite'"
|
|
||||||
- regexp: '^dc_other_hostnames'
|
|
||||||
line: "dc_other_hostnames='{{ ansible_fqdn }}'"
|
|
||||||
- regexp: '^dc_local_interfaces'
|
|
||||||
line: "dc_local_interfaces='127.0.0.1'"
|
|
||||||
- regexp: '^dc_readhost'
|
|
||||||
line: "dc_readhost='{{ ansible_fqdn }}'"
|
|
||||||
- regexp: '^dc_relay_domains'
|
|
||||||
line: "dc_relay_domains=''"
|
|
||||||
- regexp: '^dc_minimaldns'
|
|
||||||
line: "dc_minimaldns='false'"
|
|
||||||
- regexp: '^dc_relay_nets'
|
|
||||||
line: "dc_relay_nets=''"
|
|
||||||
- regexp: '^dc_smarthost'
|
|
||||||
line: "dc_smarthost='{{ smtp_server }}'"
|
|
||||||
- regexp: '^CFILEMODE'
|
|
||||||
line: "CFILEMODE='644'"
|
|
||||||
- regexp: '^dc_use_split_config'
|
|
||||||
line: "dc_use_split_config='false'"
|
|
||||||
- regexp: '^dc_hide_mailname'
|
|
||||||
line: "dc_hide_mailname='true'"
|
|
||||||
- regexp: '^dc_mailname_in_oh'
|
|
||||||
line: "dc_mailname_in_oh='true'"
|
|
||||||
- regexp: '^dc_localdelivery'
|
|
||||||
line: "dc_localdelivery='mail_spool'"
|
|
||||||
notify: restart-exim
|
|
||||||
register: exim_config
|
register: exim_config
|
||||||
- name: Update exim configuration
|
|
||||||
command: update-exim4.conf
|
|
||||||
when: exim_config.changed
|
|
||||||
- name: Sending mail to verify relay host configuration works
|
- name: Sending mail to verify relay host configuration works
|
||||||
shell: >
|
shell: >
|
||||||
echo "If you see this message, relayhost on {{ ansible_fqdn }} has been configured correctly." \
|
echo "If you see this message, relayhost on {{ ansible_fqdn }} has been configured correctly." \
|
||||||
| mailx -s "Relayhost test for {{ ansible_fqdn }}" "{{ sysadmin_mail }}"
|
| mailx -s "Relayhost test for {{ ansible_fqdn }}" "{{ sysadmin_mail }}"
|
||||||
when: exim_config.changed
|
when: exim_config.changed
|
||||||
|
|
|
@ -8,4 +8,4 @@
|
||||||
- { question: "tzdata/Areas", value: "Europe" }
|
- { question: "tzdata/Areas", value: "Europe" }
|
||||||
- { question: "tzdata/Zones/Europe", value: "Madrid" }
|
- { question: "tzdata/Zones/Europe", value: "Madrid" }
|
||||||
- { question: "tzdata/Zones/Etc", value: "UTC" }
|
- { question: "tzdata/Zones/Etc", value: "UTC" }
|
||||||
notify: Reconfigure tzdata
|
notify: reconfigure tzdata
|
||||||
|
|
Loading…
Reference in New Issue