Code Monkey home page Code Monkey logo

ubuntu-dev-playbook's Introduction

ARCHIVED

This repo is archived. I no longer plan to maintain it. You are welcome to do anything permitted by the LICENSE.

Why, see this article about NixOS vs Ansible for more details.

Ubuntu Logo Plus Sign SVG Ansible Logo

Ubuntu Development Ansible Playbook

License

This playbook installs and configures most of the software I use on my Ubuntu Installations for web and software development. Some things are slightly difficult to automate, so I still have a few manual installation steps, but at least it's all documented here.

Installation

  1. Install Ansible:

    1. Upgrade Pip: python3 -m pip install --upgrade pip
    2. Run the following command to add Python 3 to your $PATH: export PATH="$HOME/.local/bin:$PATH"
    3. Install Ansible: python3 -m pip install ansible
  2. Clone or download this repository to your local drive.

  3. Run ansible-galaxy install -r requirements.yml inside this directory to install required Ansible roles.

  4. Run ansible-playbook playbook_terminal.yml --ask-become-pass inside this directory. Enter your sudo account password when prompted for the 'BECOME' password.

  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.

Note: If some commands fail, you might need logout and log back in again.

New Machine Setup Scripts

For a new machine, I run the following command to set up my computer:

Please make sure you adjust your hostname as Ansible keys off this variable. I like to do this during the initial configuration of the machine.

This will prompt you for your sudo password for the bash script and then once later for ansible's "BECOME PASSWORD" prompt.

Voila! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

New Terminal Setup

wget -qO- \
https://github.com/iancleary/ubuntu-dev-playbook/raw/main/run_terminal.sh | \
bash

New Desktop Setup

wget -qO- \
https://github.com/iancleary/ubuntu-dev-playbook/raw/main/run_desktop.sh | \
bash

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.

Overriding Defaults

Not everyone's development environment and preferred software configuration is the same.

You can override any of the defaults configured in group_vars by creating a config.yml file and setting the overrides in that file.

For example, you can customize the installed packages and apps with something like:

apt_packages:
  - python3.10
  - git
  - nala

nodejs_version: "18.x"
# Set to true to suppress the UID/GID switching when running package scripts. If
# set explicitly to false, then installing as a non-root user will fail.
npm_config_unsafe_perm: true
npm_global_packages:
  - name: "yarn"
  - name: "vercel"

gem_packages:
  - name: bundler
    state: latest

pip_packages:
  - name: mkdocs

pipx_packages:
  - name: ruff
  - name: pre-commit


snaps:
  - name: "authy"  # 2-Factor Authentication
  - name: "beekeeper-studio"  # An open source SQL editor and database management app
  - name: "code"
    classic: "yes"
  - name: "flameshot"  # Powerful yet simple to use screenshot software
  - name: "slack"
    classic: "yes"
  - name: "chromium"
  - name: "standard-notes"

# you are responsible for making sure there is a matching snap
snap_plugs:
  - plug: "home"
    app: "chromium"
  - plug: "password-manager-service"
    app: "standard-notes"


configure_flatpak: true
configure_flatpak_gnome_software: true  # gnome software plugin, can turn off to avoid duplicate stores (snap-store and gnome-software)
flatpaks:
  # - "net.giuspen.cherrytree"  # Hierarchical Note Taking
  - "io.github.seadve.Kooha"  # Simple screen recorder with an easy to use interface
  - "com.rafaelmardojai.Blanket"  # Background Sounds
  - "com.github.tchx84.Flatseal"  # Manage Flatpak permissions
  - "org.gabmus.whatip"  # Info on your IP
  - "org.libreoffice.LibreOffice"
  - "org.mozilla.firefox"
  - "org.videolan.VLC"
  - "nl.hjdskes.gcolor3"  # Color Picker
  - "re.sonny.Junction"
  - "com.mattjakeman.ExtensionManager"
  - "ca.desrt.dconf-editor"
  - "io.podman_desktop.PodmanDesktop"

gem_packages:
  - name: bundler
    state: present # present/absent/latest, default: present
    version: "~> 1.15.1" # default: N/A

