2015-06-15 03:32:57 +02:00
|
|
|
---
|
|
|
|
# Installa e configura il servizio per rinominare il client
|
|
|
|
# Grazie per il servizio a Enrico Bacis
|
|
|
|
|
|
|
|
- name: Installazione dipendenze Python
|
2015-06-16 00:45:27 +02:00
|
|
|
yum: pkg=python-bottle state=present
|
2015-06-15 03:32:57 +02:00
|
|
|
sudo: yes
|
|
|
|
|
2015-06-20 04:32:22 +02:00
|
|
|
- name: Check installazione + versione mac2hostname
|
|
|
|
shell: rpm -q mac2hostname
|
|
|
|
ignore_errors: yes
|
|
|
|
register: check_mac2hostname_pkg
|
|
|
|
changed_when: check_mac2hostname_pkg.rc != 0 or check_mac2hostname_pkg.stdout.find('2.0.0-1') == -1
|
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Installazione mac2hostname
|
2015-06-20 04:32:22 +02:00
|
|
|
yum: pkg=http://syntaxerrormmm.zapto.org/downloads/rpm/mac2hostname-2.0.0-1.el6.noarch.rpm state=present
|
|
|
|
when: check_mac2hostname_pkg|changed
|
2015-06-15 03:32:57 +02:00
|
|
|
sudo: yes
|
|
|
|
|
2015-06-17 14:45:30 +02:00
|
|
|
- name: Verifica aggiunta servizi
|
|
|
|
shell: /sbin/e-smith/db configuration show mac2hostname
|
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
register: chk_mac2hostname_srv
|
|
|
|
changed_when: chk_mac2hostname_srv.rc != 0
|
2015-06-17 18:10:57 +02:00
|
|
|
ignore_errors: yes
|
2015-06-17 14:45:30 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Aggiungo il servizio ai servizi gestiti da NethServer
|
|
|
|
shell: /sbin/e-smith/db configuration set mac2hostname service status enabled TCPPort 3000 access private
|
2015-06-15 03:32:57 +02:00
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-15 03:32:57 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Default per NetServer - Cartella defaults
|
|
|
|
shell: mkdir -p /etc/e-smith/db/configuration/defaults/mac2hostname
|
2015-06-15 03:32:57 +02:00
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-16 00:39:40 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Default per NethServer - Tipo
|
|
|
|
shell: echo "service" > /etc/e-smith/db/configuration/defaults/mac2hostname/type
|
2015-06-16 00:39:40 +02:00
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-16 00:39:40 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Default per NethServer - Stato
|
|
|
|
shell: echo "enabled" > /etc/e-smith/db/configuration/defaults/mac2hostname/status
|
2015-06-16 00:39:40 +02:00
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-16 00:39:40 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Aggiunta servizio
|
|
|
|
shell: /sbin/e-smith/signal-event runlevel-adjust
|
2015-06-16 00:39:40 +02:00
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-16 00:39:40 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Aggiunta servizio di rete e cambio firewall
|
2015-06-16 00:39:40 +02:00
|
|
|
shell: /sbin/e-smith/signal-event firewall-adjust
|
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|
2015-06-16 00:39:40 +02:00
|
|
|
|
2015-06-17 03:30:40 +02:00
|
|
|
- name: Avvio di mac2hostname
|
|
|
|
shell: service mac2hostname start
|
|
|
|
sudo: yes
|
2015-06-20 04:32:22 +02:00
|
|
|
when: chk_mac2hostname_srv|changed
|