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 1fe6b99 commit 5b1892a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 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
8 changes: 4 additions & 4 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 @@ -39,8 +39,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
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-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
4 changes: 2 additions & 2 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

roles:
- role: ansible-role-cron
Expand Down
16 changes: 8 additions & 8 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
- cron_shell is defined
- cron_shell is string
- cron_shell is not none
quiet: yes
quiet: true

- name: assert | Test cron_path
ansible.builtin.assert:
that:
- cron_path is defined
- cron_path is string
- cron_path is not none
quiet: yes
quiet: true

- name: assert | Test cron_mailto
ansible.builtin.assert:
that:
- cron_mailto is defined
- cron_mailto is string
- cron_mailto is not none
quiet: yes
quiet: true

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

Expand All @@ -41,7 +41,7 @@
- item.job is defined
- item.job is string
- item.job is not none
quiet: yes
quiet: true
loop: "{{ cron_jobs }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -53,7 +53,7 @@
that:
- item.minute >= 0
- item.minute <= 59
quiet: yes
quiet: true
loop: "{{ cron_jobs }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -67,7 +67,7 @@
that:
- item.hour >= 0
- item.hour <= 23
quiet: yes
quiet: true
loop: "{{ cron_jobs }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -81,7 +81,7 @@
that:
- item.weekday >= 0
- item.weekday <= 6
quiet: yes
quiet: true
loop: "{{ cron_jobs }}"
loop_control:
label: "{{ item.name }}"
Expand Down
10 changes: 5 additions & 5 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 cron
Expand All @@ -17,7 +17,7 @@
path: "{{ cron_configuration }}"
line: "SHELL={{ cron_shell }}"
regexp: "^SHELL"
create: yes
create: true
mode: "0600"
notify:
- Restart cron
Expand All @@ -27,7 +27,7 @@
path: "{{ cron_configuration }}"
line: "PATH={{ cron_path }}"
regexp: "^PATH"
create: yes
create: true
mode: "0600"
notify:
- Restart cron
Expand All @@ -37,7 +37,7 @@
path: "{{ cron_configuration }}"
line: "MAILTO={{ cron_mailto }}"
regexp: "^MAILTO"
create: yes
create: true
mode: "0600"
notify:
- Restart cron
Expand All @@ -46,7 +46,7 @@
ansible.builtin.service:
name: "{{ cron_service }}"
state: started
enabled: yes
enabled: true
when:
- cron_service is defined
- cron_service | length
Expand Down

0 comments on commit 5b1892a

Please sign in to comment.