├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── .gitignore ├── .markdownlint.json ├── .pre-commit-config.yaml ├── .yamllint ├── AUTHORS.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── ansible.cfg ├── default.desktop.config.yml ├── default.terminal.config.yml ├── group_vars ├── all │ └── ohmyzsh.yml ├── desktop │ ├── apt.yml │ ├── flatpak.yml │ ├── host_arch.yml │ ├── snap.yml │ ├── vs_code.yml │ └── wifi_powersave.yml └── terminal │ ├── apt.yml │ ├── gem.yml │ ├── node.yml │ ├── pip.yml │ └── pipx.yml ├── home-local-bin.sh ├── img ├── Ansible-Wordmark-RGB-White.svg ├── plus.svg └── ubuntu_orange_hex.svg ├── inventory ├── playbook_desktop.yml ├── playbook_terminal.yml ├── requirements.yml ├── run_desktop.sh ├── run_terminal.sh ├── scripts ├── before_install_apt_dependencies.sh ├── before_script_path_fix.sh ├── install_python3_dependencies.sh ├── lint.sh ├── makefile_targets_from_ansible_tags.py └── requirements.txt └── tasks ├── airpods-pro-bluetooth-fix.yml ├── code-extensions.yml ├── deb ├── stacer.yml └── ulauncher.yml ├── debug.yml ├── extra-desktop-packages.yml ├── extra-packages.yml ├── flatpak.yml ├── home-local-bin.yml ├── nextcloud.yml ├── ppa ├── appimagelauncher.yml ├── caffeine.yml ├── liquorix.yml ├── terraform.yml └── timeshift.yml ├── snap.yml ├── universe-repository.yml └── wifi-powersave-mode.yml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | --- 2 | github: [iancleary] 3 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: CI 3 | 4 | on: push 5 | 6 | env: 7 | hostname: runner 8 | 9 | jobs: 10 | lint: 11 | runs-on: ubuntu-22.04 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | - name: Setup Linters 16 | run: | 17 | python3 -m pip install pre-commit 18 | python3 -m pip install ansible-lint 19 | pre-commit install 20 | - name: lint 21 | run: | 22 | make lint 23 | 24 | terminal: 25 | runs-on: ubuntu-22.04 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@v2 29 | - name: before_install 30 | run: | 31 | make bootstrap-before-install 32 | - name: before_script 33 | run: | 34 | make bootstrap-before-script 35 | - name: install 36 | run: | 37 | make bootstrap-install 38 | - name: install galaxy roles 39 | run: | 40 | make galaxy-requirements 41 | - name: terminal 42 | run: | 43 | make terminal-github-runner 44 | 45 | desktop: 46 | runs-on: ubuntu-22.04 47 | steps: 48 | - name: Checkout 49 | uses: actions/checkout@v2 50 | - name: before_install 51 | run: | 52 | make bootstrap-before-install 53 | - name: before_script 54 | run: | 55 | make bootstrap-before-script 56 | - name: install 57 | run: | 58 | make bootstrap-install 59 | - name: install galaxy roles 60 | run: | 61 | make galaxy-requirements 62 | - name: desktop 63 | run: make desktop-github-runner 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # Pipenv 76 | Pipfile 77 | Pipfile.lock 78 | 79 | # pyenv 80 | .python-version 81 | 82 | # celery beat schedule file 83 | celerybeat-schedule 84 | 85 | # SageMath parsed files 86 | *.sage.py 87 | 88 | # Environments 89 | .env 90 | .venv 91 | env/ 92 | venv/ 93 | ENV/ 94 | env.bak/ 95 | venv.bak/ 96 | 97 | # Spyder project settings 98 | .spyderproject 99 | .spyproject 100 | 101 | # Rope project settings 102 | .ropeproject 103 | 104 | # mkdocs documentation 105 | /site 106 | 107 | # mypy 108 | .mypy_cache/ 109 | 110 | # node 111 | node_modules 112 | /dist 113 | 114 | # local env files 115 | .env.local 116 | .env.*.local 117 | 118 | # Log files 119 | npm-debug.log* 120 | yarn-debug.log* 121 | yarn-error.log* 122 | 123 | # Editor directories and files 124 | .idea 125 | # .vscode # I want my cspell tracked across machines 126 | *.suo 127 | *.ntvs* 128 | *.njsproj 129 | *.sln 130 | *.sw? 131 | 132 | # unknown 133 | .DS_Store 134 | 135 | # VS Code 136 | .vscode 137 | 138 | # Private inventory file 139 | .inventory 140 | 141 | # Private group_vars subfolders 142 | # This ignores subfolders, but tracks all 143 | # https://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder 144 | !group_vars/desktop/ 145 | !group_vars/vm/ 146 | !group_vars/all/ 147 | # you could add other folders here by copying the above line 148 | # 149 | # (run.sh creates a group_vars/hostname/ folder for your hostname) 150 | # This allows more than just me to use this repo 151 | # note that group_vars/all/*.yml is version controlled 152 | 153 | # Overrides of default.config.yml 154 | config.yml 155 | 156 | # Spec Driven Templates 157 | Makefile.template 158 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "line_length": false 3 | } 4 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | repos: 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: v2.3.0 5 | hooks: 6 | - id: check-yaml 7 | - id: end-of-file-fixer 8 | - id: trailing-whitespace 9 | - repo: local 10 | hooks: 11 | - id: ansible-lint 12 | name: Ansible-lint 13 | description: This hook runs ansible-lint. 14 | entry: ansible-lint -v --force-color 15 | language: python 16 | # do not pass files to ansible-lint, see: 17 | # https://github.com/ansible/ansible-lint/issues/611 18 | pass_filenames: false 19 | always_run: true 20 | additional_dependencies: 21 | # https://github.com/pre-commit/pre-commit/issues/1526 22 | # If you want to use specific version of ansible-core or ansible, feel 23 | # free to override `additional_dependencies` in your own hook config 24 | # file. 25 | - . 26 | - ansible-core>=2.13.3 27 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | # This is my first, very own configuration file for yamllint! 3 | # It extends the default conf by adjusting some options. 4 | 5 | # https://yamllint.readthedocs.io/en/stable/configuration.html 6 | 7 | extends: default 8 | 9 | rules: 10 | # 80 chars should be enough, but don't fail if a line is longer 11 | line-length: 12 | max: 200 13 | level: warning 14 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Authors 2 | 3 | To be compliant with the licenses of source work used in the project, 4 | their repositories' licenses are included below. 5 | 6 | ## mac-dev-playbook 7 | 8 | The default.config.yml file and corresponding code was adapted from 9 | 10 | 11 | 12 | Copyright (c) 2013 Michael Griffin 13 | 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | ## Idea for run*.sh scripts 22 | 23 | 24 | 25 | [MIT License](https://github.com/JBKahn/provisioning-local/commit/e7dd4c898b6b64ad58dbfb4f6b3c212a56b55ae9) 26 | 27 | The MIT License (MIT) 28 | 29 | Copyright (c) 2015 Joseph Ben-zion Kahn 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in all 39 | copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 47 | SOFTWARE. 48 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | Please note we have a code of conduct, please follow it in all your interactions with the project. 7 | 8 | ## First Steps to fix an issue or bug 9 | 10 | - Read the documentation (working on adding more) 11 | - create the minimally reproducible issue 12 | - try to edit the relevant code and see if it fixes it 13 | - submit the fix to the problem as a pull request 14 | - include an explanation of what you did and why 15 | 16 | ## First steps to contribute new features 17 | 18 | - Create an issue to discuss the feature's scope and its fit for this package 19 | - run pytest to ensure your local version of code passes all unit tests 20 | - try to edit the relevant code and implement your new feature in a backwards compatible manner 21 | - create new tests as you go, and run the test suite as you go 22 | - update the documentation as you go 23 | 24 | ### Please format and lint as you go 25 | 26 | #### Linting 27 | 28 | Linting is performed on common file types: 29 | 30 | - YAML files with [yamllint](https://yamllint.readthedocs.io/) 31 | - Bash files with [shellcheck](https://www.shellcheck.net/) 32 | - Markdown files with [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) 33 | 34 | The [Makefile](https://github.com/icancclearynow/ubuntu-dev-playbook/blob/main/Makefile) is the entry point. 35 | 36 | ```bash 37 | make lint 38 | ``` 39 | 40 | #### Testing 41 | 42 | Continuous Integration Testing is done with the 43 | [.travis.yml](https://github.com/icancclearynow/ubuntu-dev-playbook/blob/main/.travis.yml) file and [PyUp](https://pyup.io/). 44 | 45 | Multiple jobs test independent portions of the installation. 46 | 47 | ### Requirements to merge code (Pull Request Process) 48 | 49 | - you must include test coverage 50 | - you must update the documentation 51 | - you must run the above scripts to format and line 52 | 53 | ## Pull Request Process 54 | 55 | 1. Ensure you include test coverage for all changes 56 | 2. Ensure your code is formatted properly via the command above 57 | 3. Update the documentation and the README.md with details of changes to the interface, this includes new environment 58 | variables, function names, decorators, etc.. 59 | 4. Increase the version numbers in any examples files and the README.md to the new version that this 60 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 61 | 5. You may merge the Pull Request in once you have the sign-off of another developers, or if you 62 | do not have permission to do that, you may request the reviewer to merge it for you. 63 | 64 | --- 65 | 66 | ## Code of Conduct 67 | 68 | ### Our Pledge 69 | 70 | In the interest of fostering an open and welcoming environment, we as 71 | contributors and maintainers pledge to making participation in our project and 72 | our community a harassment-free experience for everyone, regardless of age, body 73 | size, disability, ethnicity, gender identity and expression, level of experience, 74 | nationality, personal appearance, race, religion, or sexual identity and 75 | orientation. 76 | 77 | ### Our Standards 78 | 79 | Examples of behavior that contributes to creating a positive environment 80 | include: 81 | 82 | - Using welcoming and inclusive language 83 | - Being respectful of differing viewpoints and experiences 84 | - Gracefully accepting constructive criticism 85 | - Focusing on what is best for the community 86 | - Showing empathy towards other community members 87 | 88 | Examples of unacceptable behavior by participants include: 89 | 90 | - The use of sexualized language or imagery and unwelcome sexual attention or 91 | advances 92 | - Trolling, insulting/derogatory comments, and personal or political attacks 93 | - Public or private harassment 94 | - Publishing others' private information, such as a physical or electronic 95 | address, without explicit permission 96 | - Other conduct which could reasonably be considered inappropriate in a 97 | professional setting 98 | 99 | ### Our Responsibilities 100 | 101 | Project maintainers are responsible for clarifying the standards of acceptable 102 | behavior and are expected to take appropriate and fair corrective action in 103 | response to any instances of unacceptable behavior. 104 | 105 | Project maintainers have the right and responsibility to remove, edit, or 106 | reject comments, commits, code, wiki edits, issues, and other contributions 107 | that are not aligned to this Code of Conduct, or to ban temporarily or 108 | permanently any contributor for other behaviors that they deem inappropriate, 109 | threatening, offensive, or harmful. 110 | 111 | ### Scope 112 | 113 | This Code of Conduct applies both within project spaces and in public spaces 114 | when an individual is representing the project or its community. Examples of 115 | representing a project or community include using an official project e-mail 116 | address, posting via an official social media account, or acting as an appointed 117 | representative at an online or offline event. Representation of a project may be 118 | further defined and clarified by project maintainers. 119 | 120 | ### Enforcement 121 | 122 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 123 | reported by contacting the project team at icancclearynow@pm.me. All 124 | complaints will be reviewed and investigated and will result in a response that 125 | is deemed necessary and appropriate to the circumstances. The project team is 126 | obligated to maintain confidentiality with regard to the reporter of an incident. 127 | Further details of specific enforcement policies may be posted separately. 128 | 129 | Project maintainers who do not follow or enforce the Code of Conduct in good 130 | faith may face temporary or permanent repercussions as determined by other 131 | members of the project's leadership. 132 | 133 | ### Attribution 134 | 135 | This Code of Conduct is adapted from the [PurpleBooth's Contributing Template][contributing-template-url] 136 | 137 | [contributing-template-url]: https://gist.github.com/PurpleBooth/b24679402957c63ec426/5c4f62c1e50c1e6654e76e873aba3df2b0cdeea2 138 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ian Cleary 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: help 3 | 4 | # Shell that make should use 5 | # Make changes to path persistent 6 | # https://stackoverflow.com/a/13468229/13577666 7 | SHELL := /bin/bash 8 | PATH := $(PATH) 9 | 10 | # Ubuntu distro string 11 | OS_VERSION_NAME := $(shell lsb_release -cs) 12 | 13 | HOSTNAME = $(shell hostname) 14 | 15 | # This next section is needed to ensure $$HOME is on PATH in the initial shell session 16 | # The file from bash scripts/before_script_path_fix.sh 17 | # is only loaded in a new shell session. 18 | LOCAL_BIN = $(shell echo $$HOME/.local/bin) 19 | # $(warning LOCAL_BIN is $(LOCAL_BIN)) 20 | 21 | # Source for conditional: https://stackoverflow.com/a/2741747/13577666 22 | ifneq (,$(findstring $(LOCAL_BIN),$(PATH))) 23 | # Found: all set; do nothing, $(LOCAL_BIN) is on PATH 24 | PATH := $(PATH); 25 | else 26 | # Not found: adding $(LOCAL_BIN) to PATH for this shell session 27 | export PATH := $(LOCAL_BIN):$(PATH); @echo $(PATH) 28 | endif 29 | 30 | # "users" format is from https://github.com/icancclearynow/ansible-role-zsh 31 | VARIABLES = '{"users": [{"username": "$(shell whoami)"}], "ansible_user": "$(shell whoami)", "docker_users": ["$(shell whoami)"]}' 32 | 33 | # Main Ansible Playbook Command (prompts for password) 34 | PLAYBOOK_TERMINAL=playbook_terminal.yml 35 | PLAYBOOK_DESKTOP=playbook_desktop.yml 36 | ANSIBLE_PLAYBOOK_TERMINAL = ansible-playbook $(PLAYBOOK_TERMINAL) -v -e $(VARIABLES) 37 | ANSIBLE_PLAYBOOK_DESKTOP = ansible-playbook $(PLAYBOOK_DESKTOP) -v -e $(VARIABLES) 38 | 39 | $(warning ANSIBLE_PLAYBOOK_TERMINAL is $(ANSIBLE_PLAYBOOK_TERMINAL)) 40 | $(warning ANSIBLE_PLAYBOOK_DESKTOP is $(ANSIBLE_PLAYBOOK_DESKTOP)) 41 | 42 | help: 43 | # http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html 44 | # adds anything that has a double # comment to the phony help list 45 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ".:*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 46 | 47 | .DEFAULT_GOAL := help 48 | 49 | bootstrap-before-install: 50 | bootstrap-before-install: 51 | # Apt Dependencies (removes apt ansible) 52 | bash scripts/before_install_apt_dependencies.sh 53 | 54 | bootstrap-install: 55 | bootstrap-install: 56 | # Python3 Dependencies (install python3 ansible) 57 | bash scripts/install_python3_dependencies.sh 58 | 59 | bootstrap-before-script: 60 | bootstrap-before-script: 61 | # Ensure "$$HOME/.local/bin" is part of PATH on future shell sessions 62 | # The top of the Makefile takes care of this in the initial session 63 | bash scripts/before_script_path_fix.sh 64 | 65 | galaxy-requirements: 66 | galaxy-requirements: 67 | ansible-galaxy install -r requirements.yml 68 | 69 | bootstrap: bootstrap-before-install bootstrap-install bootstrap-before-script galaxy-requirements 70 | bootstrap: ## Installs dependencies needed to run playbook 71 | 72 | bootstrap-check: 73 | bootstrap-check: ## Check that PATH and requirements are correct 74 | @ansible --version | grep "python version" 75 | 76 | terminal-github-runner: 77 | terminal-github-runner: 78 | # test coverage is in the ansible roles themselves 79 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --skip-tags="skip-ci" 80 | 81 | desktop-github-runner: 82 | desktop-github-runner: 83 | # test coverage is in the ansible roles themselves 84 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --skip-tags="skip-ci" 85 | 86 | terminal: DARGS?= 87 | terminal: ## Installs everything from terminal playbook 88 | @$(ANSIBLE_PLAYBOOK_TERMINAL) 89 | 90 | desktop: DARGS?= 91 | desktop: ## Installs everything from terminal playbook 92 | @$(ANSIBLE_PLAYBOOK_DESKTOP) 93 | 94 | 95 | all: ## Does most eveything with Ansible and Make targets 96 | all: bootstrap bootstrap-check install non-ansible 97 | 98 | lint: ## Lint the repo 99 | lint: 100 | pre-commit run --all-files 101 | 102 | rust: ## Install rust 103 | rust: 104 | sudo apt install build-essential 105 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 106 | source $$HOME/.cargo/env 107 | 108 | cargo: ## Install rust crates 109 | cargo: 110 | cargo install just 111 | cargo install sd 112 | 113 | material-shell: ## Install Material Shell GNOME Extension from source 114 | material-shell: 115 | git clone --depth 1 https://github.com/material-shell/material-shell.git && cd material-shell && make install 116 | xdg-open https://github.com/material-shell/material-shell#get-the-most-up-to-date-version-with-git 117 | 118 | tresorit: ## Install Tresorit 119 | tresorit: 120 | wget -O ~/Downloads/tresorit_installer.run https://installerstorage.blob.core.windows.net/public/install/tresorit_installer.run 121 | chmod +x ~/Downloads/tresorit_installer.run 122 | $(echo $0) ~/Downloads/tresorit_installer.run 123 | 124 | act: ## Local github actions runner 125 | act: 126 | @curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash 127 | sudo mv bin/act ~/.local/bin/act 128 | 129 | dotfiles: ## Initialize dotfiles 130 | dotfiles: 131 | chezmoi init --apply git@github.com:iancleary/dotfiles.git 132 | ######################## Below is autogenerated ########################## 133 | # Run python3 scripts/makefile_targets_from_ansible_tags.py, copy Makefile.template below 134 | ########################################################################### 135 | 136 | colorls: 137 | colorls: ## Runs the colorls ansible role 138 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="colorls" --ask-become-pass 139 | 140 | docker: 141 | docker: ## Runs the docker ansible role 142 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="docker" --ask-become-pass 143 | 144 | fonts: 145 | fonts: ## Runs the fonts ansible role 146 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="fonts" --ask-become-pass 147 | 148 | gh: 149 | gh: ## Runs the gh ansible role 150 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="gh" --ask-become-pass 151 | 152 | github-cli: 153 | github-cli: ## Runs the github-cli ansible role 154 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="github-cli" --ask-become-pass 155 | 156 | meslolgs: 157 | meslolgs: ## Runs the meslolgs ansible role 158 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="meslolgs" --ask-become-pass 159 | 160 | nodejs: 161 | nodejs: ## Runs the nodejs ansible role 162 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="nodejs" --ask-become-pass 163 | 164 | ohmyzsh: 165 | ohmyzsh: ## Runs the ohmyzsh ansible role 166 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="ohmyzsh" --ask-become-pass 167 | 168 | tailscale: 169 | tailscale: ## Runs the tailscale ansible role 170 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="tailscale" --ask-become-pass 171 | 172 | terraform: 173 | terraform: ## Runs the terraform ansible role 174 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="terraform" --ask-become-pass 175 | 176 | zsh: 177 | zsh: ## Runs the zsh ansible role 178 | @$(ANSIBLE_PLAYBOOK_TERMINAL) --tags="zsh" --ask-become-pass 179 | 180 | airpods-pro-bluetooth-fix: 181 | airpods-pro-bluetooth-fix: ## Runs the airpods-pro-bluetooth-fix ansible role 182 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="airpods-pro-bluetooth-fix" --ask-become-pass 183 | 184 | appimagelauncher: 185 | appimagelauncher: ## Runs the appimagelauncher ansible role 186 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="appimagelauncher" --ask-become-pass 187 | 188 | caffeine: 189 | caffeine: ## Runs the caffeine ansible role 190 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="caffeine" --ask-become-pass 191 | 192 | code-extensions: 193 | code-extensions: ## Runs the code-extensions ansible role 194 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="code-extensions" --ask-become-pass 195 | 196 | extra-desktop-packages: 197 | extra-desktop-packages: ## Runs the extra-desktop-packages ansible role 198 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="extra-desktop-packages" --ask-become-pass 199 | 200 | extra-packages: 201 | extra-packages: ## Runs the extra-packages ansible role 202 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="extra-packages" --ask-become-pass 203 | 204 | flatpak: 205 | flatpak: ## Runs the flatpak ansible role 206 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="flatpak" --ask-become-pass 207 | 208 | liquorix: 209 | liquorix: ## Runs the liquorix ansible role 210 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="liquorix" --ask-become-pass 211 | 212 | nextcloud: 213 | nextcloud: ## Runs the nextcloud ansible role 214 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="nextcloud" --ask-become-pass 215 | 216 | snap: 217 | snap: ## Runs the snap ansible role 218 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="snap" --ask-become-pass 219 | 220 | timeshift: 221 | timeshift: ## Runs the timeshift ansible role 222 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="timeshift" --ask-become-pass 223 | 224 | ulauncher: 225 | ulauncher: ## Runs the ulauncher ansible role 226 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="ulauncher" --ask-become-pass 227 | 228 | universe-repository: 229 | universe-repository: ## Runs the universe-repository ansible role 230 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="universe-repository" --ask-become-pass 231 | 232 | wifi-powersave-mode: 233 | wifi-powersave-mode: ## Runs the wifi-powersave-mode ansible role 234 | @$(ANSIBLE_PLAYBOOK_DESKTOP) --tags="wifi-powersave-mode" --ask-become-pass 235 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ARCHIVED 2 | ========= 3 | 4 | > This repo is archived. I no longer plan to maintain it. You are welcome to do anything permitted by the [LICENSE](LICENSE). 5 | > 6 | > Why, see this article about [NixOS vs Ansible](https://discourse.nixos.org/t/nixos-vs-ansible/16757/17) for more details. 7 | 8 | 9 |

