{"id":18792872,"url":"https://github.com/deekayen/ansible-pre-commit","last_synced_at":"2025-12-28T14:30:16.925Z","repository":{"id":138908828,"uuid":"339720217","full_name":"deekayen/ansible-pre-commit","owner":"deekayen","description":"Demonstration repository for practicing with pre-commit on an Ansible playbook.","archived":false,"fork":false,"pushed_at":"2021-07-27T04:04:49.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-29T15:30:35.280Z","etag":null,"topics":["ansible","ansible-playbook","pre-commit"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deekayen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"deekayen","ko_fi":"deekayen","liberapay":"deekayen","custom":["paypal.me/deekayen","venmo.com/drdnorman","buymeacoff.ee/deekayen"]}},"created_at":"2021-02-17T12:41:52.000Z","updated_at":"2021-07-27T04:04:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbfc5829-1327-48d3-92c8-e88c9acca4b1","html_url":"https://github.com/deekayen/ansible-pre-commit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deekayen%2Fansible-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deekayen%2Fansible-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deekayen%2Fansible-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deekayen%2Fansible-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deekayen","download_url":"https://codeload.github.com/deekayen/ansible-pre-commit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718375,"owners_count":19685725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-playbook","pre-commit"],"created_at":"2024-11-07T21:22:10.007Z","updated_at":"2025-12-28T14:30:16.861Z","avatar_url":"https://github.com/deekayen.png","language":null,"funding_links":["https://github.com/sponsors/deekayen","https://ko-fi.com/deekayen","https://liberapay.com/deekayen","paypal.me/deekayen","venmo.com/drdnorman","buymeacoff.ee/deekayen"],"categories":[],"sub_categories":[],"readme":"Ansible pre-commit practice\n========\n\nThis repository is meant to practice the installation and use of the [pre-commit](https://pre-commit.com/) utility.\n\n\nInstallation\n---------\n\nFirst, install pre-commit following the [instructions](https://pre-commit.com/#installation) from pre-commit.com.\n\n### Linux\n\n    $ pip install pre-commit\n\n### MacOS\n\nUsing [homebrew](https://brew.sh/):\n\n    $ brew install pre-commit\n\nUsage\n-----\n\nClone this repository:\n\n    git clone git@github.com:deekayen/ansible-pre-commit.git\n\nThen install the git pre-commit hooks\n\n    $ cd ansible-pre-commit\n    $ pre-commit install\n\nTry it\n------\n\nAdd a line to this README file or a task to the `playbook.yml`, then try to make a local commit.\n\n    $ git add .\n    $ git commit -m \"Test pre-commit hooks.\"\n\nThe pre-commit utility will take a few moments on the first run to clone the `ansible-lint` repository and install its dependencies. After it does, it will take a few moments to lint the playbook file and should find a fatal linting problem:\n\n```\nAnsible-lint.............................................................Failed\n- hook id: ansible-lint\n- exit code: 2\n\nWARNING  Listing 1 violation(s) that are fatal\nunnamed-task: All tasks should be named\nplaybook.yml:6 Task/Handler: ping\n\nYou can skip specific rules or tags by adding them to your configuration file:\n# .ansible-lint\nwarn_list:  # or 'skip_list' to silence them completely\n  - unnamed-task  # All tasks should be named\nFinished with 1 failure(s), 0 warning(s) on 1 files.\n```\n\nNote in your local git history that the commit did not save any changes and that your git stage should still have files pending. This error says that the `ping` task should have a `name` on it. Examine the `playbook.yml` and see how this new task would resolve the error.\n\n```\n  tasks:\n    - name: Do a connection test.\n      ping:\n```\n\nAdd the `name` line to the `ping` task and try the commit again. The second run should go much faster, since `ansible-lint` is now already locally installed and the commit should be successful.\n\nThe `pre-commit` utility will work with GUI git utilities and editors, too. You'll only need to run the `pre-commit install` once and then all your other `git` interactions with the folder will automatically include whatever linters you configure in `.pre-commit-config.yaml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeekayen%2Fansible-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeekayen%2Fansible-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeekayen%2Fansible-pre-commit/lists"}