---
- apt: pkg={{ item }}
  with_items:
    - dnsmasq
    - dnsmasq-utils

- name: Prevent dnsmasq from add itself to /etc/resolv.conf via resolvconf
  lineinfile: dest=/etc/default/dnsmasq regexp="^DNSMASQ_EXCEPT=" line="DNSMASQ_EXCEPT=lo"

- command: resolvconf -d lo.dnsmasq

- name: ovs ex bridge
  ovs_bridge: name=br-ex state=present

- template: src=etc/init/{{ item }}.conf dest=/etc/init/{{ item }}.conf
  with_items:
    - neutron-l3-agent
    - neutron-lbaas-agent
    - neutron-dhcp-agent
    - neutron-metadata-agent

- service: name={{ item }} state=started
  with_items:
    - neutron-l3-agent
    - neutron-lbaas-agent
    - neutron-dhcp-agent
    - neutron-metadata-agent

---
- apt: pkg={{ item }}
  with_items:
    - dnsmasq
    - dnsmasq-utils
    - ucarp

- name: Prevent dnsmasq from add itself to /etc/resolv.conf via resolvconf
  lineinfile: dest=/etc/default/dnsmasq regexp="^DNSMASQ_EXCEPT=" line="DNSMASQ_EXCEPT=lo"

- command: resolvconf -d lo.dnsmasq

- name: ovs ex bridge
  ovs_bridge: name=br-ex state=present

- template: src=etc/init/{{ item }}.conf dest=/etc/init/{{ item }}.conf
  with_items:
    - neutron-l3-agent
    - neutron-lbaas-agent
    - neutron-dhcp-agent
    - neutron-metadata-agent

- service: name={{ item }} state=started
  with_items:
    - neutron-l3-agent
    - neutron-lbaas-agent
    - neutron-dhcp-agent
    - neutron-metadata-agent

Install ucarp package on network nodes.
Install ucarp package on network nodes.

This permits doing ip-failover.

On boxes which do not have ucarp configured in /etc/network/interfaces,
no ucarp processes will be started.

On boxes which have ucarp configured in /etc/network/interfaces, a ucarp
process will be automatically started upon ifup.
