Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: control
- become: yes
- gather_facts: no
- tasks:
- - name: Remove existing default gateway configuration
- lineinfile:
- path: /etc/sysconfig/network-scripts/ifcfg-bond0.230
- state: absent
- regexp: "{{ item }}"
- loop:
- - '^DEFROUTE.*'
- - '^GATEWAY.*'
- - name: Create sub-interface for external networking
- blockinfile:
- path: /etc/sysconfig/network-scripts/ifcfg-bond0.220
- create: yes
- state: present
- block: |
- NAME=bond0.220
- DEVICE=bond0.220
- TYPE=Ethernet
- BOOTPROTO=none
- ONBOOT=yes
- VLAN=yes
- IPADDR={{ external_ip }}
- PREFIX=27
- GATEWAY={{ external_gw }}
- DEFROUTE=yes
- DNS1=8.8.8.8
- DNS2=8.8.4.4
- NM_CONTROLLED=no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement