add network configuration
This commit is contained in:
parent
c306d0002f
commit
4c98b913c2
9
epc.yml
9
epc.yml
|
@ -5,6 +5,15 @@
|
|||
roles:
|
||||
- name: common
|
||||
- name: authorized_keys
|
||||
- name: network
|
||||
net_interface: eth1
|
||||
net_ips:
|
||||
- 10.74.0.21/24
|
||||
- 10.74.0.22/24
|
||||
- 10.74.0.23/24
|
||||
- 10.74.0.24/24
|
||||
net_method: networkd
|
||||
|
||||
- name: epc
|
||||
epc_hss_bind_ip: 10.74.0.21
|
||||
epc_pcrf_bind_ip: 10.74.0.22
|
||||
|
|
8
epdg.yml
8
epdg.yml
|
@ -5,6 +5,14 @@
|
|||
roles:
|
||||
- name: common
|
||||
- name: authorized_keys
|
||||
- name: network
|
||||
net_interface: enp7s0
|
||||
net_ips:
|
||||
- 10.74.0.11/24
|
||||
- 10.74.0.12/24
|
||||
- 10.74.0.13/24
|
||||
net_method: ifupdown
|
||||
|
||||
- name: epdg
|
||||
epdg_ipsec_bind_ip: 213.95.46.81
|
||||
epdg_swx_hss_ip: 10.74.0.21
|
||||
|
|
8
ims.yml
8
ims.yml
|
@ -13,7 +13,15 @@
|
|||
- "hss.mnc070.mcc999.3gppnetwork.org 10.74.0.21"
|
||||
# TODO: add network configuration
|
||||
roles:
|
||||
- name: common
|
||||
- name: authorized_keys
|
||||
- name: network
|
||||
net_interface: eth1
|
||||
net_ips:
|
||||
- 10.74.0.31/24
|
||||
- 10.74.0.32/24
|
||||
- 10.74.0.33/24
|
||||
net_method: ifupdown
|
||||
|
||||
- name: ims
|
||||
ims_mcc: "901"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: ifup -a
|
||||
command: ifup -a
|
||||
|
||||
- name: reload networkd
|
||||
service:
|
||||
name: systemd-networkd
|
||||
state: reloaded
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
|
||||
- name: ensure interfaces.d exists
|
||||
file:
|
||||
path: /etc/network/interfaces.d
|
||||
state: directory
|
||||
|
||||
- name: configure network interface
|
||||
template:
|
||||
src: ifupdown.j2
|
||||
dest: /etc/network/interfaces.d/ansible.conf
|
||||
notify: ifup -a
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: use network configuration ifupdown
|
||||
ansible.builtin.include_tasks: "ifupdown.yml"
|
||||
when: net_method == "ifupdown"
|
||||
|
||||
- name: use network configuration systemd-networkd
|
||||
ansible.builtin.include_tasks: "networkd.yml"
|
||||
when: net_method == "networkd"
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
|
||||
- name: configure networkd
|
||||
template:
|
||||
src: networkd.network.j2
|
||||
dest: /etc/systemd/network/ansible.network
|
||||
notify: reload networkd
|
|
@ -0,0 +1,8 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
{% for ip in net_ips %}
|
||||
auto {{ net_interface }}:{{ loop.index }}
|
||||
iface {{ net_interface }}:{{ loop.index }} inet static
|
||||
address {{ ip }}
|
||||
|
||||
{% endfor %}
|
|
@ -0,0 +1,9 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
[Match]
|
||||
Name={{ net_interface }}
|
||||
|
||||
[Network]
|
||||
{% for ip in net_ips %}
|
||||
Address={{ ip }}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue