{"id":26693036,"url":"https://github.com/stuvusit/ansible_common","last_synced_at":"2026-02-15T18:31:17.335Z","repository":{"id":18529684,"uuid":"84362407","full_name":"stuvusIT/ansible_common","owner":"stuvusIT","description":"Common Ansible tasks for Debian systems","archived":false,"fork":false,"pushed_at":"2025-03-11T19:53:22.000Z","size":121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T02:54:21.966Z","etag":null,"topics":["ansible","ansible-role","debian","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stuvusIT.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,"zenodo":null}},"created_at":"2017-03-08T20:19:15.000Z","updated_at":"2025-03-11T19:53:23.000Z","dependencies_parsed_at":"2025-05-24T18:42:11.983Z","dependency_job_id":"daf4c275-b55c-45b5-bbec-aa1345beb80d","html_url":"https://github.com/stuvusIT/ansible_common","commit_stats":null,"previous_names":["stuvusit/ansible_common","stuvusit/common"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stuvusIT/ansible_common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuvusIT%2Fansible_common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuvusIT%2Fansible_common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuvusIT%2Fansible_common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuvusIT%2Fansible_common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stuvusIT","download_url":"https://codeload.github.com/stuvusIT/ansible_common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuvusIT%2Fansible_common/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263917624,"owners_count":23529612,"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-role","debian","ubuntu"],"created_at":"2025-03-26T17:47:26.193Z","updated_at":"2026-02-15T18:31:17.291Z","avatar_url":"https://github.com/stuvusIT.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# common\n\n- Installs commonly used packages\n- Creates administrator accounts and adds them to the `wheel`, `ssh-users` and `sudo` groups\n- Removes `root`s password\n- Sets language, locales and keyboard layout\n- Configures hostname settings (hostname and `/etc/hosts`)\n\n## Requirements\n\n- Remotely: A Debian-based distribution.\n- Locally: Ansible 2.9 or newer with the `ansible.posix` collection installed.\n\n## Role Variables\n\n| Name                                  |               Default                | Description                                                                                                           |\n| :------------------------------------ | :----------------------------------: | :-------------------------------------------------------------------------------------------------------------------- |\n| `common_admin_users`                  |                 `{}`                 | Dict of admin users, see [User configuration](#User configuration)                                                    |\n| `common_users`                        |                 `{}`                 | Dict of normal users, see [User configuration](#User configuration)                                                   |\n| `common_jumphost_users`               |                 `{}`                 | Dict of users that are allowed to use this host as SSH proxy jump host, see [User configuration](#User configuration) |\n| `common_default_admin_user_groups`    | `[adm,dialout,ssh-users,sudo,wheel]` | Default groups to set for admin users                                                                                 |\n| `common_default_user_groups`          |                 `[]`                 | Default groups to set for normal users                                                                                |\n| `common_default_jumphost_user_groups` |            `[ssh-users]`             | Default groups to set for JumpHost users                                                                              |\n| `common_ensure_system_groups`         |       `[ssh-users,sudo,wheel]`       | List of groups to create                                                                                              |\n| `common_locales`                      |           `[en_US.UTF-8]`            | List of locales to install                                                                                            |\n| `common_keyboard_layout`              |               `us,de`                | TTY keyboard layout                                                                                                   |\n| `common_default_language`             |            `en_US.UTF-8`             | Default language                                                                                                      |\n| `common_skip_packages`                |               `False`                | Whether to skip installation of any packages (including extra packages).                                              |\n| `common_extra_packages`               |  see [defaults](defaults/main.yml)   | Common extra packages to install (like less or htop)                                                                  |\n| `common_extra_keys`                   |  see [defaults](defaults/main.yml)   | Common extra repo key urls to install                                                                                 |\n| `common_extra_repos`                  |  see [defaults](defaults/main.yml)   | Common extra repo urls to install                                                                                     |\n| `common_extra_files`                  |                 `{}`                 | A dict with templates for extra files to create on the machine. See [#extra-files].                                   |\n\n### User configuration\n\nEach key in the respective users dict shall be a username (used to log in), with the following dict as a value:\n\n| Name            | Mandatory / Default | Description                                                                                                                                                                       |\n| :-------------- | :-----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `name`          | :heavy_check_mark:  | The full name of the admin user                                                                                                                                                   |\n| `shell`         |     `/bin/bash`     | Path to the shell to set for this admin (this key is ignored for `common_jumphost_users`)                                                                                         |\n| `keys`          |        `[]`         | List of SSH keys that allow this user to login or proxy-jump via SSH                                                                                                              |\n| `passwd`        |                     | [hashed](http://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module) passphrase                                                             |\n| `allowed_hosts` |        `[]`         | List of hosts and ports to which the user is allowed to jump to (via the current host). The format is `{{ ip }}:{{ port }}`. This key is only parsed for `common_jumphost_users`. |\n| `groups`        |        `[]`         | List of groups the user will be added to. This key overrides the default groups mentioned above (`common_default_user_groups` etc.)`.                                             |\n\n### Extra Files\n\nThe dict `common_extra_files` configures extra files to create on the machine.\nEach key must be a file path on the target machine and the containing directory must already exist\non the machine.\nThe corresponding value is a dict containing an `_module` key to choose the Ansible module used to\ncreate the file and additional key-value pairs that will be passed to that module.\nSupported modules (for `_module`) are `copy`, `template` and `get_url`.\nExamples:\n\n```yml\ncommon_extra_files:\n  /etc/zsh/zshrc:\n    _module: copy\n    src: zshrc # copies the file from ./files/zshrc\n  /usr/local/bin/hello-world.sh:\n    _module: copy\n    content: |\n      #!/usr/bin/env bash\n      echo Hello, World!\n    mode: 0755\n  /etc/systemd/resolved.conf:\n    _module: template\n    src: resolved.conf.j2 # instantiates the file from ./templates/resolved.conf.j2\n  /usr/local/bin/danebot.py:\n    _module: get_url\n    url: https://raw.githubusercontent.com/stuvusIT/danebot/main/src/danebot.py\n    mode: 0755\n```\n\n## Example Playbook\n\n```yml\n- hosts: web01\n  roles:\n    - role: common\n      common_admin_users:\n        max:\n          name: Max Mustermann\n          shell: /usr/bin/zsh\n          keys:\n            - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5aaaaIEFmmHsB7LgVMmujy51QfoSS9hnN7GMEm+Mkcg1YVJnn max123\n            - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5aaaaIEFmmHsB7LgVMmujy51QfoSS9hnN7GMEm+Mkcg1YVJnn max321\n          passwd: $6$mDFWEb5pDY$C9ZTuNjTTSyh0uIBoZALAV6isFY4dO8gBN2/xJ0yX2rejvr2wKp/wMmHwvoC.gD8NaeozxjhWvNHp3rJEJdJj1\n        lena:\n          name: Lena Mustermann\n          keys:\n            - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5aaaaIEFmmHsB7LgVMmujy51QfoSS9hnN7GMEm+Mkcg1YVJnn max123\n          groups:\n            - users\n            - ssh-users\n            - wheel\n      common_jumphost_users:\n        tim:\n          name: Tim Mustermann\n          keys:\n            - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5aaaaIEFmmHsB7LgVMmujy51QfoSS9hnN7GMEm+Mkcg1YVJnn timey\n          allowed_hosts:\n            - 196.168.1.5:22\n      common_users:\n        tom:\n          name: Tom Haverford\n          groups:\n            - users\n            - ssh-users\n      common_default_language: de_DE.UTF-8\n      common_keyboard_layout: de\n      common_locales:\n        - de_DE.UTF-8\n        - en_US.UTF-8\n      # common_extra_files: # see the subsection above\n```\n\n## License\n\n\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\"\u003e\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-sa/4.0/80x15.png\" /\u003e\u003c/a\u003e\u003cbr /\u003eThis work is licensed under a \u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\"\u003eCreative Commons Attribution-ShareAlike 4.0 International License\u003c/a\u003e.\n\n## Author Information\n* [Markus Mroch (Mr. Pi)](https://github.com/Mr-Pi) _markus.mroch@stuvus.uni-stuttgart.de_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuvusit%2Fansible_common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuvusit%2Fansible_common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuvusit%2Fansible_common/lists"}