{"id":20596259,"url":"https://github.com/ulhpc/puppet-sudo","last_synced_at":"2025-07-09T09:36:41.909Z","repository":{"id":20402008,"uuid":"23678051","full_name":"ULHPC/puppet-sudo","owner":"ULHPC","description":"Puppet module to manage sudo and sudoers files","archived":false,"fork":false,"pushed_at":"2024-11-04T20:40:17.000Z","size":219,"stargazers_count":1,"open_issues_count":0,"forks_count":6,"subscribers_count":9,"default_branch":"devel","last_synced_at":"2025-06-22T00:11:29.120Z","etag":null,"topics":["puppet","sudo","sudoers"],"latest_commit_sha":null,"homepage":null,"language":"Puppet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ULHPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/index.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,"zenodo":null}},"created_at":"2014-09-04T20:23:22.000Z","updated_at":"2024-11-04T20:40:14.000Z","dependencies_parsed_at":"2025-04-14T23:50:36.100Z","dependency_job_id":"f9927610-c393-4954-89c8-41835248878c","html_url":"https://github.com/ULHPC/puppet-sudo","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/ULHPC/puppet-sudo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-sudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-sudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-sudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-sudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ULHPC","download_url":"https://codeload.github.com/ULHPC/puppet-sudo/tar.gz/refs/heads/devel","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-sudo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264431823,"owners_count":23607324,"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":["puppet","sudo","sudoers"],"created_at":"2024-11-16T08:15:58.626Z","updated_at":"2025-07-09T09:36:41.866Z","avatar_url":"https://github.com/ULHPC.png","language":"Puppet","funding_links":[],"categories":[],"sub_categories":[],"readme":"-*- mode: markdown; mode: visual-line;  -*-\n\n# Sudo Puppet Module\n\n[![Puppet Forge](http://img.shields.io/puppetforge/v/ULHPC/sudo.svg)](https://forge.puppetlabs.com/ULHPC/sudo)\n[![License](http://img.shields.io/:license-GPL3.0-blue.svg)](LICENSE)\n![Supported Platforms](http://img.shields.io/badge/platform-debian|redhat|centos-lightgrey.svg)\n[![Documentation Status](https://readthedocs.org/projects/ulhpc-puppet-sudo/badge/?version=latest)](https://readthedocs.org/projects/ulhpc-puppet-sudo/?badge=latest)\n\nConfigure and manage sudo and sudoers files\n\n      Copyright (c) 2020 UL HPC Team \u003chpc-sysadmins@uni.lu\u003e\n\n\n| [Project Page](https://github.com/ULHPC/puppet-sudo) | [Sources](https://github.com/ULHPC/puppet-sudo) | [Documentation](https://ulhpc-puppet-sudo.readthedocs.org/en/latest/) | [Issues](https://github.com/ULHPC/puppet-sudo/issues) |\n\n## Synopsis\n\nManage sudo configuration via Puppet.\n\nThis module implements the following elements:\n\n* __Puppet classes__:\n    - `sudo`\n    - `sudo::common`\n    - `sudo::common::debian`\n    - `sudo::common::redhat`\n    - `sudo::params`\n\n* __Puppet definitions__:\n    - `sudo::alias::command`\n    - `sudo::alias::host`\n    - `sudo::alias::user`\n    - `sudo::conf`\n    - `sudo::defaults::spec`\n    - `sudo::directive`\n\nAll these components are configured through a set of variables you will find in\n[`manifests/params.pp`](manifests/params.pp).\n\n_Note_: the various operations that can be conducted from this repository are piloted from a [`Rakefile`](https://github.com/ruby/rake) and assumes you have a running [Ruby](https://www.ruby-lang.org/en/) installation.\nSee `docs/contributing.md` for more details on the steps you shall follow to have this `Rakefile` working properly.\n\n## Dependencies\n\nSee [`metadata.json`](metadata.json). In particular, this module depends on\n\n* [puppetlabs/stdlib](https://forge.puppetlabs.com/puppetlabs/stdlib)\n* [puppetlabs/concat](https://forge.puppetlabs.com/puppetlabs/concat)\n\n## Overview and Usage\n\n### Class `sudo`\n\nThis is the main class defined in this module.\nUse it as follows:\n\n     include ' sudo'\n\nSee also [`tests/init.pp`](tests/init.pp)\n\n### Definition `sudo::directive`\n\nThe definition `sudo::directive` provides a simple way to write sudo configurations parts.\nIf you use a `sudo` version \u003e= 1.7.2, the sudo directive part is validated via\n`visudo` and removed if syntax is not correct.\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent' (BEWARE: it will remove the\n  associated file)\n* `$content`: specify the contents of the directive as a string\n* `$source`: copy a file as the content of the directive.\n\nExample:\n\n      sudo::directive {'admin_users':\n           content =\u003e \"%admin ALL=(ALL) ALL\\n\",\n      }\n\n      sudo::directive {'vagrant':\n        content =\u003e \"%vagrant ALL=(ALL) NOPASSWD: ALL\\n\"\n      }\n\nOn recent version of sudo, this will typically create a new file `/etc/sudoers.d/admin_users` (or `/etc/sudoers.d/vagrant`).\n\nSee also [`tests/directive.pp`](tests/directive.pp)\n\n\n### Definition `sudo::alias::command`\n\nPermits to define a command alias in the `sudoers` files (directive `Cmnd_Alias`)\nThese are groups of related commands...\n\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$commandlist`: List of commands to add in the definition of the alias\n\nExample:\n\n     sudo::alias::command{ 'NETWORK':\n          cmdlist =\u003e [ '/sbin/route', '/sbin/ifconfig', '/bin/ping', '/sbin/dhclient', '/sbin/iptables' ]\n     }\n\nThis will create the following entry in the sudoers files:\n\n     ## Networking\n     Cmnd_Alias NETWORK = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /sbin/iptables\n\nSee also [`tests/alias/command.pp`](tests/alias/command.pp)\n\n### Definition `sudo::alias::user`\n\nPermits to define a user alias in the sudoers files (directive User_Alias)\nThese aren't often necessary, as you can use regular groups\n(ie, from files, LDAP, NIS, etc) in this file - just use `%groupname`\nrather than `USERALIAS`\n\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$commandlist`: list of users to add in the definition of the alias\n\nExample:\n\n      sudo::alias::user{ 'ADMINS':\n          userlist =\u003e [ 'jsmith', 'mikem' ]\n      }\n\nThis will create the following entry in the `sudoers` files:\n\n      User_Alias ADMINS = jsmith, mikem\n\nSee also [`tests/alias/user.pp`](tests/alias/user.pp)\n\n\n### Definition `sudo::defaults::spec`\n\nPermits to define a default specifications\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$content`: specify the contents of the directive as a string\n* `$source`: copy a file as the content of the directive.\n\nExamples\n\n     sudo::defaults::spec { 'env_keep':\n           content =\u003e \"\n      Defaults    env_reset\n      Defaults    env_keep =  \\\"COLORS DISPLAY HOSTNAME LS_COLORS\\\"\n      Defaults    env_keep += \\\"MAIL PS1 PS2 USERNAME LANG LC_ADDRESS LC_CTYPE\\\"\n      Defaults    env_keep += \\\"LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES\\\"\n      Defaults    env_keep += \\\"LC_TIME LC_ALL LANGUAGE\\\"\\n\",\n      }\n\nThis will create the following entry in the sudoers files:\n\n```\nDefaults    env_reset\nDefaults    env_keep =  \"COLORS DISPLAY HOSTNAME LS_COLORS\"\nDefaults    env_keep += \"MAIL PS1 PS2 USERNAME LANG LC_ADDRESS LC_CTYPE\"\nDefaults    env_keep += \"LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES\"\nDefaults    env_keep += \"LC_TIME LC_ALL LANGUAGE\"\n```\n\nSee also [`tests/defaults/spec.pp`](tests/defaults/spec.pp)\n\n\n## Librarian-Puppet / R10K Setup\n\nYou can of course configure the sudo module in your `Puppetfile` to make it available with [Librarian puppet](http://librarian-puppet.com/) or\n[r10k](https://github.com/adrienthebo/r10k) by adding the following entry:\n\n     # Modules from the Puppet Forge\n     mod \"ULHPC-sudo\"\n\nor, if you prefer to work on the git version:\n\n     mod \"ULHPC-sudo\",\n         :git =\u003e 'https://github.com/ULHPC/puppet-sudo',\n         :ref =\u003e 'production'\n\n## Issues / Feature request\n\nYou can submit bug / issues / feature request using the [ULHPC-sudo Puppet Module Tracker](https://github.com/ULHPC/puppet-sudo/issues).\n\n## Developments / Contributing to the code\n\nIf you want to contribute to the code, you shall be aware of the way this module is organized.\nThese elements are detailed on [`docs/contributing.md`](contributing/index.md).\n\nYou are more than welcome to contribute to its development by [sending a pull request](https://help.github.com/articles/using-pull-requests).\n\n## Puppet modules tests within a Vagrant box\n\nThe best way to test this module in a non-intrusive way is to rely on [Vagrant](http://www.vagrantup.com/).\nThe `Vagrantfile` at the root of the repository pilot the provisioning various vagrant boxes available on [Vagrant cloud](https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93\u0026sort=\u0026provider=virtualbox\u0026q=svarrette) you can use to test this module.\n\nSee [`docs/vagrant.md`](vagrant.md) for more details.\n\n## Online Documentation\n\n[Read the Docs](https://readthedocs.org/) aka RTFD hosts documentation for the open source community and the [ULHPC-sudo](https://github.com/ULHPC/puppet-sudo) puppet module has its documentation (see the `docs/` directly) hosted on [readthedocs](http://ulhpc-puppet-sudo.rtfd.org).\n\nSee [`docs/rtfd.md`](rtfd.md) for more details.\n\n## Licence\n\nThis project and the sources proposed within this repository are released under the terms of the [GPL-3.0](LICENCE) licence.\n\n\n[![Licence](https://www.gnu.org/graphics/gplv3-88x31.png)](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulhpc%2Fpuppet-sudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulhpc%2Fpuppet-sudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulhpc%2Fpuppet-sudo/lists"}