Skip to content

Commit fa4a391

Browse files
committed
xmpp2: fix the linter warnings
1 parent a765dd8 commit fa4a391

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.idea/dictionaries/project.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xmpp2/system.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313

1414
tasks:
1515
- name: Check if swap file exists
16-
stat:
16+
ansible.builtin.stat:
1717
path: '{{ swap_file_path }}'
1818
register: swap_file_check
1919

2020
- name: Create swap file
21-
ansible.builtin.command: fallocate -l "{{ swap_file_size }}" "{{ swap_file_path }}"
22-
when: not swap_file_check.stat.exists
21+
ansible.builtin.command:
22+
cmd: fallocate -l "{{ swap_file_size }}" "{{ swap_file_path }}"
23+
creates: '{{ swap_file_path }}'
2324

2425
- name: Set up swap file permissions
2526
ansible.builtin.file:
@@ -28,7 +29,8 @@
2829
group: root
2930
mode: '0600'
3031

31-
- name: Prepare the swap file
32+
- name: Prepare the swap file # noqa: no-changed-when
33+
# we already have a check in `when`, no need for warning
3234
ansible.builtin.command: mkswap "{{ swap_file_path }}"
3335
when: not swap_file_check.stat.exists
3436

@@ -42,11 +44,12 @@
4244
dump: 0
4345
state: present
4446

45-
- name: Enable swap
46-
command: swapon -a
47+
- name: Enable swap # noqa: no-changed-when
48+
# we already have a check in `when`, no need for warning
49+
ansible.builtin.command: swapon -a
4750
when: not swap_file_check.stat.exists
4851

4952
- name: Enable swappiness
50-
sysctl:
53+
ansible.posix.sysctl:
5154
name: vm.swappiness
5255
value: 1

0 commit comments

Comments
 (0)