---
#
# Connmon Install
#

- name: Install pip
  easy_install: name=pip
  when: connmon

- name: Install connmon
  pip: name=connmon
  when: connmon

#
# Connmon Setup
#

- name: Configure Connmon Host IP Address
  template:
    src=connmon.cfg.j2
    dest=/etc/connmon.cfg
    owner=root
    group=root
    mode=0644
  with_items:
    - ip_address: "{{ connmon_host }}"
  when: connmon

---
#
# Connmon Install
#

- name: Install pip
  easy_install: name=pip
  when: connmon

- name: Install connmon
  pip: name=connmon
  when: connmon

#
# Connmon Setup
#

- name: Configure Connmon Host IP Address
  template:
    src=connmon.cfg.j2
    dest=/etc/connmon.cfg
    owner=root
    group=root
    mode=0644
  with_items:
    - ip_address: "{{ connmon_host }}"
  when: connmon

# To remove the screen session: screen -X -S connmond kill
- name: Run connmond in screen session on director
  command: screen -d -S connmond -m connmond
  when: connmon and director

Allow connmon to run out of box, by adding task to start connmond in screen session.
Allow connmon to run out of box, by adding task to start connmond in screen session.
