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