10 | 11 | Ubuntu Logo 12 | Plus Sign SVG 13 | Ansible Logo 14 | 15 |

16 | 17 | # Ubuntu Development Ansible Playbook 18 | 19 |

20 | 21 | 22 | License 23 | 24 |

25 | 26 | This playbook installs and configures most of the software I use on my Ubuntu Installations for web and software development. 27 | Some things are slightly difficult to automate, so I still have a few manual installation steps, but at least it's all documented here. 28 | 29 | ## Installation 30 | 31 | 1. [Install Ansible](https://docs.ansible.com/ansible/latest/installation_guide/index.html): 32 | 33 | 1. Upgrade Pip: `python3 -m pip install --upgrade pip` 34 | 2. Run the following command to add Python 3 to your $PATH: `export PATH="$HOME/.local/bin:$PATH"` 35 | 3. Install Ansible: `python3 -m pip install ansible` 36 | 37 | 2. Clone or download this repository to your local drive. 38 | 3. Run `ansible-galaxy install -r requirements.yml` inside this directory to install required Ansible roles. 39 | 4. Run `ansible-playbook playbook_terminal.yml --ask-become-pass` inside this directory. Enter your sudo account password when prompted for the 'BECOME' password. 40 | 5. (if desired) Run `ansible-playbook playbook_desktop.yml --ask-become-pass` inside this directory. Enter your sudo account password when prompted for the 'BECOME' password. 41 | 42 | > Note: If some commands fail, you might need logout and log back in again. 43 | 44 | 45 | ## New Machine Setup Scripts 46 | 47 | For a new machine, I run the following command 48 | to set up my computer: 49 | 50 | > Please make sure you adjust your hostname as Ansible keys off this variable. 51 | > I like to do this during the initial configuration of the machine. 52 | 53 | This will prompt you for your `sudo` password 54 | for the bash script and then once later for 55 | `ansible`'s "BECOME PASSWORD" prompt. 56 | 57 | Voila! 🎉🎉🎉 58 | 59 | ### New Terminal Setup 60 | 61 | ```bash 62 | wget -qO- \ 63 | https://github.com/iancleary/ubuntu-dev-playbook/raw/main/run_terminal.sh | \ 64 | bash 65 | ``` 66 | 67 | ### New Desktop Setup 68 | 69 | ```bash 70 | wget -qO- \ 71 | https://github.com/iancleary/ubuntu-dev-playbook/raw/main/run_desktop.sh | \ 72 | bash 73 | ``` 74 | 75 | > Note I run both the playbook_terminal.yml and playbook_desktop.yml as they are mutually exclusive. In older releases, they were a single playbook, but I've separated them. 76 | 77 | ## Overriding Defaults 78 | 79 | Not everyone's development environment and preferred software configuration is the same. 80 | 81 | You can override any of the defaults configured in [group_vars](group_vars) by creating a `config.yml` file and setting the overrides in that file. 82 | 83 | **For example, you can customize the installed packages and apps with something like:** 84 | 85 | ```yaml 86 | apt_packages: 87 | - python3.10 88 | - git 89 | - nala 90 | 91 | nodejs_version: "18.x" 92 | # Set to true to suppress the UID/GID switching when running package scripts. If 93 | # set explicitly to false, then installing as a non-root user will fail. 94 | npm_config_unsafe_perm: true 95 | npm_global_packages: 96 | - name: "yarn" 97 | - name: "vercel" 98 | 99 | gem_packages: 100 | - name: bundler 101 | state: latest 102 | 103 | pip_packages: 104 | - name: mkdocs 105 | 106 | pipx_packages: 107 | - name: ruff 108 | - name: pre-commit 109 | 110 | 111 | snaps: 112 | - name: "authy" # 2-Factor Authentication 113 | - name: "beekeeper-studio" # An open source SQL editor and database management app 114 | - name: "code" 115 | classic: "yes" 116 | - name: "flameshot" # Powerful yet simple to use screenshot software 117 | - name: "slack" 118 | classic: "yes" 119 | - name: "chromium" 120 | - name: "standard-notes" 121 | 122 | # you are responsible for making sure there is a matching snap 123 | snap_plugs: 124 | - plug: "home" 125 | app: "chromium" 126 | - plug: "password-manager-service" 127 | app: "standard-notes" 128 | 129 | 130 | configure_flatpak: true 131 | configure_flatpak_gnome_software: true # gnome software plugin, can turn off to avoid duplicate stores (snap-store and gnome-software) 132 | flatpaks: 133 | # - "net.giuspen.cherrytree" # Hierarchical Note Taking 134 | - "io.github.seadve.Kooha" # Simple screen recorder with an easy to use interface 135 | - "com.rafaelmardojai.Blanket" # Background Sounds 136 | - "com.github.tchx84.Flatseal" # Manage Flatpak permissions 137 | - "org.gabmus.whatip" # Info on your IP 138 | - "org.libreoffice.LibreOffice" 139 | - "org.mozilla.firefox" 140 | - "org.videolan.VLC" 141 | - "nl.hjdskes.gcolor3" # Color Picker 142 | - "re.sonny.Junction" 143 | - "com.mattjakeman.ExtensionManager" 144 | - "ca.desrt.dconf-editor" 145 | - "io.podman_desktop.PodmanDesktop" 146 | 147 | gem_packages: 148 | - name: bundler 149 | state: present # present/absent/latest, default: present 150 | version: "~> 1.15.1" # default: N/A 151 | 152 | configure_code_extensions: true 153 | code_extensions: 154 | - # General Development 155 | - christian-kohler.path-intellisense 156 | - vscode-icons-team.vscode-icons 157 | - riccardoNovaglia.missinglineendoffile 158 | - shardulm94.trailing-spaces 159 | - oderwat.indent-rainbow 160 | - ms-vscode.makefile-tools 161 | # - Shan.code-settings-sync 162 | 163 | ## Git Utilities 164 | - eamodio.gitlens 165 | - donjayamanne.githistory 166 | - mhutchie.git-graph 167 | 168 | ## Markdown Linting 169 | - DavidAnson.vscode-markdownlint 170 | 171 | ## Python Development 172 | - ms-python.python 173 | - himanoa.Python-autopep8 174 | - njpwerner.autodocstring 175 | - wholroyd.jinja 176 | - ms-python.vscode-pylance 177 | 178 | ## Spellchecking 179 | - streetsidesoftware.code-spell-checker 180 | 181 | ## Themes 182 | - sdras.night-owl 183 | - akamud.vscode-theme-onedark 184 | 185 | ## Vue.js Development 186 | - octref.vetur 187 | - dbaeumer.vscode-eslint 188 | - pranaygp.vscode-css-peek 189 | - sdras.vue-vscode-snippets 190 | 191 | ## HTML 192 | - formulahendry.auto-close-tag 193 | - anteprimorac.html-end-tag-labels 194 | - vincaslt.highlight-matching-tag 195 | - formulahendry.auto-rename-tag 196 | 197 | ``` 198 | 199 | Any variable can be overridden in `config.yml`; see the supporting roles' documentation for a complete list of available variables. 200 | 201 | ## Included Applications / Configuration (Default) 202 | 203 | Default applications are controlled on a group basis, with hosts being localhosts. 204 | This yields a groups_vars folder for [terminal](group_vars/terminal/) and one for [desktop](group_vars/desktop/) 205 | 206 | The folders contain the defaults, as well as some of the Ansible Galaxy Roles: 207 | 208 | * [iancleary.ohmyzsh](https://github.com/iancleary/ansible-role-ohmyzsh/) and it's [defaults](https://github.com/iancleary/ansible-role-ohmyzsh/blob/main/defaults/main.yml) 209 | 210 | 211 | ## Testing the Playbook 212 | 213 | While I often setup new machines while I experiment Many people have asked me if I often wipe my entire workstation and start from scratch just to test changes to the playbook. Nope! This project is [continuously tested on GitHub Actions' Ubuntu infrastructure](https://github.com/iancleary/ubuntu-dev-playbook/actions?query=workflow%3ACI). 214 | 215 | ## Testing the Ansible Roles is done elsewhere 216 | 217 | This project intentionally doesn't not test the Ansible Galaxy roles that are continuously tested on Github Actions Ubuntu infrastructure elsewhere. That testing uses Docker and (generally) targets the latest Ubuntu LTS and the latest Fedora release. 218 | 219 | This project doesn't test on Github Actions with Fedora, as that (at the time of writing) isn't easily supported with Github Actions while not using docker. 220 | 221 | That said, I'm considering adding Fedora support (as there are just a few apt installs that would need to be expanded upon to also support rpm/dnf) 222 | 223 | 224 | ### iancleary.meslolgs 225 | 226 | 227 | CI workflow status 228 | 229 | 230 | Release workflow status 231 | 232 | 233 | License 234 | 235 | 236 | ### iancleary.colorls 237 | 238 | 239 | CI workflow status 240 | 241 | 242 | Release workflow status 243 | 244 | 245 | License 246 | 247 | 248 | ### iancleary.ohmyzsh 249 | 250 | 251 | CI workflow status 252 | 253 | 254 | Release workflow status 255 | 256 | 257 | License 258 | 259 | 260 | ### iancleary.gh 261 | 262 | 263 | CI workflow status 264 | 265 | 266 | Release workflow status 267 | 268 | 269 | License 270 | 271 | 272 | ### iancleary.tailscale 273 | 274 | 275 | CI workflow status 276 | 277 | 278 | Release workflow status 279 | 280 | 281 | License 282 | 283 | 284 | 285 | ## Virtual Machines 286 | 287 | You can also run Ubuntu inside a VM. 288 | 289 | If you do, I currently recommend: 290 | 291 | - [VirtualBox](https://virtualbox.org) 292 | - [Easy SSH Setup for VirtualBox](https://dev.to/developertharun/easy-way-to-ssh-into-virtualbox-machine-any-os-just-x-steps-5d9i), this can scale to different VMs by changing which host port you forward each VM to, and changing the ssh config on the host accordingly. 293 | 294 | Additionally, it is useful to mount a shared drive. 295 | 296 | ## Windows 297 | 298 | For Windows hosts, I've had issues with WSL while using certain VPNs (say Cisco AnyConnect). While there are likely guides on how to get WSLs DNS issues resolved under WSL2, that is not the focus of this repo. The playbook will generally work on WSL though. 299 | 300 | Hyper-V is also possible for Virtualization, but I've had difficulties with static IP Configuration, see [local-ssh-config](https://github.com/iancleary/local-ssh-config). 301 | 302 | > Note: If you go the Hyper-V route, there is also a [hyper-v](roles/hyper-v/) role that helps set the resolution, such that the Hyper-V window on the host will be scaled to the correct resolution. In general, Hyper-V will be faster than VirtualBox, due to what layer of hypervisor each are. 303 | 304 | If your machine is fast enough, I recommend the [VirtualBox and port forwarding route](#virtual-machines). Especially useful with a shared drive and a symlink from /mnt/shared to the home directory within the virtual machine. I recommend that workflow. 305 | 306 | 307 | ## Author 308 | 309 | This project was created by [Ian Cleary](https://iancleary.me), (originally inspired by [Jeff Geerling](https://www.jeffgeerling.com/)). 310 | 311 | [badge-gh-actions]: https://github.com/iancleary/ubuntu-dev-playbook/workflows/CI/badge.svg 312 | [link-gh-actions]: https://github.com/iancleary/ubuntu-dev-playbook/actions?query=workflow%3ACI 313 | 314 | ## Supported Ubuntu LTS Versions 315 | 316 | I will support the LTS versions I use. There are no plans to support non-LTS versions. 317 | 318 | > [GitHub Actions: Ubuntu 22.04 is now generally available on GitHub-hosted runners](https://github.blog/changelog/2022-08-09-github-actions-ubuntu-22-04-is-now-generally-available-on-github-hosted-runners/) 319 | 320 | | LTS | Last Supported Branch/Tag | 321 | |:-------------|:-------------:| 322 | | Ubuntu 20.04 and 22.04 (including elementary OS 6.x and 7.x, respectively) | [main](https://github.com/iancleary/ubuntu-dev-playbook)| 323 | | Ubuntu 20.04 (including elementary OS 6.0) | [2022.9.25](https://github.com/iancleary/ubuntu-dev-playbook/releases/tag/v2022.9.25)| 324 | | Ubuntu 18.04 | [2020.1.0](https://github.com/iancleary/ubuntu-dev-playbook/releases/tag/v2020.1.0)| 325 | 326 | ## Authors 327 | 328 | I benefited from the source work of others, see [AUTHORS.md](AUTHORS.md). 329 | 330 | > My choice to open source my work here is to share back with you. 331 | 332 | If you wish to contribute, see [CONTRIBUTING.md](CONTRIBUTING.md) 333 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | nocows = True 3 | interpreter_python ="/usr/bin/python3" 4 | inventory=inventory 5 | stdout_callback = yaml 6 | -------------------------------------------------------------------------------- /default.desktop.config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | configure_flatpak: true 3 | configure_snap: true 4 | configure_code_extensions: true 5 | configure_airpods_pro_bluetooth_fix: true 6 | configure_wifi_powersave_mode: true 7 | configure_ulauncher: true 8 | configure_appimagelauncher: true 9 | configure_nextcloud: true 10 | configure_liquorix: false 11 | configure_caffeine: false 12 | configure_timeshift: false 13 | -------------------------------------------------------------------------------- /default.terminal.config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | configure_meslolgs: true 3 | configure_colorls: true 4 | configure_ohmyzsh: true 5 | configure_docker: true 6 | configure_nodejs: true 7 | configure_gh: true 8 | configure_tailscale: true 9 | configure_terraform: false 10 | -------------------------------------------------------------------------------- /group_vars/all/ohmyzsh.yml: -------------------------------------------------------------------------------- 1 | --- 2 | zsh_aliases: 3 | # https://opensource.com/article/19/7/bash-aliases 4 | - ls='ls -F' 5 | - ll='ls -lh' 6 | - mnt="mount | awk -F' ' '{ printf \"%s\t%s\n\",\$1,\$3; }' | column -t | egrep ^/dev/ | sort" 7 | - hg='history|grep' # search bash history, I swapped the letters for github-cli compatibility 8 | - left='ls -t -1' # most recently edited files 9 | - cg='cd `git rev-parse --show-toplevel`' # go to git main level 10 | - ga='git add -A' 11 | - gc='git commit -m ' 12 | - gs='git status' 13 | - gp='git push origin' 14 | - gl='git pull origin' 15 | - gr='git reset HEAD --hard' 16 | - gcm='git checkout main && git pull origin main && git branch -D ' 17 | -------------------------------------------------------------------------------- /group_vars/desktop/apt.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apt_packages: 3 | # - name: software-properties-common 4 | # state: present (default) 5 | # Begin Terminal Packages 6 | # python development 7 | - name: software-properties-common 8 | - name: python3-setuptools 9 | - name: python3-apt 10 | - name: python3-pip 11 | - name: python3-venv 12 | - name: python3.10-venv 13 | - name: python3-pytest 14 | - name: libpython3.10-dev # Ubuntu 22.04 supports python3.10+ 15 | - name: python-is-python3 16 | # Podman 17 | - name: podman 18 | # linting 19 | - name: yamllint 20 | - name: shellcheck 21 | # better apt CLI 22 | # - name: nala 23 | # Begin Desktop Packages 24 | # Guake Drop Down Terminal 25 | - name: guake 26 | # Audio Control 27 | - name: pulseaudio 28 | - name: pavucontrol 29 | # Universe 30 | - name: linssid 31 | - name: gnome-sushi 32 | - name: profile-sync-daemon 33 | - name: gnome-tweaks 34 | - name: input-remapper 35 | # better apt CLI 36 | - name: nala 37 | -------------------------------------------------------------------------------- /group_vars/desktop/flatpak.yml: -------------------------------------------------------------------------------- 1 | --- 2 | configure_flatpak_gnome_software: true # gnome software plugin, can turn off to avoid duplicate stores (snap-store and gnome-software) 3 | flatpaks: 4 | # - "net.giuspen.cherrytree" # Hierarchical Note Taking 5 | - "io.github.seadve.Kooha" 6 | - "com.github.junrrein.PDFSlicer" 7 | - "org.kde.okular" # Document Viewer 8 | - "com.spotify.Client" # Music 9 | - "com.rafaelmardojai.Blanket" # Background Sounds 10 | - "com.github.tchx84.Flatseal" # Manage Flatpak permissions 11 | - "org.gabmus.whatip" # Info on your IP 12 | - "org.libreoffice.LibreOffice" 13 | - "org.mozilla.firefox" 14 | - "org.videolan.VLC" 15 | - "us.zoom.Zoom" 16 | - "nl.hjdskes.gcolor3" # Color Picker 17 | - "re.sonny.Junction" 18 | - "com.mattjakeman.ExtensionManager" 19 | - "ca.desrt.dconf-editor" 20 | - "io.podman_desktop.PodmanDesktop" 21 | -------------------------------------------------------------------------------- /group_vars/desktop/host_arch.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # used in URL of some deb packages on github 3 | host_arch: "amd64" 4 | -------------------------------------------------------------------------------- /group_vars/desktop/snap.yml: -------------------------------------------------------------------------------- 1 | --- 2 | snaps: 3 | - name: "authy" # 2-Factor Authentication 4 | - name: "beekeeper-studio" # An open source SQL editor and database management app 5 | - name: "code" 6 | classic: "yes" 7 | - name: "flameshot" # Powerful yet simple to use screenshot software 8 | - name: "slack" 9 | classic: "yes" 10 | - name: "chromium" 11 | - name: "standard-notes" 12 | - name: "chezmoi" 13 | classic: "yes" 14 | 15 | # you are responsible for making sure there is a matching snap 16 | snap_plugs: 17 | - app: "chromium" 18 | plug: "home" 19 | - app: "standard-notes" 20 | plug: "password-manager-service" 21 | -------------------------------------------------------------------------------- /group_vars/desktop/vs_code.yml: -------------------------------------------------------------------------------- 1 | --- 2 | code_extensions: [] 3 | # ## Docker and Remote Development 4 | # - ms-azuretools.vscode-docker 5 | # - ms-vscode-remote.remote-containers 6 | # - ms-vscode-remote.remote-ssh 7 | # - ms-vscode-remote.remote-ssh-edit 8 | # # - ms-vscode-remote.remote-wsl 9 | # - ms-vscode-remote.vscode-remote-extensionpack 10 | ## General Development 11 | # - christian-kohler.path-intellisense 12 | # - vscode-icons-team.vscode-icons 13 | # - riccardoNovaglia.missinglineendoffile 14 | # - shardulm94.trailing-spaces 15 | # - oderwat.indent-rainbow 16 | # - ms-vscode.makefile-tools 17 | # # - Shan.code-settings-sync 18 | 19 | # ## Git Utilities 20 | # - eamodio.gitlens 21 | # - donjayamanne.githistory 22 | # - mhutchie.git-graph 23 | 24 | # ## Markdown Linting 25 | # - DavidAnson.vscode-markdownlint 26 | 27 | # ## Python Development 28 | # - ms-python.python 29 | # - charliermarsh.ruff 30 | # - njpwerner.autodocstring 31 | # - wholroyd.jinja 32 | # - ms-python.vscode-pylance 33 | 34 | # ## Spellchecking 35 | # - streetsidesoftware.code-spell-checker 36 | 37 | # ## Themes 38 | # - akamud.vscode-theme-onedark 39 | 40 | # ## HTML 41 | # - formulahendry.auto-close-tag 42 | # - anteprimorac.html-end-tag-labels 43 | # - vincaslt.highlight-matching-tag 44 | # - formulahendry.auto-rename-tag 45 | # - devonray.snippet 46 | -------------------------------------------------------------------------------- /group_vars/desktop/wifi_powersave.yml: -------------------------------------------------------------------------------- 1 | --- 2 | wifi_powersave_mode: '2' # disable powersave 3 | # https://twitter.com/dominucco/status/1410181146940411905?s=20 4 | # According to https://gist.github.com/jcberthon/ea8cfe278998968ba7c5a95344bc8b55 5 | # From the source code: wifi.powersave can have the following value: 6 | # 7 | # NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value 8 | # NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting 9 | # NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave 10 | # NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3): enable powersave 11 | -------------------------------------------------------------------------------- /group_vars/terminal/apt.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Install packages from other package managers. 3 | # Note: You are responsible for making sure the required package managers are 4 | # installed, eg. through apt. 5 | configure_universe_repository: true 6 | apt_packages: 7 | # - name: software-properties-common 8 | # state: present (default) 9 | # Begin Terminal Packages 10 | # python development 11 | - name: software-properties-common 12 | - name: python3-setuptools 13 | - name: python3-apt 14 | - name: python3-pip 15 | - name: python3-venv 16 | - name: python3.10-venv 17 | - name: python3-pytest 18 | - name: libpython3.10-dev # Ubuntu 22.04 supports python3.10+ 19 | - name: python-is-python3 20 | # Podman 21 | - name: podman 22 | # linting 23 | - name: yamllint 24 | - name: shellcheck 25 | # better apt CLI 26 | # - name: nala 27 | -------------------------------------------------------------------------------- /group_vars/terminal/gem.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gem_packages: [] 3 | # - name: bundler 4 | # state: present # present/absent/latest, default: present 5 | # version: "~> 1.15.1" # default: N/A 6 | -------------------------------------------------------------------------------- /group_vars/terminal/node.yml: -------------------------------------------------------------------------------- 1 | --- 2 | configure_node: true 3 | nodejs_version: "18.x" 4 | # Set to true to suppress the UID/GID switching when running package scripts. If 5 | # set explicitly to false, then installing as a non-root user will fail. 6 | npm_config_unsafe_perm: true 7 | npm_global_packages: 8 | - name: "yarn" 9 | - name: "vercel" 10 | -------------------------------------------------------------------------------- /group_vars/terminal/pip.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pip_packages: 3 | # - name: mkdocs 4 | # state: present # present/absent/latest, default: present 5 | # version: "0.16.3" # default: N/A 6 | - name: pip 7 | state: latest 8 | - name: keyrings.alt 9 | - name: testresources 10 | - name: setuptools 11 | state: latest 12 | - name: wheel 13 | - name: pyyaml 14 | - name: pipx 15 | - name: pdm 16 | state: absent 17 | - name: poetry 18 | state: absent 19 | - name: pre-commit 20 | state: absent 21 | - name: ruff 22 | state: absent 23 | -------------------------------------------------------------------------------- /group_vars/terminal/pipx.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pipx_packages: 3 | - name: pdm 4 | state: latest 5 | - name: poetry 6 | state: latest 7 | - name: pre-commit 8 | state: latest 9 | - name: ruff 10 | state: latest 11 | - name: podman-compose 12 | state: latest 13 | -------------------------------------------------------------------------------- /home-local-bin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # https://unix.stackexchange.com/questions/14895/duplicate-entries-in-path-a-problem 3 | addToPATH() { 4 | case ":$PATH:" in 5 | *":$1:"*) :;; # already there 6 | *) PATH="$1:$PATH";; # or PATH="$PATH:$1" 7 | esac 8 | } 9 | 10 | # Important for python pip packages installed with --user 11 | addToPATH "$HOME/.local/bin" 12 | -------------------------------------------------------------------------------- /img/Ansible-Wordmark-RGB-White.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /img/ubuntu_orange_hex.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ]> 6 | 10 | 11 | 12 | 13 | 26 | 31 | 39 | 44 | 50 | 55 | 60 | 61 | -------------------------------------------------------------------------------- /inventory: -------------------------------------------------------------------------------- 1 | [all] 2 | 127.0.0.1 ansible_connection=local 3 | 4 | [terminal] 5 | 127.0.0.1 ansible_connection=local 6 | 7 | [desktop] 8 | 127.0.0.1 ansible_connection=local 9 | -------------------------------------------------------------------------------- /playbook_desktop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Desktop Applications 3 | hosts: desktop 4 | vars_files: 5 | - default.desktop.config.yml 6 | pre_tasks: 7 | - name: Include playbook configuration. 8 | ansible.builtin.include_vars: "{{ item }}" 9 | with_fileglob: 10 | - "{{ playbook_dir }}/config.yml" 11 | tags: ['always'] 12 | - name: Massage ansible_distribution_release for elementary OS 6.x 13 | ansible.builtin.set_fact: 14 | ansible_distribution_release: focal 15 | when: ansible_distribution_release in ["odin", "jolnir"] 16 | register: elementary_os 17 | tags: ['always'] 18 | - name: Massage ansible_distribution_release for elementary OS 7.x 19 | ansible.builtin.set_fact: 20 | ansible_distribution_release: jammy 21 | when: ansible_distribution_release in ["horus"] 22 | register: elementary_os 23 | tags: ['always'] 24 | - name: Debug ansible_distribution_release 25 | ansible.builtin.debug: 26 | msg: "{{ ansible_distribution_release }}" 27 | tags: ['always'] 28 | 29 | tasks: 30 | - name: Setup apt universe repository 31 | ansible.builtin.import_tasks: tasks/universe-repository.yml 32 | when: configure_universe_repository 33 | tags: ['universe-repository', 'extra-packages', 'extra-desktop-packages'] 34 | 35 | # extra-packages should go after universe to ensure packages are found 36 | - name: Install extra apt, pip, pipx, and gem packages 37 | ansible.builtin.import_tasks: tasks/extra-packages.yml 38 | tags: ['extra-desktop-packages', 'skip-ci'] 39 | 40 | - name: Install Flatpaks 41 | ansible.builtin.import_tasks: tasks/flatpak.yml 42 | tags: ['flatpak', 'skip-ci'] 43 | when: configure_flatpak 44 | 45 | - name: Install Snaps 46 | ansible.builtin.import_tasks: tasks/snap.yml 47 | tags: ['snap', 'skip-ci'] 48 | when: configure_snap 49 | 50 | - name: Install VS Code Extensions 51 | ansible.builtin.import_tasks: tasks/code-extensions.yml 52 | tags: ['code-extensions', 'skip-ci'] 53 | when: configure_code_extensions 54 | 55 | - name: Help Apple Airpods connect 56 | ansible.builtin.import_tasks: tasks/airpods-pro-bluetooth-fix.yml 57 | tags: ['airpods-pro-bluetooth-fix', 'skip-ci'] 58 | when: configure_airpods_pro_bluetooth_fix 59 | 60 | - name: Configure Wifi Powersave Mode 61 | ansible.builtin.import_tasks: tasks/wifi-powersave-mode.yml 62 | tags: ['wifi-powersave-mode', 'skip-ci'] 63 | when: configure_wifi_powersave_mode 64 | 65 | - name: Install ulauncher 66 | ansible.builtin.import_tasks: tasks/deb/ulauncher.yml 67 | tags: ['ulauncher'] 68 | when: configure_ulauncher 69 | 70 | - name: Install App Image Launcher 71 | ansible.builtin.import_tasks: tasks/ppa/appimagelauncher.yml 72 | tags: ['appimagelauncher'] 73 | become: true 74 | when: configure_appimagelauncher 75 | 76 | - name: Install Nextcloud AppImage 77 | ansible.builtin.import_tasks: tasks/nextcloud.yml 78 | tags: ['nextcloud'] 79 | when: configure_nextcloud 80 | 81 | - name: Install Caffeine 82 | ansible.builtin.import_tasks: tasks/ppa/caffeine.yml 83 | tags: ['caffeine'] 84 | when: configure_caffeine 85 | 86 | - name: Install Liqourix Kernel 87 | ansible.builtin.import_tasks: tasks/ppa/liquorix.yml 88 | tags: ['liquorix'] 89 | when: configure_liquorix 90 | 91 | - name: Install Timeshift Backups 92 | ansible.builtin.import_tasks: tasks/ppa/timeshift.yml 93 | tags: ['timeshift'] 94 | when: configure_timeshift 95 | -------------------------------------------------------------------------------- /playbook_terminal.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Terminal Applications 3 | hosts: terminal 4 | vars_files: 5 | - default.terminal.config.yml 6 | pre_tasks: 7 | - name: Include playbook configuration. 8 | ansible.builtin.include_vars: "{{ item }}" 9 | with_fileglob: 10 | - "{{ playbook_dir }}/config.yml" 11 | tags: ['always'] 12 | 13 | roles: 14 | # 'skip-ci' allows me to not test that role 15 | # 'never' is a special tag that is on run when that tag is specified 16 | 17 | # Terminal 18 | - role: iancleary.meslolgs 19 | tags: ['fonts', 'meslolgs', 'skip-ci'] 20 | when: configure_meslolgs 21 | - role: iancleary.colorls 22 | become: true 23 | tags: ['colorls', 'skip-ci'] 24 | when: configure_colorls 25 | - role: iancleary.ohmyzsh 26 | tags: ['ohmyzsh', 'zsh', 'skip-ci'] 27 | when: configure_ohmyzsh 28 | - role: iancleary.docker 29 | become: true 30 | tags: ['docker', 'skip-ci'] 31 | when: configure_docker 32 | - role: geerlingguy.nodejs 33 | become: true 34 | tags: ['nodejs', 'skip-ci'] 35 | when: configure_nodejs 36 | - role: iancleary.gh 37 | tags: ['gh', 'github-cli', 'skip-ci'] 38 | when: configure_gh 39 | - role: iancleary.tailscale 40 | become: true 41 | tags: ['tailscale', 'skip-ci'] 42 | when: configure_tailscale 43 | 44 | tasks: 45 | - name: Setup apt universe repository 46 | ansible.builtin.import_tasks: tasks/universe-repository.yml 47 | 48 | # extra-packages should go after universe to ensure packages are found 49 | - name: Install extra apt, pip, pipx, and gem packages 50 | ansible.builtin.import_tasks: tasks/extra-packages.yml 51 | 52 | - name: Install Terraform 53 | ansible.builtin.import_tasks: tasks/ppa/terraform.yml 54 | tags: ['terraform'] 55 | when: configure_terraform 56 | -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | roles: 3 | # Install a role from the Ansible Galaxy 4 | - name: iancleary.docker 5 | version: "v5.0.0" 6 | - name: iancleary.tailscale 7 | version: "v0.1.0" 8 | - name: geerlingguy.nodejs 9 | version: "6.1.1" 10 | - name: iancleary.gh 11 | version: "v0.1.0" 12 | - name: iancleary.meslolgs 13 | version: "v0.1.0" 14 | - name: iancleary.colorls 15 | version: "v0.1.0" 16 | - name: iancleary.ohmyzsh 17 | version: "v0.2.0" 18 | collections: 19 | # Install collections from Ansible Galaxy 20 | - name: community.general 21 | version: 6.4.0 22 | -------------------------------------------------------------------------------- /run_desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## ------------------------ 4 | ## Install Dependencies Required for this script 5 | sudo apt-get update 6 | sudo apt install -y git make 7 | 8 | ## ------------------------ 9 | ## Setup Repo Locally 10 | FOLDER=/tmp 11 | GIT_USER=iancleary 12 | GIT_REPO=ubuntu-dev-playbook 13 | GIT_BRANCH=main 14 | URL=https://github.com/$GIT_USER/$GIT_REPO.git 15 | 16 | cd ~ || exit 17 | mkdir -p $FOLDER 18 | cd $FOLDER || exit 19 | if [ ! -d "$GIT_REPO" ] ; then 20 | # git clone --recurse-submodules -j8 -b $GIT_BRANCH $URL $GIT_REPO 21 | git clone -b $GIT_BRANCH $URL $GIT_REPO 22 | else 23 | echo "Didn't clone repo since folder exists" 24 | fi 25 | 26 | # Fix permissions and ownership 27 | sudo chown -R "$USER:$USER" $GIT_REPO 28 | sudo chmod -R 755 $GIT_REPO 29 | 30 | # Enter Repo 31 | cd $GIT_REPO || exit 32 | 33 | 34 | ## ------------------------ 35 | ## Run Make Targets 36 | 37 | # Bootstrap machine setup 38 | make bootstrap 39 | make bootstrap-check 40 | 41 | # Initalize any machine (VM or Host) 42 | make desktop 43 | -------------------------------------------------------------------------------- /run_terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## ------------------------ 4 | ## Install Dependencies Required for this script 5 | sudo apt-get update 6 | sudo apt install -y git make 7 | 8 | ## ------------------------ 9 | ## Setup Repo Locally 10 | FOLDER=/tmp 11 | GIT_USER=iancleary 12 | GIT_REPO=ubuntu-dev-playbook 13 | GIT_BRANCH=main 14 | URL=https://github.com/$GIT_USER/$GIT_REPO.git 15 | 16 | cd ~ || exit 17 | mkdir -p $FOLDER 18 | cd $FOLDER || exit 19 | if [ ! -d "$GIT_REPO" ] ; then 20 | # git clone --recurse-submodules -j8 -b $GIT_BRANCH $URL $GIT_REPO 21 | git clone -b $GIT_BRANCH $URL $GIT_REPO 22 | else 23 | echo "Didn't clone repo since folder exists" 24 | fi 25 | 26 | # Fix permissions and ownership 27 | sudo chown -R "$USER:$USER" $GIT_REPO 28 | sudo chmod -R 755 $GIT_REPO 29 | 30 | # Enter Repo 31 | cd $GIT_REPO || exit 32 | 33 | 34 | ## ------------------------ 35 | ## Run Make Targets 36 | 37 | # Bootstrap machine setup 38 | make bootstrap 39 | make bootstrap-check 40 | 41 | # Initalize any machine (VM or Host) 42 | make terminal 43 | 44 | # Upgrade System After Fresh Install 45 | sudo apt update 46 | sudo apt -y full-upgrade 47 | sudo apt -y autoremove 48 | -------------------------------------------------------------------------------- /scripts/before_install_apt_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo apt remove -y ansible 3 | sudo apt -y autoremove 4 | sudo apt update 5 | 6 | # Python3 & Pip3 7 | sudo apt install -y python3-pip 8 | 9 | # Linting 10 | sudo apt install -y yamllint shellcheck 11 | -------------------------------------------------------------------------------- /scripts/before_script_path_fix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo cp home-local-bin.sh /etc/profile.d/home-local-bin.sh 3 | sudo chmod 0644 /etc/profile.d/home-local-bin.sh 4 | -------------------------------------------------------------------------------- /scripts/install_python3_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | FOLDER=$HOME/.local/bin 3 | 4 | mkdir -p "$FOLDER" 5 | 6 | sudo chown -R "$USER:$USER" "$FOLDER" 7 | sudo chmod -R 755 "$FOLDER" 8 | 9 | python3 -m pip install --user --upgrade pip setuptools keyrings.alt 10 | python3 -m pip install --user testresources wheel 11 | python3 -m pip install --user -r scripts/requirements.txt 12 | -------------------------------------------------------------------------------- /scripts/lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # YAML 4 | yamllint . 5 | 6 | ansible-lint 7 | 8 | # Bash 9 | shellcheck ./*.sh 10 | shellcheck scripts/*.sh 11 | -------------------------------------------------------------------------------- /scripts/makefile_targets_from_ansible_tags.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This file when run creates a Makefile.tempate file for me to copy into the Makefile 3 | from typing import List 4 | import yaml 5 | import os 6 | 7 | PLAYBOOK_FILE_DICT = { 8 | 'playbook_terminal.yml': { 9 | "make_target": "ANSIBLE_PLAYBOOK_TERMINAL", 10 | "tags": [] 11 | }, 12 | 'playbook_desktop.yml': { 13 | "make_target": "ANSIBLE_PLAYBOOK_DESKTOP", 14 | "tags": [] 15 | }, 16 | } 17 | 18 | 19 | OUTPUT_MAKEFILE_TEMPLATE = 'Makefile.template' 20 | 21 | EXCLUDED_TAGS = ['never', 'skip-ci'] 22 | 23 | class MakefileTagTemplator(): 24 | def __init__(self, playbook_dict): 25 | 26 | self.playbook_dict = playbook_dict 27 | 28 | for playbook in self.playbook_dict.keys(): 29 | self.playbook_dict[playbook]["tags"] = self.parse_tags(playbook_file=playbook) 30 | 31 | def parse_tags(self, playbook_file) -> List[str]: 32 | _tags = None 33 | tags = set() 34 | with open(playbook_file) as file: 35 | playbook_yaml = yaml.safe_load(file) 36 | playbook_dict = playbook_yaml[0] 37 | if 'roles' in playbook_dict.keys(): 38 | roles = playbook_dict['roles'] 39 | for role in roles: 40 | if 'tags' in role.keys(): 41 | _tags = role['tags'] 42 | tags = tags | set(_tags) # union 43 | if 'tasks' in playbook_dict.keys(): 44 | tasks = playbook_dict['tasks'] 45 | for task in tasks: 46 | if 'tags' in task.keys(): 47 | _tags = task['tags'] 48 | tags = tags | set(_tags) # union 49 | # print(_tags) 50 | 51 | tags = sorted(list(tags)) 52 | tags = [tag for tag in tags if tag not in EXCLUDED_TAGS] 53 | 54 | return tags 55 | 56 | def create_makefile_template(self) -> None: 57 | os.remove(OUTPUT_MAKEFILE_TEMPLATE) 58 | output_file = open(OUTPUT_MAKEFILE_TEMPLATE, "w") 59 | for playbook, playbook_info in self.playbook_dict.items(): 60 | for tag in playbook_info["tags"]: 61 | MAKEFILE_TEMPLATE = f"""\n{tag}:\n{tag}: ## Runs the {tag} ansible role\n @$({playbook_info['make_target']}) --tags=\"{tag}\" --ask-become-pass\n""" 62 | output_file.write(MAKEFILE_TEMPLATE.format(tag=tag)) 63 | output_file.close() 64 | 65 | if __name__ == '__main__': 66 | # Intialization parses tags 67 | makefile_tag_templator = MakefileTagTemplator(playbook_dict=PLAYBOOK_FILE_DICT) 68 | # write out Makefile.template 69 | makefile_tag_templator.create_makefile_template() 70 | # go open file and copy paste below static Makefile content 71 | # leaving 72 | -------------------------------------------------------------------------------- /scripts/requirements.txt: -------------------------------------------------------------------------------- 1 | ansible>=3.2.0 2 | github3.py>=1.0.0a3 # github-cli 3 | -------------------------------------------------------------------------------- /tasks/airpods-pro-bluetooth-fix.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set Bluetooth Controller Mode 3 | become: true 4 | ansible.builtin.lineinfile: 5 | path: /etc/bluetooth/main.conf 6 | regexp: '^ControllerMode = dual' 7 | line: 'ControllerMode = bredr' 8 | register: bluetooth_conf_file 9 | 10 | - name: Restart Bluetooth Service, if needed 11 | become: true 12 | ansible.builtin.command: /etc/init.d/bluetooth restart 13 | when: bluetooth_conf_file.changed 14 | tags: ['skip_ansible_lint'] 15 | -------------------------------------------------------------------------------- /tasks/code-extensions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Debug - collect code path location 3 | ansible.builtin.command: 4 | cmd: "which code" 5 | changed_when: "false" 6 | register: code_installation_path 7 | 8 | - name: Debug code path 9 | ansible.builtin.debug: 10 | var: code_installation_path.stdout 11 | 12 | - name: Set code executable 13 | ansible.builtin.set_fact: 14 | code_executable: "{{ code_installation_path.stdout }}" 15 | 16 | - name: Debug code path 17 | ansible.builtin.debug: 18 | var: code_executable 19 | 20 | - name: Register currently installed code extensions 21 | ansible.builtin.command: "{{ code_executable }} --list-extensions" 22 | register: installed_code_extensions 23 | changed_when: "false" 24 | 25 | - name: Debug currently installed code extensions 26 | ansible.builtin.debug: 27 | var: installed_code_extensions.stdout_lines 28 | 29 | - name: Code Extensions 30 | ansible.builtin.command: "{{ code_executable }} --install-extension {{ item }}" 31 | with_items: "{{ code_extensions }}" 32 | when: "item not in installed_code_extensions.stdout_lines" 33 | changed_when: "item not in installed_code_extensions.stdout_lines" 34 | 35 | - name: Debug Code Extensions Installed but not in variables 36 | ansible.builtin.debug: 37 | var: "{{ item }}" 38 | with_items: "{{ installed_code_extensions.stdout_lines }}" 39 | when: "item not in code_extensions" 40 | -------------------------------------------------------------------------------- /tasks/deb/stacer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get latest release of a public repository 3 | community.general.github_release: 4 | user: oguzhaninan 5 | repo: Stacer 6 | action: latest_release 7 | register: stacer_latest 8 | 9 | - name: Install Stacer deb from github (Specific Version) 10 | become: true 11 | ansible.builtin.apt: 12 | deb: >- 13 | https://github.com/oguzhaninan/Stacer/releases/download/v{{ stacer_version }}/stacer_{{ stacer_version }}_{{ host_arch }}.deb 14 | when: stacer_version is defined 15 | 16 | - name: Install Stacer deb from github (Latest Version) 17 | become: true 18 | ansible.builtin.apt: 19 | deb: >- 20 | https://github.com/oguzhaninan/Stacer/releases/download/{{ stacer_latest.tag }}/stacer_{{ stacer_latest.tag | replace('v', '') }}_{{ host_arch }}.deb 21 | when: stacer_version is undefined 22 | -------------------------------------------------------------------------------- /tasks/deb/ulauncher.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get latest release of a public repository 3 | community.general.github_release: 4 | user: ulauncher 5 | repo: ulauncher 6 | action: latest_release 7 | register: ulauncher_latest 8 | 9 | - name: Install deb from github (Specific Version) 10 | become: true 11 | ansible.builtin.apt: 12 | deb: >- 13 | https://github.com/Ulauncher/Ulauncher/releases/download/{{ ulauncher_version }}/ulauncher_{{ ulauncher_version }}_all.deb 14 | when: ulauncher_version is defined 15 | 16 | - name: Install deb from github (Latest) 17 | become: true 18 | ansible.builtin.apt: 19 | deb: >- 20 | https://github.com/Ulauncher/Ulauncher/releases/download/{{ ulauncher_latest.tag }}/ulauncher_{{ ulauncher_latest.tag }}_all.deb 21 | when: ulauncher_version is not defined 22 | -------------------------------------------------------------------------------- /tasks/debug.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Debug - display ansible_os_family 3 | ansible.builtin.debug: 4 | msg: "{{ ansible_os_family }}" 5 | 6 | - name: Debug - display ansible_distribution_release 7 | ansible.builtin.debug: 8 | msg: "{{ ansible_distribution_release }}" 9 | 10 | - name: Debug - display ansible_user 11 | ansible.builtin.debug: 12 | msg: "{{ ansible_user }}" 13 | -------------------------------------------------------------------------------- /tasks/extra-desktop-packages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install global apt packages 3 | become: true 4 | ansible.builtin.apt: 5 | name: "{{ item.name | default(item) }}" 6 | state: "{{ item.state | default('present') }}" 7 | loop: "{{ apt_desktop_packages }}" 8 | -------------------------------------------------------------------------------- /tasks/extra-packages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install global apt packages 3 | become: true 4 | ansible.builtin.apt: 5 | name: "{{ item.name | default(item) }}" 6 | state: "{{ item.state | default('present') }}" 7 | loop: "{{ apt_packages }}" 8 | 9 | - name: Install global Pip packages. 10 | ansible.builtin.pip: 11 | name: "{{ item.name | default(item) }}" 12 | state: "{{ item.state | default('present') }}" 13 | version: "{{ item.version | default(omit) }}" 14 | executable: "{{ item.executable | default(omit) }}" 15 | loop: "{{ pip_packages }}" 16 | 17 | - name: Install global Pipx packages. 18 | community.general.pipx: 19 | name: "{{ item.name | default(item) }}" 20 | state: "{{ item.state | default('latest') }}" 21 | loop: "{{ pipx_packages }}" 22 | 23 | - name: Install global Ruby gems. 24 | become: true 25 | community.general.gem: 26 | name: "{{ item.name | default(item) }}" 27 | state: "{{ item.state | default('present') }}" 28 | version: "{{ item.version | default(omit) }}" 29 | user_install: false 30 | executable: "{{ item.executable | default(omit) }}" 31 | loop: "{{ gem_packages }}" 32 | -------------------------------------------------------------------------------- /tasks/flatpak.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install flatpak packages 3 | become: true 4 | ansible.builtin.apt: 5 | name: 6 | - "gnome-software" 7 | - "gnome-software-plugin-flatpak" 8 | state: present 9 | 10 | - name: Install flatpak packages 11 | become: true 12 | ansible.builtin.apt: 13 | name: "flatpak" 14 | state: present 15 | when: configure_flatpak_gnome_software 16 | 17 | - name: Install flatpak remote 18 | become: true 19 | community.general.flatpak_remote: 20 | name: flathub 21 | state: present 22 | flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo 23 | 24 | - name: Install Flatpak Applications 25 | become: true 26 | community.general.flatpak: 27 | name: "{{ item }}" 28 | state: present 29 | with_items: "{{ flatpaks }}" 30 | -------------------------------------------------------------------------------- /tasks/home-local-bin.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # TBD if this should be a role to have a template 3 | # and when it needs to be done 4 | -------------------------------------------------------------------------------- /tasks/nextcloud.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get latest release of a public repository 3 | community.general.github_release: 4 | user: nextcloud 5 | repo: desktop 6 | action: latest_release 7 | register: nextcloud_latest 8 | 9 | - name: Creates the Application where the binary will be stored 10 | ansible.builtin.file: 11 | name: ~/Applications 12 | mode: 0755 13 | state: directory 14 | 15 | - name: Install Nextcloud AppImage from github (Specific Version) 16 | ansible.builtin.get_url: 17 | url: "https://github.com/nextcloud/desktop/releases/download/{{ nextcloud_version }}/Nextcloud-{{ nextcloud_version | replace('v', '') }}-x86_64.AppImage" 18 | dest: ~/Applications/Nextcloud.AppImage 19 | mode: 0755 20 | when: nextcloud_version is defined 21 | 22 | - name: Install Nextcloud AppImage from github (Latest Version) 23 | ansible.builtin.get_url: 24 | url: "https://github.com/nextcloud/desktop/releases/download/{{ nextcloud_latest.tag }}/Nextcloud-{{ nextcloud_latest.tag | replace('v', '') }}-x86_64.AppImage" 25 | dest: ~/Applications/Nextcloud.AppImage 26 | mode: 0755 27 | when: nextcloud_version is undefined 28 | -------------------------------------------------------------------------------- /tasks/ppa/appimagelauncher.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Add appimagelauncher apt key. 3 | ansible.builtin.apt_key: 4 | url: > 5 | https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xacd802f535b6f55d365285574af9b16f75ef2fca 6 | id: "75ef2fca" 7 | keyring: /etc/apt/trusted.gpg.d/appimagelauncher.gpg 8 | state: present 9 | 10 | - name: Add appimagelauncher repositories. 11 | ansible.builtin.apt_repository: 12 | repo: "{{ item }}" 13 | state: present 14 | loop: 15 | - >- 16 | deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/appimagelauncher.gpg] https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu 17 | {{ ansible_distribution_release }} main 18 | - >- 19 | deb-src [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/appimagelauncher.gpg] https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu 20 | {{ ansible_distribution_release }} main 21 | register: appimagelauncher_repo 22 | 23 | - name: Update apt cache if repo was added. 24 | ansible.builtin.apt: 25 | update_cache: "yes" 26 | when: appimagelauncher_repo.changed 27 | tags: ['skip_ansible_lint'] 28 | 29 | - name: Ensure appimagelauncher is installed. 30 | ansible.builtin.apt: 31 | name: "appimagelauncher" 32 | state: present 33 | -------------------------------------------------------------------------------- /tasks/ppa/caffeine.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install PPA 3 | become: true 4 | ansible.builtin.apt_repository: 5 | repo: ppa:caffeine-developers/ppa 6 | state: present 7 | 8 | - name: Install apt package 9 | become: true 10 | ansible.builtin.apt: 11 | name: "caffeine" 12 | state: present 13 | update_cache: "yes" 14 | -------------------------------------------------------------------------------- /tasks/ppa/liquorix.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Add liquorix repositories 3 | become: true 4 | ansible.builtin.apt_repository: 5 | repo: "ppa:damentz/liquorix" 6 | state: present 7 | register: liquorix_repo 8 | 9 | - name: Update apt cache if repo was added. 10 | become: true 11 | ansible.builtin.apt: 12 | update_cache: true 13 | when: liquorix_repo.changed 14 | tags: ['skip_ansible_lint'] 15 | 16 | - name: Ensure liquorix is installed. 17 | become: true 18 | ansible.builtin.apt: 19 | name: 20 | - linux-image-liquorix-amd64 21 | - linux-headers-liquorix-amd64 22 | state: present 23 | -------------------------------------------------------------------------------- /tasks/ppa/terraform.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install GPG key 3 | become: true 4 | ansible.builtin.apt_key: 5 | url: https://apt.releases.hashicorp.com/gpg 6 | state: present 7 | 8 | - name: Install PPA 9 | become: true 10 | ansible.builtin.apt_repository: 11 | repo: "deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main" 12 | state: present 13 | 14 | - name: Install apt package 15 | become: true 16 | ansible.builtin.apt: 17 | name: "terraform" 18 | state: present 19 | update_cache: "yes" 20 | -------------------------------------------------------------------------------- /tasks/ppa/timeshift.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install PPA 3 | become: true 4 | ansible.builtin.apt_repository: 5 | repo: ppa:teejee2008/timeshift 6 | state: present 7 | 8 | - name: Install apt package 9 | become: true 10 | ansible.builtin.apt: 11 | name: "timeshift" 12 | state: present 13 | update_cache: "yes" 14 | -------------------------------------------------------------------------------- /tasks/snap.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install snapd apt dependency 3 | become: true 4 | ansible.builtin.apt: 5 | name: "snapd" 6 | state: present 7 | 8 | - name: Install Snaps 9 | become: true 10 | community.general.snap: 11 | name: "{{ item.name }}" 12 | channel: "{{ item.channel | default('stable') }}" 13 | classic: "{{ item.classic | default('no') }}" 14 | with_items: "{{ snaps }}" 15 | 16 | # https://github.com/ansible/ansible/issues/58403 17 | # I can't find a counterpart on https://github.com/ansible-collections/community.general/issues as of 2021-10-27 18 | - name: Setup Snap Plugs 19 | become: true 20 | become_method: sudo 21 | changed_when: false 22 | ansible.builtin.command: 'snap connect {{ item.app }}:{{ item.plug }}' 23 | with_items: "{{ snap_plugs }}" 24 | -------------------------------------------------------------------------------- /tasks/universe-repository.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Enable universe repository 3 | become: true 4 | ansible.builtin.apt_repository: 5 | repo: "{{ item }}" 6 | loop: 7 | - "deb http://us.archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }} universe" 8 | - "deb http://us.archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-updates universe" 9 | - "deb http://security.ubuntu.com/ubuntu {{ ansible_distribution_release | lower }}-security universe" 10 | -------------------------------------------------------------------------------- /tasks/wifi-powersave-mode.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set Wifi Power Save Mode 3 | become: true 4 | ansible.builtin.lineinfile: 5 | path: /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf 6 | regexp: '^wifi.powersave' 7 | line: 'wifi.powersave = {{ wifi_powersave_mode }}' 8 | register: wifi_powersave_conf_file 9 | 10 | - name: Restart NetworkManager Service, if needed 11 | become: true 12 | ansible.builtin.command: systemctl restart NetworkManager.service 13 | when: wifi_powersave_conf_file.changed 14 | tags: ['skip_ansible_lint'] 15 | --------------------------------------------------------------------------------