add controlled option to the alterator-net

This commit is contained in:
Sergey Bubnov 2018-11-07 12:56:34 +04:00
parent b7cffc4a37
commit 45e6733f42

View File

@ -1,6 +1,6 @@
---
- name: "{{nic.key}} | set default route"
shell: egrep -q "^default via {{item|ipaddr('address')}}$" /etc/net/ifaces/"{{nic.key}}"/ipv4route || { alterator-cmdline -d /net-eth action write name "{{nic.key}}" ipv 4 configuration "static" default "{{item|ipaddr('address')}}" ipv_enabled "#t"; echo default_changed; }
shell: egrep -q "^default via {{item|ipaddr('address')}}$" /etc/net/ifaces/"{{nic.key}}"/ipv4route || { alterator-cmdline -d /net-eth action write name "{{nic.key}}" ipv 4 configuration "static" default "{{item|ipaddr('address')}}" ipv_enabled "#t" controlled etcnet onboot '#t'; echo default_changed; }
register: result
changed_when: '"default_changed" in result.stdout'
notify: restart network