Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
skip_list:
- risky-file-permissions
- role-name
- name[missing]
- key-order[task]
- name[template]
- risky-file-permissions
- role-name
- name[missing]
- key-order[task]
- name[template]

exclude_paths:
- roles/bertvv.samba
- roles/geerlingguy.docker
- roles/geerlingguy.docker_arm
- roles/geerlingguy.nfs
- roles/bertvv.samba
- roles/geerlingguy.docker
- roles/geerlingguy.docker_arm
- roles/geerlingguy.nfs
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ on:
branches: [main]
pull_request:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint:
name: Lint
Expand All @@ -23,18 +21,18 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.13"

- name: Install test dependencies
run: pip3 install ansible yamllint==1.30.0 ansible-lint==6.14.6
run: |
pip3 install -r requirements-dev.txt
pre-commit autoupdate

- name: Ansible-lint
run: ansible-lint nas.yml
run: pre-commit run ansible-lint

- name: Lint yaml files
run: yamllint .
run: pre-commit run yamllint

- name: Lint docs
uses: articulate/actions-markdownlint@v1
with:
version: 0.32.2
run: pre-commit run markdownlint
2 changes: 1 addition & 1 deletion .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
run: npm ci

- name: Build website
run: npm run build
run: npm run build
10 changes: 4 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ name: Integration
# Controls when the action will run.
on:
workflow_dispatch:


jobs:
generate-matrix:
name: Generate test matrix
Expand All @@ -24,8 +22,8 @@ jobs:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Molecule Test
Expand All @@ -35,5 +33,5 @@ jobs:
molecule_command: test
molecule_working_dir: ${{ matrix.role }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
repos:
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.14.6
rev: v26.1.0
hooks:
- id: ansible-lint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.37.1
hooks:
- id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
rev: v0.47.0
hooks:
- id: markdownlint
6 changes: 5 additions & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ extends: default
rules:
line-length: disable
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
allowed-values: ["true", "false", "yes", "no"]
comments:
min-spaces-from-content: 1
comments-indentation: disable
octal-values:
forbid-explicit-octal: true
forbid-implicit-octal: true
braces:
min-spaces-inside: 0
max-spaces-inside: 1
Expand Down
3 changes: 2 additions & 1 deletion permission_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
tasks:
- name: Warning!
ansible.builtin.debug:
msg: "This playbook will repermission ALL existing data in the shares defined in group_vars/all.yml to be owned by the ansible-nas user and group. If this is not what you want, exit now."
msg: "This playbook will repermission ALL existing data in the shares defined in group_vars/all.yml to be owned by the ansible-nas user and group. If this
is not what you want, exit now."

- name: 20s to change your mind...
ansible.builtin.pause:
Expand Down
2 changes: 1 addition & 1 deletion roles/airsonic/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ airsonic_container_name }}"
register: result
Expand Down
2 changes: 1 addition & 1 deletion roles/airsonic/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Airsonic
- name: Try and stop and remove Airsonic # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ airsonic_container_name }}"
state: absent
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible-nas-docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
- name: Create Docker home directory
ansible.builtin.file:
path: "{{ docker_home }}"
mode: 0755
mode: "0755"
state: directory

- name: Add user account to Docker group
ansible.builtin.user:
name: "{{ ansible_nas_user }}"
groups: docker
append: yes
append: true

- name: Generate Docker daemon.json
ansible.builtin.copy:
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible-nas-general/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

- name: Update apt-cache
ansible.builtin.apt:
update_cache: yes
update_cache: true
cache_valid_time: 3600
register: result
until: result is succeeded

- name: Upgrade all packages # noqa package-latest
ansible.builtin.apt:
upgrade: yes
upgrade: true
state: latest
when: keep_packages_updated
tags:
Expand Down
2 changes: 1 addition & 1 deletion roles/apcupsd/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
apcupsd_enabled: false
8 changes: 4 additions & 4 deletions roles/apcupsd/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
docker_container_info:
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ apcupsd_container_name }}"
register: result

- name: Check Apcupsd is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
8 changes: 4 additions & 4 deletions roles/apcupsd/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Apcupsd
docker_container:
- name: Try and stop and remove Apcupsd # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ apcupsd_container_name }}"
state: absent
register: result

- name: Check Apcupsd is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed
1 change: 0 additions & 1 deletion roles/apcupsd/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Start Apcupsd
block:
- name: Create Apcupsd Directories
Expand Down
2 changes: 1 addition & 1 deletion roles/bazarr/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ bazarr_container_name }}"
register: result
Expand Down
2 changes: 1 addition & 1 deletion roles/bazarr/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Bazarr
- name: Try and stop and remove Bazarr # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
state: absent
Expand Down
4 changes: 2 additions & 2 deletions roles/bitwarden/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ bitwarden_container_name }}"
register: result

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ bitwarden_backup_container_name }}"
register: result_backup
Expand Down
4 changes: 2 additions & 2 deletions roles/bitwarden/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Bitwarden
- name: Try and stop and remove Bitwarden # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ bitwarden_container_name }}"
state: absent
register: result

- name: Try and stop and remove Bitwarden Backup
- name: Try and stop and remove Bitwarden Backup # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ bitwarden_backup_container_name }}"
state: absent
Expand Down
2 changes: 1 addition & 1 deletion roles/booksonic/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ booksonic_container_name }}"
register: result
Expand Down
2 changes: 1 addition & 1 deletion roles/booksonic/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Booksonic
- name: Try and stop and remove Booksonic # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ booksonic_container_name }}"
state: absent
Expand Down
2 changes: 1 addition & 1 deletion roles/booksonic/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
mode: "0755"
with_items:
- "{{ booksonic_data_directory }}/data"
- "{{ booksonic_data_directory }}/playlists"
Expand Down
2 changes: 1 addition & 1 deletion roles/calibre/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ calibre_container_name }}"
register: result
Expand Down
2 changes: 1 addition & 1 deletion roles/calibre/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove Calibre
- name: Try and stop and remove Calibre # noqa: var-naming[no-role-prefix]
community.docker.docker_container:
name: "{{ calibre_container_name }}"
state: absent
Expand Down
2 changes: 1 addition & 1 deletion roles/calibre/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
mode: "0755"
with_items:
- "{{ calibre_data_directory }}/data"

Expand Down
2 changes: 1 addition & 1 deletion roles/calibreweb/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
calibreweb_enabled: false
8 changes: 4 additions & 4 deletions roles/calibreweb/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get container state
docker_container_info:
- name: Get container state # noqa: var-naming[no-role-prefix]
community.docker.docker_container_info:
name: "{{ calibreweb_container_name }}"
register: result

- name: Check Calibre-web is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
Loading