From acbded39e179ad8d2062b4479f9f0b4289000be7 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Tue, 21 Apr 2015 17:45:27 +0200 Subject: [PATCH] Gestisco meglio il riconoscimento di NethServer. --- roles/init/handlers/main.yml | 4 ++++ roles/init/tasks/configure-networks.yml | 10 ++-------- roles/init/tasks/main.yml | 8 ++++++-- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 roles/init/handlers/main.yml diff --git a/roles/init/handlers/main.yml b/roles/init/handlers/main.yml new file mode 100644 index 0000000..a572891 --- /dev/null +++ b/roles/init/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: interface update + shell: /sbin/e-smith/signal-event interface-update + sudo: yes diff --git a/roles/init/tasks/configure-networks.yml b/roles/init/tasks/configure-networks.yml index 156c41d..96ed901 100644 --- a/roles/init/tasks/configure-networks.yml +++ b/roles/init/tasks/configure-networks.yml @@ -1,13 +1,7 @@ --- -- name: Verifica di NethServer - shell: /sbin/e-smith/config getprop sysconfig ProductName - register: sysconfig_productname - - name: Configuro la scheda secondaria shell: /sbin/e-smith/db networks setprop eth1 bootproto none device eth1 ipaddr 10.0.0.1 netmask 255.255.255.0 onboot yes role green when: "'NethServer' in sysconfig_productname.stdout" register: eth1_enabled - -- name: Attivo la configurazione - shell: signal-event interface-update - when: eth1_enabled|success + notify: + - interface update diff --git a/roles/init/tasks/main.yml b/roles/init/tasks/main.yml index ec391c2..da356f7 100644 --- a/roles/init/tasks/main.yml +++ b/roles/init/tasks/main.yml @@ -1,8 +1,12 @@ --- +- name: Verifica di NethServer + shell: /sbin/e-smith/config getprop sysconfig ProductName + register: sysconfig_productname + changed_when: "'NethServer' in sysconfig_productname.stdout" + ignore_errors: yes -# solo se รจ virtualbox, procedo a configurare la seconda scheda di rete - include: configure-networks.yml - when: ansible_bios_version == "VirtualBox" + when: sysconfig_productname|changed - include: selinux-binding.yml