{"id":23714370,"url":"https://github.com/calinradoni/ansible-ubuntu-workstation","last_synced_at":"2026-04-05T08:34:26.084Z","repository":{"id":182075689,"uuid":"423595269","full_name":"CalinRadoni/ansible-ubuntu-workstation","owner":"CalinRadoni","description":"Roles meant to be used after a basic Ubuntu installation: custom keyboard layouts, vscode and extensions, dconf and common ones","archived":false,"fork":false,"pushed_at":"2023-11-02T21:52:04.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T11:48:18.532Z","etag":null,"topics":["ansible","ansible-module","ansible-roles","clamav","dconf","git","nodejs","podman","teams","ubuntu","vscode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CalinRadoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-GPLv3.txt","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":"2021-11-01T19:44:48.000Z","updated_at":"2021-12-27T20:51:31.000Z","dependencies_parsed_at":"2025-05-26T07:05:20.216Z","dependency_job_id":null,"html_url":"https://github.com/CalinRadoni/ansible-ubuntu-workstation","commit_stats":null,"previous_names":["calinradoni/ansible-ubuntu-workstation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CalinRadoni/ansible-ubuntu-workstation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalinRadoni%2Fansible-ubuntu-workstation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalinRadoni%2Fansible-ubuntu-workstation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalinRadoni%2Fansible-ubuntu-workstation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalinRadoni%2Fansible-ubuntu-workstation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CalinRadoni","download_url":"https://codeload.github.com/CalinRadoni/ansible-ubuntu-workstation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalinRadoni%2Fansible-ubuntu-workstation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31430009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"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","ansible-module","ansible-roles","clamav","dconf","git","nodejs","podman","teams","ubuntu","vscode"],"created_at":"2024-12-30T20:19:15.443Z","updated_at":"2026-04-05T08:34:26.060Z","avatar_url":"https://github.com/CalinRadoni.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible roles for Ubuntu laptop or desktop install\n\n**Note 1**: This repository is not a finished product ! For me it seems too complex to be used at large.\nFor quick tasks I am using simpler playbooks and scripts, like those from the [Scripts](https://github.com/CalinRadoni/Scripts) repository.\n\n**Note 2**: Coding best practices, linting and so on were not a priority for this repository, some of these are tests and proof of concept code !\n\n**Note 3 begin**: I am rebuilding this repository. Someof the changes that must be done:\n\n- the **settings** section from `vscode` role MUST be rebuilt\n- `vscode` role should be rebuilt to include the *profiles* feature\n- `wordlists` role MUST be rebuilt\n\n**Note 3 end**.\n\nThis repository contains some roles meant to be used after a basic Ubuntu installation.\nThe defined roles are:\n\n- `common` install the apps defined in `common_apps`, `group_apps` and `host_apps` variables\n- `clamav` installs clamav and freshclam then sets the number of checks per day\n- `dconf`, see it's source for description of functionality\n- `firewall` installs `nftables` and `firewalld`\n- `git` installs `git` and sets it's global settings from the `git_global_options` variable\n- `hydra` installs THC Hydra\n- `keyboard` adds custom keyboard profiles / layouts. It contains keyboard layouts for converting a laptop keyboard to a **Tenkeyless**-like one, using the numberpad as navigation keys. See [this](https://calinradoni.github.io/pages/211101-laptoptenkeyless.html) post for details.\n- `kicad` installs a `KiCad` version from it's ppa\n- `nodejs` installs `Node.js` from `nodesource.com` repository\n- `podman` installs `podman`, `buildah`, `slirp4netns` and `fuse-overlayfs`. In Ubuntu 20.04 uses the [Kubic project](https://build.opensuse.org/package/show/devel:kubic:libcontainers:stable/podman) provided packages. For other distributions uses the default repositories.\n- `python` installs `python3`, `python3-pip` and `python3-venv`\n- `ruby_bundler` installs `ruby-full` and `ruby-bundler`\n- `setuser` sets basic user properties, see it's source for description of functionality\n- `teams_insiders` installs `Teams Insiders` from Microsoft's repository\n- `vim` installs `vim` and sets `/etc/vim/vimrc.local`\n- `vscode` installs `Visual Studio Code` from Microsoft's repository, extensions and custom user settings. For extensions I have built an Ansible module.\n- `wordlists` downloads wordlists into user's `~/wordlists` directory. Downloading is implemented from [SkullSecurity.org](https://wiki.skullsecurity.org/index.php/Passwords), [KaliLists/dirbuster](https://github.com/3ndG4me/KaliLists/tree/master/dirbuster) and from any complete URL.\n- `zaproxy` installs OWASP ZAP using the official [ZAP Linux Repos](https://software.opensuse.org/download.html?project=home%3Acabelo\u0026package=owasp-zap)\n\nThis is a *work-in-progress* and should be tested before use.\n\n## Testing\n\nTo test playbooks, roles and tasks I use physical and virtual hosts.\n\nUsing `lxc`, a simple virtual system container can be created with:\n\n```sh\nlxc launch images:ubuntu/22.04 jammy-container\n\n# set a password for 'ubuntu' user\npass='uuu'\nlxc exec jammy-container -- sh -c \"echo \\\"ubuntu:$pass\\\" | chpasswd\"\n\n# install OpenSSH server\nlxc exec jammy-container -- sh -c 'apt update \u0026\u0026 apt -y install openssh-server'\n\n# find the IPv4 address of the container\naddr=\"$(lxc info jammy-container | grep 'inet:' | grep -v '127.0.0.1' | cut -d: -f2 | cut -d/ -f1 | tr -d ' ')\" \u0026\u0026 echo \"$addr\"\n\n# try a connection to add the key to known_hosts file\nssh -l ubuntu \"$addr\"\n```\n\nand cleaned up with:\n\n```sh\nlxc stop jammy-container\nlxc delete jammy-container\n```\n\n## About Ansible\n\nYou may start by reading [Ansible notes and quick start](https://calinradoni.github.io/pages/230129-ansible-notes-qs.html)\n\n## Usage\n\nOn the control host (the local host if the roles will be launched from this host) run:\n\n```sh\nsudo apt update\nsudo apt install software-properties-common\nsudo apt install python3 python3-pip python3-venv python3-jmespath python3-psutil\nsudo add-apt-repository --yes --update ppa:ansible/ansible\nsudo apt install ansible ansible-lint\n\n# install the requirements with\n[[ -r requirements.yml ]] \u0026\u0026 ansible-galaxy collection install -r requirements.yml\n# to upgrade all collections from a 'requirements.yml' file use:\n# [[ -r requirements.yml ]] \u0026\u0026 ansible-galaxy collection install --upgrade -r requirements.yml\n# or, to upgrade a single collection, use:\n# ansible-galaxy collection install --upgrade \u003ccollection_name\u003e\n```\n\n### With inventory file(s)\n\nIn the root directory of the repository create the `inventories/production` directory.\nInside the `inventories/production` directory copy the content of the `inventories/example` directory.\n\nThe default configuration files are `inventories/production/all.yml`, where you should put the common settings, and `inventories/production/desktops.yml` and `inventories/production/laptops.yml` for specific ones.\n\n**Modify !** the files for your environment, mostly:\n\n- `local_user_name` should be the name of your standard user;\n- set the content of `git_global_options` as needed;\n- enable the roles that you want in `site.yml`.\n\nThen, for *production* environment, use:\n\n```sh\n# if configuring a laptop\nansible-playbook --ask-become-pass -i inventories/production --limit laptop_local site.yml\n\n# if configuring a desktop\nansible-playbook --ask-become-pass -i inventories/production --limit desktop_local site.yml\n```\n\n### Without inventory file\n\nAll needed variables must be passed on the command line.\nRead [Defining variables at runtime](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#id37) for more information.\n\n**Warning**: Some roles will not work if their variables are not set.\n\nHere are some simple examples:\n\n```sh\n# run the playbook against localhost\nansible-playbook -i 127.0.0.1, \\\n    --become --ask-become-pass \\\n    -e 'ansible_connection=local' \\\n    -e 'local_user_name=your_user_name' \\\n    site.yml\n\n# run the playbook against the remote host 192.168.5.123\nansible-playbook -i 192.168.5.123, \\\n    --become --ask-become-pass \\\n    -e 'local_user_name=your_user_name' \\\n    site.yml\n```\n\n## Development\n\nWhen using [Visual Studio Code](https://code.visualstudio.com/) as editor, add the [Ansible VS Code Extension by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.ansible) and install [Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/):\n\n```sh\nsudo python3 -m pip install ansible-lint\n```\n\n### Python modules\n\n`cd` to the root directory of the repository and create a python virtual environment:\n\n```sh\n[ ! -d .venv ] \u0026\u0026 python3 -m venv .venv\nsource .venv/bin/activate\npython3 -m pip install psutil\ndeactivate\n```\n\nTo test `vscode_extension_installer.py` :\n\n```sh\n# activate the venv\nsource .venv/bin/activate\n\n# create a file to pass arguments to the vscode_extension_installer module\nmkdir -p tmp\ncat \u003c\u003c 'EOF' \u003e tmp/test_args.json\n{\n    \"ANSIBLE_MODULE_ARGS\": {\n        \"name\": \"redhat.ansible\"\n    }\n}\nEOF\n\n# test the vscode_extension_installer module\npython roles/vscode/library/vscode_extension_installer.py tmp/test_args.json\n```\n\n## License\n\nThis repository is licensed under the terms of [GNU GPLv3](http://www.gnu.org/licenses/gpl-3.0.html) license. See the `LICENSE-GPLv3.txt` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalinradoni%2Fansible-ubuntu-workstation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalinradoni%2Fansible-ubuntu-workstation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalinradoni%2Fansible-ubuntu-workstation/lists"}