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 18b06f7 commit 9cc2bd1
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 32 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.cron
Expand All @@ -29,8 +29,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 All @@ -50,7 +50,7 @@ The default values for the variables are set in [`defaults/main.yml`](https://gi
ntp_state: started
# The state of the NTP service at boot.
ntp_enabled: yes
ntp_enabled: true
# A list of IP addresses to listen on.
ntp_interfaces:
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ntp_state: started

# The state of the NTP service at boot.
ntp_enabled: yes
ntp_enabled: true

# A list of IP addresses to listen on.
ntp_interfaces:
Expand Down
4 changes: 2 additions & 2 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ argument_specs:
- stopped
ntp_enabled:
type: "bool"
default: yes
default: true
description: "The state of the NTP service at boot."
ntp_interfaces:
type: "list"
Expand All @@ -36,7 +36,7 @@ argument_specs:
ntp_servers:
type: "list"
elements: str
required: no
required: false
description: "A list of NTP servers and their options."
ntp_timezone:
type: "str"
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: robertdebock.cron
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,8 +1,8 @@
---
- name: Verify
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

vars:
_ntp_check_packages:
Expand Down Expand Up @@ -43,7 +43,7 @@
register: npt_check_time_synchronised
failed_when:
- ntp_success_output not in npt_check_time_synchronised.stdout
changed_when: no
changed_when: false
until:
- npt_check_time_synchronised is succeeded
retries: 16
Expand Down
18 changes: 9 additions & 9 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
that:
- ntp_state is defined
- ntp_state in [ "started", "stopped" ]
quiet: yes
quiet: true

- name: assert | Test ntp_enabled
ansible.builtin.assert:
that:
- ntp_enabled is defined
- ntp_enabled is boolean
quiet: yes
quiet: true

- name: assert | Test ntp_interfaces
ansible.builtin.assert:
that:
- ntp_interfaces is defined
- ntp_interfaces is iterable
quiet: yes
quiet: true

- name: assert | Test item in ntp_interfaces
ansible.builtin.assert:
that:
- item.address is defined
- item.address is string
- item.address is not none
quiet: yes
quiet: true
loop: "{{ ntp_interfaces }}"
loop_control:
label: "{{ item.address }}"
Expand All @@ -37,15 +37,15 @@
that:
- ntp_pool is defined
- ntp_pool is iterable
quiet: yes
quiet: true

- name: assert | Test item in ntp_pool
ansible.builtin.assert:
that:
- item.name is defined
- item.name is string
- item.name is not none
quiet: yes
quiet: true
loop: "{{ ntp_pool }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -54,7 +54,7 @@
ansible.builtin.assert:
that:
- ntp_server is iterable
quiet: yes
quiet: true
when:
- ntp_server is defined

Expand All @@ -64,7 +64,7 @@
- item.name is defined
- item.name is string
- item.name is not none
quiet: yes
quiet: true
when:
- ntp_server is defined

Expand All @@ -74,4 +74,4 @@
- ntp_timezone is defined
- ntp_timezone is string
- ntp_timezone is not none
quiet: yes
quiet: true
2 changes: 1 addition & 1 deletion 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 packages
Expand Down
6 changes: 3 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ _ntp_timezone_packages:
ntp_timezone_packages: "{{ _ntp_timezone_packages[ansible_os_family] | default(_ntp_timezone_packages['default']) }}"

_ntp_timezone_supported:
default: no
Debian: yes
RedHat: yes
default: false
Debian: true
RedHat: true

ntp_timezone_supported: "{{ _ntp_timezone_supported[ansible_os_family] | default(_ntp_timezone_supported['default']) }}"

0 comments on commit 9cc2bd1

Please sign in to comment.