ansible-linux-day0 is a server and workstation configuration repo designed to automatically install useful tools and applications. This is an opinionated set of choices based on my personal experience managing Linux systems.
The playbook is designed to work on a baseline Ubuntu system. To get started,
clone the repo to your system and run the ./bootstrap.sh file. This script
will install the latest version of ansible and the necessary ansible roles
defined in roles/requirements.yml.
- Run
bootstrap.sh:
./bootstrap.sh- Run
install-workstation.shto configure the current workstation:
./install-workstation.shThe playbook assumes you have a list of target servers defined in the
inventory/ directory.
- Run
ansible-playbook:
ansible-playbook -i inventory/server.yml day0-server.yml -KThe following roles install a variety of packages and applications and apply
configuration. The entry point for each role is the main.yml file which
includes a series of tasks via ansible.builtin.include_tasks. Each included
task has a corresponding variable which controls whether or not the tasks are
run.
Each role has a defaults/main.yml file which contains the install_*
variables. To skip run an included task, simply set the install_* variable
for the tasks you want to exclude to false.
Example:
# vars.yml
# Don't install Regolith/i3
install_regolith: false- Role file:
roles/common/tasks/main.yml
The common role is used to install packages and configuration on both workstations and servers.
- Task file:
install_packages.yml - Install var:
install_packages: true
- Task file:
install_tmux.yml - Install var:
install_tmux: true
tmux is a terminal multiplexer that allows users to manage multiple terminal sessions within a single window or session. With tmux, you can split a terminal into multiple panes, switch between them, and keep processes running in the background even if you disconnect from the session. It's especially useful for remote work, as you can disconnect from a session and reconnect later without losing any of the running processes.
- Task file:
install_zsh.yml - Install var:
install_zsh: true
Zsh (Z shell) is an extended version of the Unix shell, with many improvements over the traditional Bash shell. It is widely used for interactive shell sessions due to its advanced features, ease of customization, and powerful scripting capabilities.
- Task file:
install_ssh_key.yml - Install var:
install_ssh_key: true
An ssh key is generated for the ansible_user_id with the type defined in the
openssh_keypair_type variable. The default type is set to ed25519.
- Task file:
install_nodejs.yml - Install var:
install_nodejs: true
NodeJS is installed via the Node Version Manager (nvm). The NodeJS version to
install is defined in the nodejs_version variable.
- Task file:
install_aws_cli.yml - Install var:
install_aws_cli: true
The latest version of the AWS CLI v2 is downloaded from awscli.amazonaws.com
and is installed via the ./aws/install command.
- Role file:
roles/server_core/tasks/main.yml
- Unattended upgrades
- Tmux
.tmux.conf - Zsh
.zshrc
- Role file:
roles/workstation_core/tasks/main.yml
- Task file:
install_dotfiles.yml - Install var:
install_dotfiles: true
- Task file:
install_libraries.yml - Install var:
install_libraries: true
- Task file:
install_luarocks.yml - Install var:
install_luarocks: true
- Task file:
install_neovim.yml - Install var:
install_neovim: true
- Task file:
install_python.yml - Install var:
install_python: true
- Task file:
install_typescript.yml - Install var:
install_typescript: true
- Task file:
install_fastfetch.yml - Install var:
install_fastfetch: true
- Task file:
install_docker.yml - Install var:
install_docker: true
- Task file:
install_proxychains_ng.yml - Install var:
install_proxychains_ng: true
- Task file:
install_lazydocker.yml - Install var:
install_lazydocker: true
- Task file:
install_lazygit.yml - Install var:
install_lazygit: true
- Task file:
install_minicom.yml - Install var:
install_minicom: true
- Task file:
install_terraform.yml - Install var:
install_terraform: true
- Task file:
install_powershell.yml - Install var:
install_powershell: true
- Role file:
roles/workstation_desktop/tasks/main.yml
- Task file:
install_alacritty.yml - Install var:
install_alacritty: true
- Task file:
install_flameshot.yml - Install var:
install_flameshot: true
- Task file:
install_regolith.yml - Install var:
install_regolith: true
- Task file:
install_chrome.yml - Install var:
install_chrome: true
- Task file:
install_microsoft_edge.yml - Install var:
install_microsoft_edge: true
- Task file:
install_vscode.yml - Install var:
install_vscode: true
- Task file:
install_ulauncher.yml - Install var:
install_ulauncher: true
- Task file:
install_remmina.yml - Install var:
install_remmina: true
- Task file:
install_keepassxc.yml - Install var:
install_keepassxc: true