---
- name: Get ideascube version
  shell: dpkg-query -W  ideascube  | awk '{print $2}' ; echo
  register: ideascube_version

- name: Save Ideascube version number
  ini_file: dest=/etc/ansible/facts.d/installed_software.fact
            section=software
            option=ideascube
            value={{ ideascube_version.stdout }}

- name: Get kalite version
  shell: kalite --version ; echo
  register: kalite_version

- name: Save kalite version number
  ini_file: dest=/etc/ansible/facts.d/installed_software.fact
            section=software
            option=kalite
            value={{ kalite_version.stdout }}

- name: Create entry to clone/pull git repository
  copy: src=../../network-manager/files/nm-dispatcher dest=/etc/NetworkManager/dispatcher.d/ansiblePullUpdate
    owner=root group=root mode=0755 backup=yes force=yes

- name: remove old way of lunching ansible-pull
  file: path=/etc/dhcp/dhclient-exit-hooks.d/ansiblePullUpdate state=absent

- name: Reboot device
  command: reboot
---
- name: Get ideascube version
  shell: dpkg-query -W  ideascube  | awk '{print $2}' ; echo
  register: ideascube_version

- name: Save Ideascube version number
  ini_file: dest=/etc/ansible/facts.d/installed_software.fact
            section=software
            option=ideascube
            value={{ ideascube_version.stdout }}

- name: Get kalite version
  shell: kalite --version ; echo
  register: kalite_version

- name: Save kalite version number
  ini_file: dest=/etc/ansible/facts.d/installed_software.fact
            section=software
            option=kalite
            value={{ kalite_version.stdout }}

- name: Create entry to clone/pull git repository
  copy: src=../../network-manager/files/nm-dispatcher dest=/etc/NetworkManager/dispatcher.d/ansiblePullUpdate
    owner=root group=root mode=0755 backup=yes force=yes

- name: remove old way of lunching ansible-pull
  file: path=/etc/dhcp/dhclient-exit-hooks.d/ansiblePullUpdate state=absent

- name: Fix broken PIP
  command: mv /usr/local/lib/python2.7/dist-packages/requests /usr/local/lib/python2.7/dist-packages/requests.old/
  
- name: Upgrade Pip & Ansible
  pip: name={{item}} state=latest extra_args="--no-cache-dir"
  with_items:
    - pip
    - ansible

- name: Reboot device
  command: reboot
Remove PIP request then upgrade PIP and Ansible
Remove PIP request then upgrade PIP and Ansible

Ka-lite install 0.16.8 broke the PIP request, so this one has to be
removed and Pip upgraded
