{"id":18895184,"url":"https://github.com/farisc0de/ansiblemoduleboilerplate","last_synced_at":"2026-02-27T20:30:18.876Z","repository":{"id":246143139,"uuid":"820225560","full_name":"farisc0de/AnsibleModuleBoilerplate","owner":"farisc0de","description":"Bash Ansible Module Boilerplate","archived":false,"fork":false,"pushed_at":"2024-06-26T04:12:41.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T18:38:49.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farisc0de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-06-26T04:00:11.000Z","updated_at":"2024-06-26T04:12:44.000Z","dependencies_parsed_at":"2024-06-26T05:22:15.284Z","dependency_job_id":"e3fe873f-6439-4ec3-b316-bcbb1375ad04","html_url":"https://github.com/farisc0de/AnsibleModuleBoilerplate","commit_stats":null,"previous_names":["farisc0de/ansiblemoduleboilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2FAnsibleModuleBoilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2FAnsibleModuleBoilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2FAnsibleModuleBoilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farisc0de%2FAnsibleModuleBoilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farisc0de","download_url":"https://codeload.github.com/farisc0de/AnsibleModuleBoilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239869612,"owners_count":19710553,"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":[],"created_at":"2024-11-08T08:26:56.988Z","updated_at":"2026-02-27T20:30:18.827Z","avatar_url":"https://github.com/farisc0de.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Module Boilerplate\n\nBash Ansible Module Boilerplate\n\n## Features\n\n- [x] Argument parsing\n- [x] Argument validation\n- [x] Help message\n\n## Exmaple\n\n```bash\n\n#!/bin/bash\n\nsource $1\n\n// Add your functions here\n\nfunction action1() {\n    // Add your code here\n\n    if [ $? -ne 0 ]; then\n        failed=true\n        msg=\"Failed to perform action1\"\n        print_error \"$failed\" \"$msg\"\n    fi\n\n    print_status \"true\" \"Action1 completed successfully\"\n}\n\nfunction print_error() {\n    printf '{\"failed\": %s, \"msg\": \"%s\"}' \"$1\" \"$2\"\n    exit 1\n}\n\nfunction print_status() {\n    printf '{\"changed\": %s, \"msg\": \"%s\"}' \"$1\" \"$2\"\n}\n\ncase $action in\n    action1)\n        // Add your code here\n    *)\n        failed=true\n        msg=\"Invalid action\"\n        print_error \"$failed\" \"$msg\"\n    ;;\nesac\n\nexit 0    \n```\n\n## How to use\n\n```bash\nansible-playbook -i localhost, -e action=action1 -e var1=value1 -e var2=value2 -m /path/to/module\n```\n\n```yaml\n- name: Test module\n  hosts: localhost\n  tasks:\n    - name: Test action1\n      mymodule:\n        action: action1\n        var1: value1\n        var2: value2\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisc0de%2Fansiblemoduleboilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarisc0de%2Fansiblemoduleboilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarisc0de%2Fansiblemoduleboilerplate/lists"}