2016-03-14 02:00:12 +01:00
|
|
|
|
---
|
|
|
|
|
# Base configurations to be implemented anyways.
|
|
|
|
|
|
2016-07-10 05:07:44 +02:00
|
|
|
|
# installing italian interface translation
|
|
|
|
|
|
|
|
|
|
- name: Making available also Italian NethGUI
|
|
|
|
|
yum:
|
|
|
|
|
pkg: nethserver-lang-it
|
|
|
|
|
state: present
|
|
|
|
|
tags: nethgui
|
|
|
|
|
|
2018-11-11 05:26:19 +01:00
|
|
|
|
# Hostname stuff
|
|
|
|
|
- name: Changing effectively hostname
|
|
|
|
|
shell: /usr/bin/hostnamectl set-hostname {{ ansible_local.domain.serverfqdn }} --static
|
|
|
|
|
register: hostnamechg
|
|
|
|
|
when: "'{{ ansible_hostname }}' != '{{ ansible_local.domain.server }}'"
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
2018-11-11 05:26:19 +01:00
|
|
|
|
- name: Configuring hostname
|
|
|
|
|
shell: /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
|
|
|
|
|
when: hostnamechg|changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
2018-11-11 05:26:19 +01:00
|
|
|
|
- name: Configuring domain name
|
|
|
|
|
shell: /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
|
|
|
|
|
when: hostnamechg|changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
2018-11-11 05:26:19 +01:00
|
|
|
|
- name: Activating hostname/domainname changes
|
|
|
|
|
shell: /sbin/e-smith/signal-event hostname-modify
|
|
|
|
|
when: hostnamechg|changed
|
2016-03-15 19:42:01 +01:00
|
|
|
|
|
2018-11-11 05:26:19 +01:00
|
|
|
|
# DNS configuration
|
2016-03-15 19:42:01 +01:00
|
|
|
|
- name: Checking DNS configuration
|
|
|
|
|
shell: /sbin/e-smith/db configuration printprop dns NameServers
|
|
|
|
|
register: chk_dns
|
2016-06-03 12:09:05 +02:00
|
|
|
|
changed_when: "'NameServers={{ ansible_local.domain.extdnsserver1 }}' not in chk_dns.stdout"
|
2016-03-15 19:42:01 +01:00
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
- name: Configuring DNS resolution
|
|
|
|
|
shell: /sbin/e-smith/db configuration setprop dns NameServers {{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}
|
|
|
|
|
when: chk_dns|changed
|
|
|
|
|
tags: dns-preset
|
|
|
|
|
|
|
|
|
|
- name: Activating correct DNS resolution
|
|
|
|
|
shell: "/sbin/e-smith/signal-event nethserver-base-update"
|
|
|
|
|
when: chk_dns|changed
|
|
|
|
|
|
2016-03-14 02:00:12 +01:00
|
|
|
|
# Base certificate
|
|
|
|
|
- name: Checking CA configuration
|
|
|
|
|
shell: /sbin/e-smith/db configuration printprop pki CommonName
|
|
|
|
|
ignore_errors: true
|
|
|
|
|
register: chk_crt
|
|
|
|
|
changed_when: "'CommonName={{ ansible_local.domain.serverfqdn }}' not in chk_crt.stdout"
|
|
|
|
|
tags: regen-ca
|
|
|
|
|
|
|
|
|
|
- name: Configuring CA
|
|
|
|
|
shell: /sbin/e-smith/db configuration setprop pki CertificateDuration 3650 CommonName {{ ansible_local.domain.serverfqdn }} CountryCode {{ ansible_local.domain.org_countrycode }} EmailAddress {{ ansible_local.domain.org_email }} Locality "{{ ansible_local.domain.org_city }}" Organization "{{ ansible_local.domain.org_company }}"
|
|
|
|
|
tags: regen-ca
|
|
|
|
|
when: chk_crt|changed or force_regen_ca|bool
|
|
|
|
|
|
|
|
|
|
- name: Activating CA and regenerate
|
|
|
|
|
shell: /sbin/e-smith/signal-event certificate-update
|
|
|
|
|
when: chk_crt|changed or force_regen_ca|bool
|
|
|
|
|
tags: regen-ca
|
2018-11-11 05:26:19 +01:00
|
|
|
|
|
|
|
|
|
- name: Disabling first time wizard
|
|
|
|
|
shell: /sbin/e-smith/db configuration setprop httpd-admin ForcedLoginModule ""
|
|
|
|
|
notify: restart httpd-admin
|