Giter Site home page Giter Site logo

ansible-role-linux-netconf's Introduction

Global variables:

# Auto re-configure interface when changed (by default: false), also see 'configure' parameter on interface
enable_interfaces: false | true

----------------------------------
interfaces:
  # static ip
  - name: enp4s0f0
    dev: enp4s0f0
    # Restart interface if configuration changed
    configure: true
    onboot: 'yes'
    mac: 6c:f0:49:0b:fa:15

    # IPv4 settings
    method: 'static'
    ipaddr: 192.168.0.251
    # netmask with prefix
    prefix: 24
    # or
    #netmask: 255.255.255.0
    gateway: 192.168.0.1
    # Set this interface as the default route
    #defroute: true
    # Overwrite resolv.conf
    #peerdns: 'yes'
    dns:
      - 192.168.0.140
      - 192.168.0.141
      - 192.168.0.142
    search:
      - test.int
      - dev.test.int

  # dhcp ip
  - name: enp4s0f1
    dev: enp4s0f1
    # Restart interface if configuration changed  
    configure: true
    onboot: 'yes'
    mac: 6c:f0:49:0b:fa:16
    # IPv4 settings
    # netmask with prefix
    prefix: 24

    method: 'dhcp'
    #defroute: true

------------
IP aliases

alias_interfaces:
  # alias
  - name: enp4s0f1:0
    # Restart interface if configuration changed  
    configure: true
    onboot: 'yes'
    # IPv4 settings
    method: 'static'
    ipaddr: 192.168.0.143
    # netmask with prefix
    prefix: 24


Another variant

interfaces:
  .. 
  # interface with multiply IP (additional variant for ip aliases)
  - name: enp4s0f1
    # Restart interface if configuration changed
    configure: true
    onboot: 'yes'
    # IPv4 settings
    method: 'static'
    ipaddr: 192.168.0.140
    prefix: 24
    gateway: 192.168.0.1
    ip:
      - ipaddr: 192.168.0.143
        prefix: 24


Static routes
    ..
    routes:
      - to: 192.168.249.0/24
      - to: 192.168.250.0/24
        gw: 192.168.0.2


Additional settings
    ethtool: 'speed 1000 duplex full autoneg off'
    mtu: 9000

    # Auto re-configure interface when changed (by default: false)
    configure: true

    # Change MAC address on interface (don't use with mac)
    cloned_mac: <MACADDR>

----------------------------------
Bonding

interfaces:
  - name: eno1
    dev: eno1
    configure: true
    onboot: 'yes'
    mac: 6c:f0:49:0b:fa:15

  - name: eno2
    dev: eno2
    configure: true
    onboot: 'yes'
    mac: 6c:f0:49:0b:fa:16

bond_interfaces:
  - name: bond0
    dev: bond0
    # Restart interface if configuration changed  
    configure: true
    onboot: 'yes' 
    type: 'Bond'
    slaves:
      - "eno1"
      - "eno2"
    parameters:
      - { param: 'mode', val: 'active-backup' }
      - { param: 'arp_interval', val: '200' }
      - { param: 'arp_ip_target', val: '{{ lan_arp_ip_target }}' }

-----------------------------------
VLAN

vlan_interfaces:
  - name: bond1.252
    dev: bond1
    vlan: 252
    configure: true
    onboot: 'yes'
    method: 'static'
    ipaddr: 192.168.252.240
    prefix: 24

-----------------------------------
Bridge

bridge_interfaces:
  - name: br0
    dev: br0
    type: 'Bridge'
    #stp: 'off'
    ports:
      - 'bond0'
    method: 'static'
    zone: 'public'
    ipaddr: 192.168.0.142
    prefix: 24
    gateway: 192.168.0.1
    ip:
      - ipaddr: 192.168.0.143
        prefix: 24

-----------------------------------
Remove interface

removed_interface:
  - bond0:0
  - bond0:2

ansible-role-linux-netconf's People

Contributors

msaf1980 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.