configure_code_extensions: true
code_extensions:
  - # General Development
  - christian-kohler.path-intellisense
  - vscode-icons-team.vscode-icons
  - riccardoNovaglia.missinglineendoffile
  - shardulm94.trailing-spaces
  - oderwat.indent-rainbow
  - ms-vscode.makefile-tools
  # - Shan.code-settings-sync

  ## Git Utilities
  - eamodio.gitlens
  - donjayamanne.githistory
  - mhutchie.git-graph

  ## Markdown Linting
  - DavidAnson.vscode-markdownlint

  ## Python Development
  - ms-python.python
  - himanoa.Python-autopep8
  - njpwerner.autodocstring
  - wholroyd.jinja
  - ms-python.vscode-pylance

  ## Spellchecking
  - streetsidesoftware.code-spell-checker

  ## Themes
  - sdras.night-owl
  - akamud.vscode-theme-onedark

  ## Vue.js Development
  - octref.vetur
  - dbaeumer.vscode-eslint
  - pranaygp.vscode-css-peek
  - sdras.vue-vscode-snippets

  ## HTML
  - formulahendry.auto-close-tag
  - anteprimorac.html-end-tag-labels
  - vincaslt.highlight-matching-tag
  - formulahendry.auto-rename-tag

Any variable can be overridden in config.yml; see the supporting roles' documentation for a complete list of available variables.

Included Applications / Configuration (Default)

Default applications are controlled on a group basis, with hosts being localhosts. This yields a groups_vars folder for terminal and one for desktop

The folders contain the defaults, as well as some of the Ansible Galaxy Roles:

Testing the Playbook

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.

Testing the Ansible Roles is done elsewhere

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.

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.

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)

iancleary.meslolgs

CI workflow status Release workflow status License

iancleary.colorls

CI workflow status Release workflow status License

iancleary.ohmyzsh

CI workflow status Release workflow status License

iancleary.gh

CI workflow status Release workflow status License

iancleary.tailscale

CI workflow status Release workflow status License

Virtual Machines

You can also run Ubuntu inside a VM.

If you do, I currently recommend:

Additionally, it is useful to mount a shared drive.

Windows

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.

Hyper-V is also possible for Virtualization, but I've had difficulties with static IP Configuration, see local-ssh-config.

Note: If you go the Hyper-V route, there is also a 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.

If your machine is fast enough, I recommend the VirtualBox and port forwarding route. Especially useful with a shared drive and a symlink from /mnt/shared to the home directory within the virtual machine. I recommend that workflow.

Author

This project was created by Ian Cleary, (originally inspired by Jeff Geerling).

Supported Ubuntu LTS Versions

I will support the LTS versions I use. There are no plans to support non-LTS versions.

GitHub Actions: Ubuntu 22.04 is now generally available on GitHub-hosted runners

LTS Last Supported Branch/Tag
Ubuntu 20.04 and 22.04 (including elementary OS 6.x and 7.x, respectively) main
Ubuntu 20.04 (including elementary OS 6.0) 2022.9.25
Ubuntu 18.04 2020.1.0

Authors

I benefited from the source work of others, see AUTHORS.md.

My choice to open source my work here is to share back with you.

If you wish to contribute, see CONTRIBUTING.md

ubuntu-dev-playbook's People

Contributors

dawidd6 avatar iancleary avatar imgbot[bot] avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ubuntu-dev-playbook's Issues

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Consider path forward for Code Extensions

code --help
...
Extensions Management
  --extensions-dir <dir>                            Set the root path for
                                                    extensions.
  --list-extensions                                 List the installed
                                                    extensions.
  --show-versions                                   Show versions of installed
                                                    extensions, when using
                                                    --list-extension.
  --category                                        Filters installed
                                                    extensions by provided
                                                    category, when using
                                                    --list-extension.
  --install-extension <extension-id | path-to-vsix> Installs or updates the
                                                    extension. Use `--force`
                                                    argument to avoid
                                                    prompts.
  --uninstall-extension <extension-id>              Uninstalls an extension.
  --enable-proposed-api <extension-id>              Enables proposed API
                                                    features for extensions.
                                                    Can receive one or more
                                                    extension IDs to enable
                                                    individually.
...

Could maintain the list here. This has an advantage of not having to use settings sync, but doesn't sync anything besides extensions.

Not sure yet

Consider group_vars

Move snap lists to defaults or group_vars

Investigate variable order of preference/priority

Python: Makefile or Ansible Role

Decide what to do here

Either can have it be in the Makefile or Update the Ansible role to use the pip module correctly (multiple python versions installed)

Dry-Run Issues

  • Chown and chmod 755 personal-ansible
  • Remove sudo from "| sudo bash" new machine script
  • . /etc/profile needed in yarn before yarn globals
    • this is only needed in the initial script before the file is loaded
    • it is in the .travis.yml file but not the main scripts
  • Dock size of 24
  • Chown and chmod 755 ๏ปฟ~/.local/bin (does this happen when sudo is removed from "| sudo bash"
  • Startup apps not set
    • /usr/bin/flameshot
  • [ ] Shell settings
    • Before the user theme can be set, the extension 'User Themes' needs to be enabled
    • I'm just going to do this manually

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.