Skip to content

Commit

Permalink
Merge pull request #19 from Oefenweb/consistency-changes
Browse files Browse the repository at this point in the history
Consistency changes
  • Loading branch information
tersmitten committed Aug 30, 2023
2 parents 70bedf9 + 8fdba64 commit 472d463
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
warn_list:
- role-name
- name[play]
- name[casing]
- no-handler
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install ansible-lint[community,yamllint]
run: |
pip install ansible-lint
ansible-galaxy install -r requirements.yml
- name: Lint code
run: |
Expand All @@ -43,11 +45,8 @@ jobs:
matrix:
include:
- distro: debian8
ansible-version: '<2.10'
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.9, <2.10'
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
Expand All @@ -66,7 +65,7 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker

- name: Run Molecule tests
run: |
Expand Down
3 changes: 2 additions & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# requirements file
---
collections: []
collections:
- name: ansible.posix
34 changes: 17 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: install dependencies

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
apt:
ansible.builtin.apt:
name: "{{ swapfile_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
Expand All @@ -12,10 +12,14 @@
- swapfile-install
- swapfile-install-dependencies

- block:

- name: swap file

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 15 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
when: not swapfile_size | bool
tags:
- configuration
- swapfile
block:
- name: write swap file # noqa command-instead-of-module

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 21 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
command: >
ansible.builtin.command: >
fallocate -l {{ swapfile_size }} {{ swapfile_file }}
args:
creates: "{{ swapfile_file }}"
Expand All @@ -24,7 +28,7 @@
- swapfile-write-file

- name: set swap file permissions

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 30 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
file:
ansible.builtin.file:
path: "{{ swapfile_file }}"
owner: root
group: root
Expand All @@ -33,22 +37,24 @@
- swapfile-set-file-permissions

- name: create swap file # noqa command-instead-of-module

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 39 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.
command: >
ansible.builtin.command: >
mkswap {{ swapfile_file }}
register: _create_swapfile
when: _write_swapfile.changed
changed_when: true
when: _write_swapfile is changed
tags:
- swapfile-mkswap

- name: enable swapfile # noqa command-instead-of-module

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 48 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-handler

Tasks that run when changed should likely be handlers.
command: >
ansible.builtin.command: >
swapon {{ swapfile_file }}
changed_when: true
when: _create_swapfile is changed
tags:
- swapfile-enable-swapfile

- name: add swapfile to /etc/fstab

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 56 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
mount:
ansible.posix.mount:
name: none
src: "{{ swapfile_file }}"
fstype: swap
Expand All @@ -59,14 +65,8 @@
tags:
- swapfile-fstab

# TODO: Changing this to `when: swapfile_size` seems to fail, find out why
when: swapfile_size != false
tags:
- configuration
- swapfile

- name: configure vm.swappiness
sysctl:
ansible.posix.sysctl:
name: vm.swappiness
value: "{{ swapfile_swappiness | string }}"
reload: true
Expand All @@ -78,7 +78,7 @@
- swapfile-vm-swappiness

- name: configure vm.vfs_cache_pressure
sysctl:
ansible.posix.sysctl:
name: vm.vfs_cache_pressure
value: "{{ swapfile_vfs_cache_pressure | string }}"
reload: true
Expand Down

0 comments on commit 472d463

Please sign in to comment.