locationlabs.el-network
el-network
用于管理企业Linux上网络接口的Ansible角色。
要求
- netaddr
注意:此角色不与firewalld兼容。
角色变量
el_network_interfaces
:接口列表iface
:接口名称- 常见接口选项:
ip4
:以CIDR表示法的IPv4地址gw4
:默认网关bridge
:该接口所属的桥接接口名称
type
:接口类型- ethernet
dhcp
:启用dhcpvlan
:启用vlan支持
- bond-slave
master
:父bond接口名称
- bond
bonding_mode
:默认值4 - 802.3adlacp_rate
:默认值1 - 快速xmit_hash_policy
:默认值 layer3+4miimon
:默认值100
- bridge
- ethernet
el_network_whitelist_ifaces
:不被移除的白名单接口列表。通常为lo和idrac。el_network_configured_ifaces
:自动生成的变量,列出目标主机上要配置的接口。
依赖
无
示例剧本
示例变量设置:
el_network_interfaces:
- iface: ens32
type: ethernet
ip4: '192.168.0.10/24'
- iface: ens33
type: bond-slave
master: bond0
- iface: bond0
type: bond
bonding_mode: 4
bridge: br0
- iface: bond0.10
type: ethernet
vlan: yes
- iface: br0
type: bridge
ip4: '10.0.0.10/24'
gw4: '10.0.0.1'
然后简单地运行该角色:
- hosts: servers
roles:
- el-network
OVS
简单的OVS支持可以将接口和/或桥接集成到OVS中。注意:此角色不安装OVS,由管理员负责安装。
el_network_interfaces:
- iface: ens33
type: ethernet
bridge: br-ex
ovs: yes
- iface: br-ex
type: bridge
ovs: yes
ip4: '172.16.0.10/24'
安装
ansible-galaxy install locationlabs.el-network
许可证
apache-2.0
下载
240