{"id":18647701,"url":"https://github.com/artcom/ansible-role-check-required-variables","last_synced_at":"2025-11-05T07:30:29.773Z","repository":{"id":142420050,"uuid":"294683802","full_name":"artcom/ansible-role-check-required-variables","owner":"artcom","description":"Ansible role that checks that required variables are defined","archived":false,"fork":false,"pushed_at":"2025-01-06T11:03:48.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-01-06T11:38:54.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/artcom.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":"2020-09-11T12:01:31.000Z","updated_at":"2025-01-06T10:56:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"df7b7abf-98e8-4301-a932-8fe7036f4e23","html_url":"https://github.com/artcom/ansible-role-check-required-variables","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fansible-role-check-required-variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fansible-role-check-required-variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fansible-role-check-required-variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fansible-role-check-required-variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artcom","download_url":"https://codeload.github.com/artcom/ansible-role-check-required-variables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449681,"owners_count":19640565,"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-07T06:27:32.840Z","updated_at":"2025-11-05T07:30:29.731Z","avatar_url":"https://github.com/artcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Check Required Variables\n\nAnsible role that checks that required variables are defined.\n\n## Requirements\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below, along with default values `(see defaults/main.yml)`:\n\n```yaml\nrequired_vars: {}\n```\n\nSet required variables to null e.g in `defaults/main.yml` otherwise the role will fail if the variable is not defined with the following error:\n\n```bash\n\"Unable to look up a name or access an attribute in template string ({{ required_vars | dict2items }}).\\nMake sure your variable name does not contain invalid characters like '-': dict2items requires a dictionary, got \u003cclass 'ansible.template.native_helpers.AnsibleUndefined'\u003e instead.. dict2items requires a dictionary, got \u003cclass 'ansible.template.native_helpers.AnsibleUndefined'\u003e instead.\"\n```\n\n```yaml\n# defaults/main.yml\nvar1_name: null\nvar2_name: null\n```\n\nPass the variable to check to `required_vars`:\n\n```yaml\nrequired_vars:\n  var1_name: \"{{ var1_name }}\"\n  var2_name: \"{{ var2_name }}\"\n```\n\nAdd `no_log` option for `silent_vars`:\n\n```yaml\nsilent_vars:\n  - \"var1_name\"\n```\n\n## Dependencies\n\nNone.\n\n# Example Playbook\n\n```yaml\n- name: Check required variables\n  hosts: all\n  become: true\n  roles:\n    - role: check-required-variables\n      required: \"some value\"\n      required_vars:\n        required: \"{{ required }}\"\n```\n\n## Test\n\n### Requirements\n\n- python \u003e= 3.12\n- docker\n\n### Run\n\n```bash\npip install -r requirements.txt\nmolecule test --all\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fansible-role-check-required-variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartcom%2Fansible-role-check-required-variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fansible-role-check-required-variables/lists"}