Skip to content

Commit

Permalink
Same as other tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Sep 8, 2023
1 parent 4624097 commit 77df010
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,8 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
become: yes
gather_facts: yes

# We want to test some non-default version of java, to ensure we can install a specific version.
vars:
_desired_java_version:
default: 8
Amazon: 17
Debian: 11
Debian-bookworm: 17
desired_java_version: "{{ _desired_java_version[ansible_distribution ~ '-' ~ ansible_distribution_release] | default(_desired_java_version[ansible_distribution] | default(_desired_java_version['default'])) }}"

roles:
- role: robertdebock.java
java_version: "{{ desired_java_version }}"
```
The machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/robertdebock/ansible-role-java/blob/master/molecule/default/prepare.yml):
Expand Down
2 changes: 1 addition & 1 deletion tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- name: assert | Test if java_version is set correctly
ansible.builtin.assert:
that:
- java_version | int is integer
- java_version is number
- java_version | int in [ 6, 7, 8, 9, 10, 11, 12, 13, 17, 19 ]
quiet: yes
when:
Expand Down

0 comments on commit 77df010

Please sign in to comment.