Skip to content

Commit

Permalink
Change yes/no to true/false, adhere to yamlspec 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Mar 18, 2024
1 parent 1ba090a commit f7888f0
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/requirements2png.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
uses: ad-m/github-push-action@master
with:
directory: ${{ github.repository }}
force: yes
force: true
branch: png
3 changes: 0 additions & 3 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ rules:
line-length: disable
truthy:
check-keys: no
allowed-values:
- "yes"
- "no"

ignore: |
.tox/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: robertdebock.java
Expand All @@ -34,8 +34,8 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

roles:
- role: robertdebock.bootstrap
Expand Down Expand Up @@ -75,7 +75,7 @@ java_source: local
# Choose if you can JCE installed. Only applicable for (both):
# - java_vendor == "oracle"
# - java_version == "8"
java_jce: yes
java_jce: true

# In case of "java_vendor == oracle" and "java_format == targz", a directory
# as to be set where to install.
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ java_source: local
# Choose if you can JCE installed. Only applicable for (both):
# - java_vendor == "oracle"
# - java_version == "8"
java_jce: yes
java_jce: true

# In case of "java_vendor == oracle" and "java_format == targz", a directory
# as to be set where to install.
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: ansible-role-java
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

roles:
- role: robertdebock.bootstrap
6 changes: 3 additions & 3 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Verify
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

tasks:
- name: Run java -version
ansible.builtin.command:
cmd: java -version
changed_when: no
changed_when: false
14 changes: 7 additions & 7 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
- java_vendor is defined
- java_vendor is string
- java_vendor in [ "openjdk", "oracle" ]
quiet: yes
quiet: true

- name: assert | Test java_type
ansible.builtin.assert:
that:
- java_type is defined
- java_type is string
- java_type in [ "jre", "jdk" ]
quiet: yes
quiet: true

- name: assert | Test java_version
ansible.builtin.assert:
that:
- java_version | int is number
- java_version | int in [ 6, 7, 8, 9, 10, 11, 12, 13, 17, 19, 20, 21 ]
quiet: yes
quiet: true
when:
- java_version is defined

Expand All @@ -31,15 +31,15 @@
- java_format is defined
- java_format is string
- java_format in [ "deb", "rpm", "targz" ]
quiet: yes
quiet: true

- name: assert | Test java_rpm_source
ansible.builtin.assert:
that:
- java_rpm_source is defined
- java_rpm_source is string
- java_rpm_source in [ "local", "repository" ]
quiet: yes
quiet: true
when:
- java_vendor == "oracle"
- java_format == "rpm"
Expand All @@ -49,7 +49,7 @@
that:
- java_jce is defined
- java_jce is boolean
quiet: yes
quiet: true
when:
- java_vendor == "oracle"
- java_version == 8
Expand All @@ -60,7 +60,7 @@
- java_install_directory is defined
- java_install_directory is string
- java_install_directory is not none
quiet: yes
quiet: true
when:
- java_vendor == "oracle"
- java_format == "targz"
8 changes: 4 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: Import assert.yml
ansible.builtin.import_tasks:
file: assert.yml
run_once: yes
run_once: true
delegate_to: localhost

- name: Install requirements
Expand Down Expand Up @@ -102,14 +102,14 @@
ansible.builtin.shell:
cmd: set -o pipefail && readlink -f /usr/bin/java | sed 's%/bin/java%%'
executable: /bin/bash
changed_when: no
check_mode: no
changed_when: false
check_mode: false
register: java_home

- name: Set JAVA_HOME in /etc/environment
ansible.builtin.lineinfile:
path: /etc/profile.d/java_home.sh
regexp: '^export JAVA_HOME='
line: 'export JAVA_HOME="{{ java_home.stdout }}"'
create: yes
create: true
mode: "0644"

0 comments on commit f7888f0

Please sign in to comment.