Problem creating brigde network using nmcli.

7 views
Skip to first unread message

Anthony P V

unread,
Apr 9, 2017, 11:55:54 PM4/9/17
to Ansible Project
Hi,

I am trying to create a bridge network on centos 7. Unfortunately it does not work with my playbook. What am I doing wrong?

Using Fedora 25 with Ansible 2.2.1.0 to change network settings on Centos 7 64bit.

This is what I did.

What am I missing?

----------- start -------------------------
---
- hosts: test
  user: root

  tasks:
    - name: yum upgrade all packages.
      yum: name=* state=latest

    - name: install needed network manager libs
      yum:
        name: '{{ item }}'
        state: installed

      with_items:
        - NetworkManager-glib
        - nm-connection-editor
        - libsemanage-python
        - policycoreutils-python
        - bridge-utils

    - name: setup network bridge
      nmcli:
        conn_name: br0
        ifname: br0
        type: bridge
        ip4: 10.0.0.42/24
        gw4: 10.0.0.1
        state: present

    - name: setup ethernet interface
      nmcli:
        conn_name: eth0

        ifname: eth0
        master: br0
        state: present
----------- end --------------------------
Reply all
Reply to author
Forward
0 new messages