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
|
|
|
|
|
|
2016-03-14 02:00:12 +01:00
|
|
|
|
# Trusted networks: LAN
|
|
|
|
|
|
|
|
|
|
- name: Check for LAN to be added as Trusted Network
|
|
|
|
|
shell: /sbin/e-smith/db networks printprop {{ ansible_local.domain.servernet }} Description
|
|
|
|
|
register: check_trusted
|
|
|
|
|
changed_when: '"Description=Local LAN" not in check_trusted.stdout'
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
tags: trustednet
|
|
|
|
|
|
|
|
|
|
- name: Configuring trusted networks
|
|
|
|
|
shell: /sbin/e-smith/db networks set {{ ansible_local.domain.servernet }} network Description "Local LAN" Mask {{ ansible_local.domain.servernetmask }}
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: check_trusted is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
tags: trustednet
|
|
|
|
|
|
|
|
|
|
- name: Activating trusted network
|
|
|
|
|
shell: /sbin/e-smith/signal-event trusted-networks-modify
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: check_trusted is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
tags: trustednet
|
|
|
|
|
|
2016-03-15 19:42:01 +01:00
|
|
|
|
# Preconfiguring DNS anyways
|
|
|
|
|
|
|
|
|
|
- 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 }}
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: chk_dns is changed
|
2016-03-15 19:42:01 +01:00
|
|
|
|
tags: dns-preset
|
|
|
|
|
|
|
|
|
|
- name: Activating correct DNS resolution
|
|
|
|
|
shell: "/sbin/e-smith/signal-event nethserver-base-update"
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: chk_dns is changed
|
2016-03-15 19:42:01 +01:00
|
|
|
|
|
2016-03-14 02:00:12 +01:00
|
|
|
|
# Hostname and domainname
|
|
|
|
|
|
|
|
|
|
- name: Configuring hostname
|
|
|
|
|
shell: /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
|
|
|
|
|
register: chg_hostname
|
|
|
|
|
when: "'{{ ansible_hostname }}' != '{{ ansible_local.domain.server }}'"
|
|
|
|
|
tags: hostname
|
|
|
|
|
|
|
|
|
|
- name: Configuring domain name
|
|
|
|
|
shell: /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
|
|
|
|
|
register: chg_domainname
|
|
|
|
|
when: "'{{ ansible_domain }}' != '{{ ansible_local.domain.domainfull }}'"
|
|
|
|
|
tags: domainname
|
|
|
|
|
|
|
|
|
|
- name: Activating hostname/domainname changes
|
|
|
|
|
shell: /sbin/e-smith/signal-event hostname-modify
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: chg_hostname is changed or chg_domainname is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
tags:
|
|
|
|
|
- hostname
|
|
|
|
|
- domainname
|
|
|
|
|
|
|
|
|
|
# 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
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: chk_crt is changed or force_regen_ca|bool
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
|
|
- name: Activating CA and regenerate
|
|
|
|
|
shell: /sbin/e-smith/signal-event certificate-update
|
2019-11-18 23:19:31 +01:00
|
|
|
|
when: chk_crt is changed or force_regen_ca|bool
|
2016-03-14 02:00:12 +01:00
|
|
|
|
tags: regen-ca
|