diff --git a/.ansible-lint b/.ansible-lint index 0e80b05..4ffc0ef 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,10 +1,9 @@ --- -# See https://ansible-lint.readthedocs.io/en/latest/configuring.html -# for a list of the configuration elements that can exist in this -# file. +# See https://ansible-lint.readthedocs.io/configuring/ for a list of +# the configuration elements that can exist in this file. enable_list: # Useful checks that one must opt-into. See here for more details: - # https://ansible-lint.readthedocs.io/en/latest/rules.html + # https://ansible-lint.readthedocs.io/rules/ - fcqn-builtins - no-log-password - no-same-owner diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdd8c98..438e780 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,10 @@ jobs: - id: setup-go uses: actions/setup-go@v4 with: - go-version: "1.19" + # There is no expectation for actual Go code so we disable caching as + # it relies on the existence of a go.sum file. + cache: false + go-version: "1.20" - name: Lookup Go cache directory id: go-cache run: | @@ -91,6 +94,10 @@ jobs: run: | python -m pip install --upgrade pip setuptools wheel pip install --upgrade --requirement requirements-test.txt + - name: Install Ansible collections and roles + run: | + ansible-galaxy role install --force --role-file requirements.yml + ansible-galaxy collection install --force --requirements-file requirements.yml - name: Set up pre-commit hook environments run: pre-commit install-hooks - name: Run pre-commit on all files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1cad34..76b0901 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,17 +31,17 @@ repos: # Text file hooks - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.33.0 + rev: v0.34.0 hooks: - id: markdownlint args: - --config=.mdl_config.yaml - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.6 + rev: v3.0.0-alpha.9-for-vscode hooks: - id: prettier - repo: https://github.com/adrienverge/yamllint - rev: v1.30.0 + rev: v1.32.0 hooks: - id: yamllint args: @@ -49,17 +49,36 @@ repos: # GitHub Actions hooks - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.22.0 + rev: 0.23.1 hooks: - id: check-github-actions - id: check-github-workflows # pre-commit hooks - repo: https://github.com/pre-commit/pre-commit - rev: v3.2.1 + rev: v3.3.2 hooks: - id: validate_manifest + # Go hooks + - repo: https://github.com/TekWizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + # Style Checkers + - id: go-critic + # StaticCheck + - id: go-staticcheck-repo-mod + # Go Build + - id: go-build-repo-mod + # Go Mod Tidy + - id: go-mod-tidy-repo + # Go Test + - id: go-test-repo-mod + # Go Vet + - id: go-vet-repo-mod + # GoSec + - id: go-sec-repo-mod + # Shell script hooks - repo: https://github.com/cisagov/pre-commit-shfmt rev: v0.0.2 @@ -90,7 +109,7 @@ repos: args: - --config=.bandit.yml - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 @@ -104,31 +123,31 @@ repos: hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.1.1 + rev: v1.3.0 hooks: - id: mypy - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.4.0 hooks: - id: pyupgrade # Ansible hooks - repo: https://github.com/ansible-community/ansible-lint - rev: v5.4.0 + rev: v6.17.0 hooks: - id: ansible-lint # files: molecule/default/playbook.yml # Terraform hooks - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.1 + rev: v1.80.0 hooks: - id: terraform_fmt - id: terraform_validate # Docker hooks - repo: https://github.com/IamTheFij/docker-pre-commit - rev: v2.1.1 + rev: v3.0.1 hooks: - id: docker-compose-check diff --git a/README.md b/README.md index f7e96e1..a32c11f 100644 --- a/README.md +++ b/README.md @@ -95,4 +95,4 @@ with this waiver of copyright interest. ## Author Information ## -David Redmin - +David Redmin - diff --git a/create/playbook.yml b/create/playbook.yml index deb6f52..77d01f5 100644 --- a/create/playbook.yml +++ b/create/playbook.yml @@ -1,10 +1,11 @@ --- # tasks file for create user -- hosts: all +- name: Create user + hosts: all vars: # Default to false; this can be overridden via: - # ansible-playbook --extra-vars="allow_sudo=true" + # ansible-playbook --extra-vars="allow_sudo=true" allow_sudo: false tasks: - name: Create account for user @@ -23,6 +24,7 @@ key: "{{ ssh_public_key }}" - name: Allow user to use sudo without password + when: allow_sudo | bool block: - name: Ensure sudo-nopw group exists ansible.builtin.group: @@ -41,4 +43,3 @@ ansible.builtin.user: name: "{{ username }}" groups: sudo-nopw - when: allow_sudo|bool diff --git a/delete/playbook.yml b/delete/playbook.yml index 1f4d041..cd07816 100644 --- a/delete/playbook.yml +++ b/delete/playbook.yml @@ -1,7 +1,8 @@ --- # tasks file for delete user -- hosts: all +- name: Delete user + hosts: all tasks: - name: Delete account for user ansible.builtin.user: diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..ad0afd8 --- /dev/null +++ b/requirements.yml @@ -0,0 +1,4 @@ +--- +collections: + - name: ansible.posix +roles: [] diff --git a/setup-env b/setup-env index f526cdb..77926bf 100755 --- a/setup-env +++ b/setup-env @@ -65,7 +65,7 @@ done eval set -- "$PARAMS" # Check to see if pyenv is installed -if [ -z "$(command -v pyenv)" ] || [ -z "$(command -v pyenv-virtualenv)" ]; then +if [ -z "$(command -v pyenv)" ] || { [ -z "$(command -v pyenv-virtualenv)" ] && [ ! -f "$(pyenv root)/plugins/pyenv-virtualenv/bin/pyenv-virtualenv" ]; }; then echo "pyenv and pyenv-virtualenv are required." if [[ "$OSTYPE" == "darwin"* ]]; then cat << 'END_OF_LINE' @@ -186,5 +186,5 @@ else: END_OF_LINE )" -# Qapla +# Qapla' echo "Success!"