Skip to content

Allow interfaces to be configured it ways other than with DHCP. #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions bsdploy/roles/jails_host/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions bsdploy/roles/jails_host/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions bsdploy/tests/test_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down