diff --git a/CHANGES.rst b/CHANGES.rst index 70814de..6332831 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,7 @@ - [feature] files copied during bootstrap can be encrypted using the ``ploy vault`` commands. This is useful for the private ssh host keys in ``bootstrap-files``. - [fix] fixed setting of virtualbox defaults, so they can be properly overwritten - [feature] added new variables: ploy_jail_host_cloned_interfaces/ploy_jail_host_default_jail_interface to give more flexiblity around network interface setup +- [feature] added new variable: ploy_jail_host_interface_config to allow interfaces to be arbitrarily configured with ifconfig 2.0.0 - 2015-03-05 diff --git a/bsdploy/roles/jails_host/defaults/main.yml b/bsdploy/roles/jails_host/defaults/main.yml index aad1926..510abb7 100644 --- a/bsdploy/roles/jails_host/defaults/main.yml +++ b/bsdploy/roles/jails_host/defaults/main.yml @@ -27,3 +27,7 @@ ploy_root_user_name: "{{ploy_user | default('root')}}" ploy_root_home_path: "{{ '/' if ploy_root_user_name == 'root' else '/usr/home/' }}{{ploy_root_user_name}}" ploy_jail_host_cloned_interfaces: lo1 ploy_jail_host_default_jail_interface: lo1 +ploy_jail_host_interface_config: [] +#ploy_jail_host_interface_config: +# - interface: em0 +# config: inet 192.168.1.2/24 diff --git a/bsdploy/roles/jails_host/tasks/main.yml b/bsdploy/roles/jails_host/tasks/main.yml index c7b3a18..21b4aca 100644 --- a/bsdploy/roles/jails_host/tasks/main.yml +++ b/bsdploy/roles/jails_host/tasks/main.yml @@ -16,6 +16,13 @@ value: "{{ ploy_jail_host_cloned_interfaces }}" notify: restart network +- name: Configure interfaces + sysrc: + name: ifconfig_{{ item.interface }} + value: "{{ item.config }}" + with_items: ploy_jail_host_interface_config + notify: restart network + - meta: flush_handlers # The sysctl module in ansible adds spaces around the equal sign in diff --git a/bsdploy/tests/test_roles.py b/bsdploy/tests/test_roles.py index b40acdb..6753289 100644 --- a/bsdploy/tests/test_roles.py +++ b/bsdploy/tests/test_roles.py @@ -68,6 +68,7 @@ def test_roles(ctrl, monkeypatch): 'Reload pf.conf', 'Enable gateway in rc.conf', 'Setup cloned interfaces', + 'Configure interfaces', 'Enable security.jail.allow_raw_sockets', 'Enable security.jail.sysvipc_allowed', 'Ensure helper packages are installed',