Skip to content

Commit

Permalink
Merge pull request silpion#32 in ISAR/ansible-java from bugfix/ISAR-1…
Browse files Browse the repository at this point in the history
…54-ansible-java-fix-bare-variable-deprecation to next

* commit '9b1fc5cb28ef9a4864f68238d72d17d870dbb6b0':
  Remove stub become configuration
  Do not hardcode privilege escalation
  Fix ansible v2 deprecation warnings
  Use local become settings from sipion.util
  • Loading branch information
Mark Kusch committed Apr 13, 2016
2 parents ee5e958 + 9b1fc5c commit fee3b83
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
27 changes: 25 additions & 2 deletions tasks/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
changed_when: false
register: java_registered_shasum_binary
when: java_shasum_binary in (None, "")
always_run: true
with_first_found: java_shasum_binaries
with_first_found: "{{ java_shasum_binaries }}"
local_action: command true

- name: Configure shasum binary
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
always_run: true
local_action: set_fact
args:
Expand All @@ -38,18 +44,23 @@
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
local_action: template
args:
src: sha256sum.j2
dest: "{{ lib_persistent_data_path_local }}/java-{{ java_oracle_version }}-{{ java_oracle_distribution }}.sha256sum"
mode: 0644


# Test whether we need to download Java (again).
- name: Verify Java redis package sha256sum
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
ignore_errors: true
failed_when: false
changed_when: false
Expand All @@ -67,6 +78,9 @@
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
when: java_oracle_redis_exists.rc != 0
with_items:
- "{{ lib_persistent_data_path_local }}/{{ java_oracle_redis_filename }}"
Expand All @@ -86,6 +100,9 @@
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
register: java_oracle_redis_download
when: java_oracle_redis_exists.rc != 0
with_items:
Expand All @@ -111,6 +128,9 @@
tags:
- java
- java_download
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
with_items:
- "{{ java_oracle_redis_filename }}"
- "{{ java_oracle_redis_jce_filename }}"
Expand All @@ -125,6 +145,9 @@
- java
- java_download
when: java_oracle_redis_download.changed
become: "{{ util_local_action_become_enable|default(omit) }}"
become_user: "{{ util_local_action_become_user|default(omit) }}"
become_method: "{{ util_local_action_become_method|default(omit) }}"
local_action: command
{{ java_fact_shasum_binary }}
--check
Expand Down
3 changes: 1 addition & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
- name: Install required packages
tags: java
become: true
with_items: java_package_list
with_items: "{{ java_package_list }}"
action: "{{ ansible_pkg_mgr }}"
args:
state: "{{ util_package_state|default('present') }}"
Expand All @@ -86,7 +86,6 @@
# Install the Oracle redistributable package to the node
- name: Copy Java redistributable packages
tags: java
become: ...
when: not lib_fact_check_mode
with_items:
- "{{ java_oracle_redis_filename }}"
Expand Down
2 changes: 1 addition & 1 deletion tests/keystore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- java
- keystore
become: yes
with_items: java_keystore_certificates
with_items: "{{ java_keystore_certificates }}"
keystore:
state={{ java_keystore_state|default('present') }}
copy={{ java_keystore_copy|default('true') }}
Expand Down

0 comments on commit fee3b83

Please sign in to comment.