This project contains my personal Ansible playbooks to setup my Ubunty 💻
Ansible must be installed
sudo apt-add-repository -y ppa:ansible/ansible && \
sudo apt-get update && \
sudo apt-get install -y ansible
sudo apt-get install -y make curl software-properties-common apt-utils python3-setuptools python3-apt python3-pip && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&\
python3 get-pip.py &&\
pip install ansible &&\
rm -rf get-pip.py
git clone https://github.com/ptavares/ansible-ubuntu.git &&\
cd ansible-ubuntu &&\
make bootstrap
Build the Docker image
git clone https://github.com/ptavares/ansible-ubuntu.git &&\
cd ansible-ubuntu &&\
make build-docker-image
Start the container with code inside:
docker run --rm -it ansible-ubuntu:test bash
Start the container with volume, so you can change the code directly:
docker run --rm -it -v "$PWD":/home/ubuntu/app/ ansible-ubuntu:test bash
All ansible playbooks calls are available from a Makefile target :
=============================================================
_ _ _ _ _
__ _ _ _ __(_) |__| |___ ___ _ _| |__ _ _ _ _| |_ _ _
/ _` | ' \(_-< | '_ \ / -_)___| || | '_ \ || | ' \ _| || |
\__,_|_||_/__/_|_.__/_\___| \_,_|_.__/\_,_|_||_\__|\_,_|
=============================================================
Usage :
make [target] [arg1=val1] [arg2=val2]...
############## Setup ##############
bootstrap: Installs dependencies needed to run ansible playbooks
install-roles: Install ansible role dependencies
Usage : make install-roles [requirements=requirement.yml] [F=1]
Available args :
- requirements : specify custom requirements file, default set to $(DEFAULT_REQUIREMENTS)
- F : set F=1 to force download if role already exist
############## Installation ##############
manage-system: Call ansible manage-system playbook
vscode: Call ansible vscode playbook
kubectl: Call ansible kubectl playbook
docker: Call ansible docker playbook
fonts: Call ansible fonts playbook
gnome-shell-extension: Call ansible gnome-shell-extension playbook
vim: Call ansible vim playbook
tmux: Call ansible tmux playbook
zsh: Call ansible zsh playbook
appimages: Call ansible appimages playbook
############## Updates ##############
update-zsh-config: Call ansible zsh playbook with tags="zsh-install-compose"
update-manage-system: Call ansible manage-system playbook with tags="manage-system-update, manage-system-clean"
update-docker-compose: Call ansible docker playbook with tags="docker-install-compose"
############## Test ##############
bootstrap-check: Check that PATH and requirements are correct
build-docker-image: Build Docker images to test ansible playbooks
############## Clean ##############
clean: Clean directory
############## Help ##############
precommit: run precommit on all files
run-playbook: Usage : make run-playbook playbook=<playbook> tags=<tags> limits=<limits> args=<args>
Required args :
- playbook : playbook to run
Available args:
- tags : Specify a list of tags for your ansible run
- limits : Limit the command to a subset of hosts with ansible's limit argument
- args : Add ansible understandable arguments
list-playbooks: List Playbooks
help Show this help
With default variables:
-----------------------
▶ DEFAULT_REQUIREMENTS = requirements/requirements_ansible.yml
▶ PLAYBOOK_DIR = playbooks
> make list-playbooks
playbooks/vim.yml
playbooks/fonts.yml
playbooks/manage-system.yml
playbooks/docker.yml
playbooks/install-all.yml
playbooks/zsh.yml
playbooks/kubectl.yml
playbooks/vscode.yml
playbooks/appimages.yml
playbooks/gnome-extension.yml
playbooks/tmux.yml
Will install docker
and docker-compose
.
-
Dependencies
-
Local configuration file
-
Makefile targets
make docker make update-docker-compose
Will clone nerd-fonts into your ${HOME}/tools
directory.
-
Dependencies
-
Local configuration file
- none
-
Makefile target
-
After cloning nerd-fonts, run installation of this fonts :
- JetBrainsMono
- Mononoki
- DroidSansMono
- ProFont
- UbuntuMono
- SourceCodePro
- RobotoMono
make fonts
-
Will install kubectl
CLI
-
Dependencies
-
Local configuration file
- none (but you can specify one)
-
Makefile targets (can be called for updates too)
make kubectl
Will install tmux
and tmuxinator
with my custom tmux configuration files if wanted.
-
Dependencies
-
Local configuration file
-
Makefile targets
make tmux
tmux
configuration file is based on this one and needs extra plugins :
Will install vim
with my custom vim configuration file if wanted.
-
Dependencies
-
Local configuration file
-
Makefile targets
make vim # Makefle target will call this command line : # > vim +PlugInstall +qall
vim
configuration will install molokai color theme and my custom plugins from vim bootstrap
Will install vscode
and some plugins (see configuration file for details)
-
Dependencies
-
Local configuration file
-
Makefile targets
make vscode
Will install zsh
with oh-my-zsh and some useful plugins (see configuration file for details)
-
Dependencies
-
Local configuration file
-
Makefile targets
make zsh make update-zsh-config
Will manage system updates and package/deb install/remove.
-
Dependencies
-
Local configuration file
-
Makefile targets
make manage-system make update-manage-system
Will download and install some usefull gnome-shell-extension using gnome-shell-extension-installer.
-
Dependencies
-
Local configuration file
-
Makefile targets
make gnome-shell-extension
Will download and install AppImages.
-
Dependencies
-
Local configuration file
-
Makefile targets
make appimages