diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1dedd566073f8fc9aac1f56ea8676577f9a6de1..f92da7b142f506a53baa2e4028ac3e501c5919d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,4 @@ --- -image: adarnimrod/ci-images:docker - -stages: - - test - -pre-commit: - stage: test - image: adarnimrod/ci-images:pre-commit - variables: - XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" - script: - - pre-commit run --all-files - cache: - paths: - - .cache/ +include: + - project: shore/ci-templates + file: templates/pre-commit.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dacf4d30082ea48f0741ec911e71faaa6b9f0c12..0bd3a643e4b77b8dc30b4834c22f227804c28e50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,28 +1,18 @@ --- repos: - - repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks.git rev: v3.4.0 hooks: - id: check-added-large-files - id: check-executables-have-shebangs - id: check-merge-conflict - id: check-symlinks - - id: check-yaml - - id: detect-private-key - id: trailing-whitespace - - repo: https://git.shore.co.il/ansible/ansible-pre-commit.git - rev: v0.10.0 - hooks: - - id: ansible-syntax-check - # yamllint disable-line rule:line-length - files: bootstrap\.yaml|update\.yaml|renew-certs\.yaml|debian_server\.yaml - types: [yaml] - - - repo: https://github.com/ansible/ansible-lint - rev: v4.3.7 + - repo: https://github.com/Yelp/detect-secrets + rev: v0.14.3 hooks: - - id: ansible-lint + - id: detect-secrets - repo: https://github.com/adrienverge/yamllint rev: v1.25.0 @@ -35,14 +25,28 @@ repos: - id: proselint types: [markdown] - - repo: https://github.com/Yelp/detect-secrets - rev: v0.14.3 + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.5.3 hooks: - - id: detect-secrets - exclude: Pipfile\.lock + - id: mdformat - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git rev: v0.6.0 hooks: - id: shell-lint + + - repo: https://github.com/shellcheck-py/shellcheck-py.git + rev: v0.7.1.1 + hooks: - id: shellcheck + + - repo: https://git.shore.co.il/ansible/ansible-pre-commit.git + rev: v0.10.0 + hooks: + - id: ansible-syntax-check + files: (bootstrap|update|renew-certs|debian_server|kodi)\.yaml + + - repo: https://github.com/ansible/ansible-lint + rev: v4.3.7 + hooks: + - id: ansible-lint diff --git a/README.md b/README.md index 06b2eff9c0bd067115fede3ca44923ad78165b2c..81f311dab50ca98c3bcd86e24f665b224c6df771 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# - Homelab +# Homelab + [](https://git.shore.co.il/shore/homelab/-/commits/master) > My homelab setup using Ansible. @@ -29,7 +29,7 @@ This software is licensed under the MIT license (see `LICENSE.txt`). ## Author Information -Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( -https://www.shore.co.il/). Patches are welcome via [`git send-email`]( -http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located -at: <https://git.shore.co.il/explore/>. +Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my +[website](https://www.shore.co.il/). Patches are welcome via +[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository +is located at: <https://git.shore.co.il/expore/>. diff --git a/renew-certs.yml b/renew-certs.yml index 0cc0320963ce5efc765593295887b6efead16539..b1dd319341c6efc6227ac99ac8287e632f939208 100644 --- a/renew-certs.yml +++ b/renew-certs.yml @@ -8,7 +8,7 @@ vars: email: nimrod@shore.co.il acme_directory: https://acme-v02.api.letsencrypt.org/directory - #acme_directory: https://acme-staging-v02.api.letsencrypt.org/directory + # acme_directory: https://acme-staging-v02.api.letsencrypt.org/directory acme_version: 2 handlers: diff --git a/roles/debian_bootstrap/tasks/main.yaml b/roles/debian_bootstrap/tasks/main.yaml index c83e108d6247cfce5791904f798cc6d2a0b81579..2254a852ee43918326550a7877f680e04ed9c8ec 100644 --- a/roles/debian_bootstrap/tasks/main.yaml +++ b/roles/debian_bootstrap/tasks/main.yaml @@ -1,7 +1,7 @@ --- - name: Update APT sources raw: apt-get update - changed_when: False + changed_when: false - name: APT install Python raw: DEBIAN_FRONTEND=noninteractive apt-get install -qy python3 @@ -10,12 +10,12 @@ - name: Install requirements for more complete facts apt: - name: - - iproute2 - - lsb-release - state: present - update_cache: yes - cache_valid_time: 3600 + name: + - iproute2 + - lsb-release + state: present + update_cache: true + cache_valid_time: 3600 - name: Gather facts setup: diff --git a/roles/kodi/tasks/main.yml b/roles/kodi/tasks/main.yml index cd4bea2a2d469900a8ce610297a51e0693b67b0b..2c050d5ffd394febbf50db2b0d0d8382ba3bd4e5 100644 --- a/roles/kodi/tasks/main.yml +++ b/roles/kodi/tasks/main.yml @@ -6,7 +6,7 @@ - avahi-daemon - desktop-base - flatpak - #- plymouth-themes + # - plymouth-themes - firmware-linux - udisks2 - unison