<commit_before>---
- hosts: switch_vbng
  sudo: yes
  vars:
    controller_ip: "{{ hostvars['onos_vbng']['ansible_ssh_host'] }}"
    controller_port: 6653
  tags:
  - vbng
  tasks:
  - name: Fix /etc/hosts
    lineinfile:
      dest=/etc/hosts
      regexp="127.0.0.1 localhost"
      line="127.0.0.1 localhost {{ ansible_hostname }}"

  - name: Install packages
    apt: name={{ item }}
      state=latest
      update_cache=yes
    with_items:
    - openvswitch-switch
    - python-netifaces

  - name: Create br-vbng
    openvswitch_bridge:
      bridge=br-vbng
      state=present

  - name: Find wan_network interface
    script: scripts/if_from_ip.py {{ wan_ip }}
    register: wan_net

  - name: Find public_network interface
    script: scripts/if_from_ip.py {{ public_ip }}
    register: public_net

  - name: Hook up wan-network to br-vbng
    openvswitch_port:
      bridge=br-vbng
      port={{ wan_net.stdout }}
      state=present

  - name: Hook up public-network to OvS
    openvswitch_port:
      bridge=br-vbng
      port={{ public_net.stdout }}
      state=present

  - name: Add controller to switch
    command: /usr/bin/ovs-vsctl set-controller br-vbng tcp:{{ controller_ip }}:{{ controller_port }}

- hosts: switch_volt
  sudo: yes
  vars:
    controller_ip: "{{ hostvars['onos_volt']['ansible_ssh_host'] }}"
    controller_port: 6653
  tags:
  - volt
  tasks:

  - name: Fix /etc/hosts
    lineinfile:
      dest=/etc/hosts
      regexp="127.0.0.1 localhost"
      line="127.0.0.1 localhost {{ ansible_hostname }}"

  - name: Install packages
    apt: name={{ item }} state=present update_cache=yes
    with_items:
    - git
    - python-netifaces

  - name: Checkout the Mininet repo<commit_msg>Set dpId for the OvS bridge<commit_after>---
- hosts: switch_vbng
  sudo: yes
  vars:
    controller_ip: "{{ hostvars['onos_vbng']['ansible_ssh_host'] }}"
    controller_port: 6653
    ovs_dpid: 0000000000000001
  tags:
  - vbng
  tasks:
  - name: Fix /etc/hosts
    lineinfile:
      dest=/etc/hosts
      regexp="127.0.0.1 localhost"
      line="127.0.0.1 localhost {{ ansible_hostname }}"

  - name: Install packages
    apt: name={{ item }}
      state=latest
      update_cache=yes
    with_items:
    - openvswitch-switch
    - python-netifaces

  - name: Create br-vbng
    openvswitch_bridge:
      bridge=br-vbng
      state=present

  - name: Find wan_network interface
    script: scripts/if_from_ip.py {{ wan_ip }}
    register: wan_net

  - name: Find public_network interface
    script: scripts/if_from_ip.py {{ public_ip }}
    register: public_net

  - name: Hook up wan-network to br-vbng
    openvswitch_port:
      bridge=br-vbng
      port={{ wan_net.stdout }}
      state=present

  - name: Hook up public-network to OvS
    openvswitch_port:
      bridge=br-vbng
      port={{ public_net.stdout }}
      state=present

  - name: Change datapath ID of bridge to match config file
    command: /usr/bin/ovs-vsctl set bridge br-vbng other-config:datapath-id={{ ovs_dpid }}

  - name: Add controller to switch
    command: /usr/bin/ovs-vsctl set-controller br-vbng tcp:{{ controller_ip }}:{{ controller_port }}

- hosts: switch_volt
  sudo: yes
  vars:
    controller_ip: "{{ hostvars['onos_volt']['ansible_ssh_host'] }}"
    controller_port: 6653
  tags:
  - volt
  tasks:

  - name: Fix /etc/hosts
    lineinfile:
      dest=/etc/hosts
      regexp="127.0.0.1 localhost"
      line="127.0.0.1 localhost {{ ansible_hostname }}"

  - name: Install packages
    apt: name={{ item }} state=present update_cache=yes
    with_items:
    - git
    - python-netifaces

  - name: Checkout the Mininet repo
{'fraction_non_alphanumeric': 0.1168545504536706, 'fraction_numerical': 0.021996150673632114, 'mean_word_length': 2.7122448979591836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4257264', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1261, 'n_words': 283}