Skip to content

Commit bbd6433

Browse files
committed
Unify when clauses position
1 parent 5b2fd54 commit bbd6433

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

roles/chromium/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
- name: Install Chromium — Debian
3+
when: ansible_distribution == 'Debian'
34
ansible.builtin.apt:
45
pkg:
56
- chromium
67
update_cache: true
78
state: latest
8-
when: ansible_distribution == 'Debian'
99

1010
- name: Install Chromium — Ubuntu
11+
when: ansible_distribution == 'Ubuntu'
1112
ansible.builtin.apt:
1213
pkg:
1314
- chromium-browser
1415
update_cache: true
1516
state: latest
16-
when: ansible_distribution == 'Ubuntu'
1717

1818
# See https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#recommended-enable-user-namespace-cloning
1919
- name: Enable user namespace cloning to allow running Chromium in a sandbox
20-
ansible.builtin.command: sysctl -w kernel.unprivileged_userns_clone=1
2120
when: ansible_facts['architecture'] != 'aarch64'
21+
ansible.builtin.command: sysctl -w kernel.unprivileged_userns_clone=1

roles/github/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
delegate_to: localhost
77

88
- name: Add GitHub Bot SSH key
9+
when: github_bot_private_key_file.stat.exists
910
ansible.builtin.copy:
1011
src: "{{ inventory_dir }}/github-bot-private-key"
1112
dest: /home/{{ ansible_user }}/.ssh/ota-github-bot-key
1213
owner: "{{ ansible_user }}"
1314
group: "{{ ansible_user }}"
1415
mode: "600"
15-
when: github_bot_private_key_file.stat.exists
1616

1717
- name: Add GitHub SSH key to known_hosts
1818
ansible.builtin.known_hosts:

roles/ota/git_database/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
register: existing_repository
1313

1414
- name: Obtain initial data from branch {{ ota_git_database_branch }} of {{ ota_git_database_repository }}
15+
when: existing_repository.before is defined and not existing_repository.before # if existing_repository.before is null, then the repository is new
1516
ansible.builtin.git:
1617
repo: "{{ ota_git_database_repository }}"
1718
version: "{{ ota_git_database_branch }}"
1819
dest: "{{ ota_git_database_directory }}"
1920
key_file: /home/{{ ansible_user }}/.ssh/ota-github-bot-key
20-
when: existing_repository.before is defined and not existing_repository.before # if existing_repository.before is null, then the repository is new
2121

2222
- name: Configure {{ ota_git_database_directory }} repository to use the GitHub Bot SSH Key
2323
community.general.git_config:

roles/pm2/manage/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
- stop
77

88
- name: Stop Open Terms Archive applications
9+
when: pm2_config.stat.exists
910
ansible.builtin.command:
1011
cmd: pm2 delete pm2.config.cjs
1112
chdir: /home/{{ ansible_user }}/{{ ota_directory }}
1213
tags:
1314
- stop
14-
when: pm2_config.stat.exists
1515

1616
- name: Copy pm2.config.cjs file
1717
ansible.builtin.copy:

0 commit comments

Comments
 (0)