CORD-391 - cleaned up ansible to pass cleanly through ansible-lint

Change-Id: I90284704255edc19abbdb239852c520a4bf48df4
diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml
index 0ad01a7..b7d5eb2 100644
--- a/ansible/roles/common/tasks/main.yml
+++ b/ansible/roles/common/tasks/main.yml
@@ -9,13 +9,13 @@
     dest: /etc/hosts
     regexp: "^{{ item.host_ip }}"
     line: "{{ item.host_ip }} {{ item.host_name }}"
-  with_items: hosts
+  with_items: "{{ hosts }}"
   tags: [common]
 
 - name: Latest apt packages
   apt:
     name: "{{ item }}"
-  with_items: use_latest_for
+  with_items: "{{ use_latest_for }}"
   tags: [common]
 
 - name: Services are not running
@@ -23,7 +23,7 @@
     name: "{{ item }}"
     state: stopped
   ignore_errors: yes
-  with_items: obsolete_services
+  with_items: "{{ obsolete_services }}"
   tags: [common]
 
 - name: Ensure SSH Directory
diff --git a/ansible/roles/docker/tasks/centos.yml b/ansible/roles/docker/tasks/centos.yml
index a8910d4..cdfd0b4 100644
--- a/ansible/roles/docker/tasks/centos.yml
+++ b/ansible/roles/docker/tasks/centos.yml
@@ -2,7 +2,7 @@
   copy:
     src: "{{ item.src }}"
     dest: "{{ item.dest }}"
-  with_items: centos_files
+  with_items: "{{ centos_files }}"
   tags: [docker]
 
 - name: CentOS package is installed
@@ -13,6 +13,7 @@
 
 - name: CentOS Daemon is reloaded
   command: systemctl daemon-reload
+  changed_when: true
   tags: [docker]
 
 - name: CentOS service is running
diff --git a/ansible/roles/docker/tasks/debian.yml b/ansible/roles/docker/tasks/debian.yml
index aa10934..55178b1 100644
--- a/ansible/roles/docker/tasks/debian.yml
+++ b/ansible/roles/docker/tasks/debian.yml
@@ -7,8 +7,8 @@
 
 - name: Debian Docker is present
   apt:
-    name: docker-engine
-    state: latest
+    name: docker-engine=1.12*
+    state: present
     force: yes
   tags: [docker]
 
@@ -58,4 +58,4 @@
     volumes:
       - /var/run/docker.sock:/var/run/docker.sock
   when: not skip_ui is defined
-  tags: [docker]
\ No newline at end of file
+  tags: [docker]
diff --git a/ansible/roles/java8-oracle/tasks/main.yml b/ansible/roles/java8-oracle/tasks/main.yml
index c38dd54..9bdc946 100644
--- a/ansible/roles/java8-oracle/tasks/main.yml
+++ b/ansible/roles/java8-oracle/tasks/main.yml
@@ -1,20 +1,20 @@
 ---
 - name: Install add-apt-repository
-  sudo: yes
-  apt: name=software-properties-common state=latest update_cache=yes
+  become: yes
+  apt: name=software-properties-common=0.92* state=present update_cache=yes
 
 - name: Add Oracle Java repository
-  sudo: yes
+  become: yes
   apt_repository: repo='ppa:webupd8team/java' update_cache=yes
 
 - name: Accept Java 8 license
-  sudo: yes
+  become: yes
   debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
 
 - name: Install Oracle Java 8
-  sudo: yes
-  apt: name={{item}} state=latest
+  become: yes
+  apt: name={{item}} state=present
   with_items:
-  - oracle-java8-installer
-  - ca-certificates
-  - oracle-java8-set-default
+  - oracle-java8-installer=8*
+  - ca-certificates=14.04*
+  - oracle-java8-set-default=8*