forked from LibreSchool/server-config
67 lines
2.4 KiB
YAML
67 lines
2.4 KiB
YAML
---
|
||
# Base configurations to be implemented anyways.
|
||
|
||
# installing italian interface translation
|
||
|
||
- name: Making available also Italian NethGUI
|
||
yum:
|
||
pkg: nethserver-lang-it
|
||
state: present
|
||
tags: nethgui
|
||
|
||
# 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 }}'"
|
||
|
||
- name: Configuring hostname
|
||
shell: /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
|
||
when: hostnamechg|changed
|
||
|
||
- name: Configuring domain name
|
||
shell: /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
|
||
when: hostnamechg|changed
|
||
|
||
- name: Activating hostname/domainname changes
|
||
shell: /sbin/e-smith/signal-event hostname-modify
|
||
when: hostnamechg|changed
|
||
|
||
# DNS configuration
|
||
- name: Checking DNS configuration
|
||
shell: /sbin/e-smith/db configuration printprop dns NameServers
|
||
register: chk_dns
|
||
changed_when: "'NameServers={{ ansible_local.domain.extdnsserver1 }}' not in chk_dns.stdout"
|
||
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
|
||
|
||
# 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
|
||
|
||
- name: Disabling first time wizard
|
||
shell: /sbin/e-smith/db configuration setprop httpd-admin ForcedLoginModule ""
|
||
notify: restart httpd-admin
|