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 87bdf34 commit 37566bd
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 53 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
12 changes: 6 additions & 6 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.nextcloud
Expand All @@ -33,8 +33,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 @@ -53,8 +53,8 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr

- name: Continue prepare with facts
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

pre_tasks:
- name: Include remi
Expand Down
20 changes: 10 additions & 10 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
cmd: php occ config:system:set memcache.distributed --value="\OC\Memcache\Redis"
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: yes
become: yes
changed_when: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Set redis host
ansible.builtin.command:
cmd: php occ config:system:set redis host --value="localhost"
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: yes
become: yes
changed_when: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Set redis port
ansible.builtin.command:
cmd: php occ config:system:set redis port --value="6379"
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: yes
become: yes
changed_when: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Set trusted domains
ansible.builtin.command:
cmd: php occ config:system:set trusted_domains 1 --value={{ nextcloud_domain_url }}
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: yes
become: yes
changed_when: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Set permissions
Expand All @@ -53,8 +53,8 @@
cmd: php occ db:add-missing-indices
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: yes
become: yes
changed_when: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Restart httpd
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-nextcloud
Expand Down
8 changes: 4 additions & 4 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
Expand All @@ -21,8 +21,8 @@

- name: Continue prepare with facts
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

pre_tasks:
- name: Include remi
Expand Down
8 changes: 4 additions & 4 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_files:
- ../../vars/main.yml
Expand All @@ -14,8 +14,8 @@
cmd: php occ check
args:
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: no
become: yes
changed_when: false
become: true
become_user: "{{ nextcloud_httpd_owner }}"

- name: Get status.php
Expand Down
24 changes: 12 additions & 12 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,69 @@
- nextcloud_version is defined
- nextcloud_version is string
- nextcloud_version is not none
quiet: yes
quiet: true

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

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

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

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

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

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

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

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

Expand All @@ -78,7 +78,7 @@
- item.name is defined
- item.name is string
- item.name is not none
quiet: yes
quiet: true
loop: "{{ nextcloud_apps }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -89,7 +89,7 @@
ansible.builtin.assert:
that:
- nextcloud_settings is iterable
quiet: yes
quiet: true
when:
- nextcloud_settings is defined

Expand All @@ -103,7 +103,7 @@
- item.section is string
- item.section is not none
- item.value is defined
quiet: yes
quiet: true
loop: "{{ nextcloud_settings }}"
loop_control:
label: "{{ item.name }}"
Expand Down
14 changes: 7 additions & 7 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 All @@ -21,8 +21,8 @@
- name: Modify selinux settings
ansible.posix.seboolean:
name: "{{ item }}"
state: yes
persistent: yes
state: true
persistent: true
when:
- ansible_selinux.status is defined
- ansible_selinux.status == "enabled"
Expand All @@ -32,7 +32,7 @@
ansible.builtin.unarchive:
src: "{{ nextcloud_archive }}"
dest: "{{ nextcloud_destination }}"
remote_src: yes
remote_src: true
owner: "{{ nextcloud_httpd_owner }}"
group: "{{ nextcloud_httpd_group }}"
creates: "{{ nextcloud_destination }}/nextcloud/occ"
Expand All @@ -43,8 +43,8 @@
cmd: "{{ nextcloud_command }}"
creates: "{{ nextcloud_destination }}/nextcloud/data/index.html"
chdir: "{{ nextcloud_destination }}/nextcloud"
# no_log: yes
become: yes
# no_log: true
become: true
become_user: "{{ nextcloud_httpd_owner }}"
notify:
- Set memcache.distributed
Expand All @@ -60,7 +60,7 @@
cmd: php occ app:install {{ item.name }}
chdir: "{{ nextcloud_destination }}/nextcloud"
creates: "{{ nextcloud_destination }}/nextcloud/apps/{{ item.name }}"
become: yes
become: true
become_user: "{{ nextcloud_httpd_owner }}"
loop: "{{ nextcloud_apps }}"
loop_control:
Expand Down
8 changes: 4 additions & 4 deletions tasks/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
cmd: php occ config:app:get {{ item.section }} {{ item.name }} --output yaml
chdir: "{{ nextcloud_destination }}/nextcloud"
register: nextcloud_list_value
changed_when: no
become: yes
changed_when: false
become: true
become_user: "{{ nextcloud_httpd_owner }}"
failed_when:
- nextcloud_list_value.stdout | from_yaml != item.value
Expand All @@ -17,8 +17,8 @@
ansible.builtin.command:
cmd: php occ config:app:set {{ item.section }} {{ item.name }} --value {{ item.value }}
chdir: "{{ nextcloud_destination }}/nextcloud"
changed_when: no
become: yes
changed_when: false
become: true
become_user: "{{ nextcloud_httpd_owner }}"
notify:
- Set permissions

0 comments on commit 37566bd

Please sign in to comment.