Skip to content
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 .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vars/main.yml
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# defaults file for bonding

# Set to true if using NetworkManager
network_manager: false

# Set to true to apply to sysconfig files
apply: false

Expand Down
3 changes: 3 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

- name: restart network
service: name=network state=restarted

- name: restart networkmanager
service: name=NetworkManager state=restarted
1 change: 1 addition & 0 deletions meta/.galaxy_install_info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{install_date: 'Thu May 12 08:46:44 2016', version: master}
33 changes: 33 additions & 0 deletions tasks/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@
- el
- bond


- name: Create the slave interfaces configuration files
template: src=el_ifcfg-slaves.j2 dest="{{ el_network_sysconfig }}/ifcfg-{{ item }}" backup=yes
with_items:
- "{{ slaves }}"
when:
- apply
- network_manager
tags:
- el
- bond
- network_manager

- name: Create the bonding iface
template: src=el_ifcfg-bond.j2 dest="{{ el_network_sysconfig }}/ifcfg-{{ item }}"
with_items:
- "{{ bond }}"
when:
- apply
- ("{{ slaves| length }}" >=2)
- network_manager
notify: restart NetworkManager
tags:
- el
- bond
- network_manager

- name: Apply settings NOW
service: name=NetworkManager state=restarted
when:
- apply_now
- network_manager

- name: Apply settings NOW
service: name=network state=restarted
when:
Expand Down
4 changes: 4 additions & 0 deletions templates/el_ifcfg-bond.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ DEVICE="{{ item }}"
BONDING_OPTS="{%for bond_option in bond_options %}{{ bond_option.key }}={{ bond_option.value}} {%endfor%}"
MTU="{{ mtu }}"
NOZEROCONF=yes
{%if network_manager %}
TYPE=bond
BONDING_MASTER=yes
{% endif %}

{%if enable_ipv4 %}
{% if ip_addr and netmask %}
Expand Down