From 946d89ac74c85801a03b30b30d24d0b0b5968caf Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Tue, 14 Mar 2017 12:58:46 -0700 Subject: [PATCH] Idempotent tests - Make java install idempotent --- .kitchen.yml | 1 + tasks/java.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 9d2c326..0bd7a15 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -12,6 +12,7 @@ provisioner: http_proxy: <%= ENV['HTTP_PROXY'] %> https_proxy: <%= ENV['HTTPS_PROXY'] %> no_proxy: localhost,127.0.0.1 + idempotency_test: true platforms: - name: ubuntu-14.04 diff --git a/tasks/java.yml b/tasks/java.yml index 388ceed..508ad67 100644 --- a/tasks/java.yml +++ b/tasks/java.yml @@ -10,13 +10,15 @@ when: ansible_os_family == 'RedHat' - name: Debian - Ensure Java is installed - apt: name={{ java }} state={{java_state}} update_cache=yes force=yes + apt: name={{ java }} state={{java_state}} update_cache=yes when: ansible_os_family == 'Debian' - command: java -version 2>&1 | grep OpenJDK register: open_jdk changed_when: false +#https://github.com/docker-library/openjdk/issues/19 - ensures tests pass due to java 8 broken certs - name: refresh the java ca-certificates command: /var/lib/dpkg/info/ca-certificates-java.postinst configure - when: ansible_distribution == 'Ubuntu' and open_jdk.rc == 0 \ No newline at end of file + when: ansible_distribution == 'Ubuntu' and open_jdk.rc == 0 + changed_when: false \ No newline at end of file