From f7888f0da0b4626aac4890d463caea46e32802f9 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 18 Mar 2024 10:33:48 +0100 Subject: [PATCH] Change yes/no to true/false, adhere to yamlspec 1.2.2 --- .github/workflows/requirements2png.yml | 2 +- .yamllint | 3 --- README.md | 10 +++++----- defaults/main.yml | 2 +- molecule/default/converge.yml | 4 ++-- molecule/default/prepare.yml | 4 ++-- molecule/default/verify.yml | 6 +++--- tasks/assert.yml | 14 +++++++------- tasks/main.yml | 8 ++++---- 9 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/workflows/requirements2png.yml b/.github/workflows/requirements2png.yml index a132e12..f12e0c3 100644 --- a/.github/workflows/requirements2png.yml +++ b/.github/workflows/requirements2png.yml @@ -31,5 +31,5 @@ jobs: uses: ad-m/github-push-action@master with: directory: ${{ github.repository }} - force: yes + force: true branch: png diff --git a/.yamllint b/.yamllint index 10d5946..cc50726 100644 --- a/.yamllint +++ b/.yamllint @@ -11,9 +11,6 @@ rules: line-length: disable truthy: check-keys: no - allowed-values: - - "yes" - - "no" ignore: | .tox/ diff --git a/README.md b/README.md index 6b5020e..812dffa 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. diff --git a/defaults/main.yml b/defaults/main.yml index e456e28..729cfe4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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. diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index fc64664..d77ea1b 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,8 +1,8 @@ --- - name: Converge hosts: all - become: yes - gather_facts: yes + become: true + gather_facts: true roles: - role: ansible-role-java diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index f76c7bf..3687735 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -1,8 +1,8 @@ --- - name: Prepare hosts: all - become: yes - gather_facts: no + become: true + gather_facts: false roles: - role: robertdebock.bootstrap diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 62e91bc..da1d146 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -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 diff --git a/tasks/assert.yml b/tasks/assert.yml index b8db7a0..5aa70a6 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -6,7 +6,7 @@ - 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: @@ -14,14 +14,14 @@ - 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 @@ -31,7 +31,7 @@ - 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: @@ -39,7 +39,7 @@ - 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" @@ -49,7 +49,7 @@ that: - java_jce is defined - java_jce is boolean - quiet: yes + quiet: true when: - java_vendor == "oracle" - java_version == 8 @@ -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" diff --git a/tasks/main.yml b/tasks/main.yml index c88764f..4dd8e1c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 @@ -102,8 +102,8 @@ 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 @@ -111,5 +111,5 @@ path: /etc/profile.d/java_home.sh regexp: '^export JAVA_HOME=' line: 'export JAVA_HOME="{{ java_home.stdout }}"' - create: yes + create: true mode: "0644"