- hosts: docker
  sudo: yes
  roles:
    - angstwad.docker_ubuntu
    - { role: kamaln7.swapfile, swapfile_size: 1GB, swapfile_swappiness: 10 }

  tasks:
    - apt:
        name: python-pip
        update_cache: yes
    - pip: name=docker-py version=1.2.2
    - name: run political-affiliation-prediction
      docker: image=kirel/political-affiliation-prediction
              pull=always
              ports=80:5000
              name=political-affiliation-prediction
              state=running

- hosts: docker
  sudo: yes
  roles:
    - angstwad.docker_ubuntu
    - { role: kamaln7.swapfile, swapfile_size: 1GB, swapfile_swappiness: 10 }

  tasks:
    - apt:
        name: python-pip
        update_cache: yes
    - pip: name=docker-py version=1.1.0
    - name: run political-affiliation-prediction
      docker: image=kirel/political-affiliation-prediction
              pull=always
              ports=80:5000
              name=political-affiliation-prediction
              state=running

Fix docker-py version for ansible
Fix docker-py version for ansible