{"id":18906536,"url":"https://github.com/claranet/ansible-role-sudo","last_synced_at":"2026-02-01T03:06:43.779Z","repository":{"id":148145248,"uuid":"577821649","full_name":"claranet/ansible-role-sudo","owner":"claranet","description":"Install and configure sudo","archived":false,"fork":false,"pushed_at":"2024-07-04T13:06:56.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-15T19:13:38.101Z","etag":null,"topics":["ansible","claranet","role","sudo"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claranet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2022-12-13T15:50:51.000Z","updated_at":"2024-12-11T14:58:35.000Z","dependencies_parsed_at":"2024-12-31T11:32:11.362Z","dependency_job_id":"38a2a34e-4c0f-4ea5-b5bb-eca6f3712e32","html_url":"https://github.com/claranet/ansible-role-sudo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/claranet/ansible-role-sudo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-sudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-sudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-sudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-sudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claranet","download_url":"https://codeload.github.com/claranet/ansible-role-sudo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-sudo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","claranet","role","sudo"],"created_at":"2024-11-08T09:16:41.252Z","updated_at":"2026-02-01T03:06:43.761Z","avatar_url":"https://github.com/claranet.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible role - sudo\n[![Maintainer](https://img.shields.io/badge/maintained%20by-claranet-e00000?style=flat-square)](https://www.claranet.fr/)\n[![License](https://img.shields.io/github/license/claranet/ansible-role-sudo?style=flat-square)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/claranet/ansible-role-sudo?style=flat-square)](https://github.com/claranet/ansible-role-sudo/releases)\n[![Status](https://img.shields.io/github/workflow/status/claranet/ansible-role-sudo/Ansible%20Molecule?style=flat-square\u0026label=tests)](https://github.com/claranet/ansible-role-sudo/actions?query=workflow%3A%22Ansible+Molecule%22)\n[![Ansible version](https://img.shields.io/badge/ansible-%3E%3D2.10-black.svg?style=flat-square\u0026logo=ansible)](https://github.com/ansible/ansible)\n[![Ansible Galaxy](https://img.shields.io/badge/ansible-galaxy-black.svg?style=flat-square\u0026logo=ansible)](https://galaxy.ansible.com/claranet/sudo)\n\n\n\u003e :star: Star us on GitHub — it motivates us a lot!\n\nInstall and Configure sudo\n\n## :warning: Requirements\n\nAnsible \u003e= 2.10\n\n## :zap: Installation\n\n```bash\nansible-galaxy install claranet.sudo\n```\n\n## :gear: Role variables\n\nVariable                          | Default value                     | Description\n----------------------------------|-----------------------------------|---------------------------------------------------------\nsudo_config_directory             | /etc/sudoers.d                    | directory which contains sudo rigths files\nsudo_allow_install_package        | true                              | install sudo package before set rigths\nsudo_rights                       | {}                                | contains all sudo rigths to set: :point_right: [attributes description of variable sudo_rights](#gear-attributes-of-variable-sudo_rights)\nsudo_purge_others_config          | false                             | purge others file which aren't in our sudo rights configuration\nsudo_command_aliases              | {}                                | set command alias: name of command alias as key and list of commands as value\nsudo_user_aliases                 | {}                                | set user alias: name of user alias as key and list of users as value\nsudo_host_aliases                 | {}                                | set host alias: name of host alias as key and list of host as values\nsudo_runas_aliases                | {}                                | set sudoers run as\n\n\n## :gear: Attributes of variable sudo_rights\n- **name**: String which represent the name of user or group to give the rights. For group, use **%name_of_group**\n- **no_passwd**: Boolean attribut for set if we want to use command(s) with or without password\n- **from_hosts**: String which specify hosts where we can make these actions \n- **as_user**: User to substitute for execute commands\n- **as_group**: Group to substitute for execute commands\n- **commands**: List of commands which can be execute by sudoers\n- **state**: can be present or absent for add or delete rigths.\n\n## :arrows_counterclockwise: Dependencies\n\nN/A\n\n## :pencil2: Example Playbook\n\n```yaml\n---\n- hosts: all\n  vars:\n      sudo_purge_others_config: true\n\n      sudo_user_aliases:\n        test: [\"secondusersudo\", \"firstusersudo\"]\n\n      sudo_command_aliases:\n        SHUTDOWN: [\"/usr/sbin/reboot\",\"/usr/sbin/poweroff\"]\n      \n      sudo_rights:\n        allowrebootsudo:                          # required\n          - name: \"TEST\"                          # required\n            no_passwd: true                       # default is false\n            from_hosts: ALL                       # can be ommit, default is ALL\n            as_user: ALL                          # can be ommit, default is ALL\n            as_group: ALL                         # can be ommit, default is ALL\n            commands: SHUTDOWN                    # required\n            state: present                        # can be ommit, default is present\n\n        allowtailsudo:                            # second user's rights\n          - name: \"firstusersudo\"\n            no_passwd: true\n            from_hosts: ALL\n            as_user: ALL\n            as_group: ALL\n            commands:\n              - /usr/bin/tail -f /dev/null\n            state: present\n    roles:\n      - role: claranet.sudo\n        become: true\n\n```\n\n\n\n## :closed_lock_with_key: [Hardening](HARDENING.md)\n\n## :heart_eyes_cat: [Contributing](CONTRIBUTING.md)\n\n## :copyright: [License](LICENSE)\n\n[Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaranet%2Fansible-role-sudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaranet%2Fansible-role-sudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaranet%2Fansible-role-sudo/lists"}