Skip to content

Instantly share code, notes, and snippets.

@jmlrt
Created May 24, 2019 11:07
Show Gist options
  • Save jmlrt/b1c57f665d6b6c75aef7d7d8f7c09477 to your computer and use it in GitHub Desktop.
Save jmlrt/b1c57f665d6b6c75aef7d7d8f7c09477 to your computer and use it in GitHub Desktop.
Old playbook to setup ubuntu laptop
---
- hosts: localhost
vars:
pkg_docker_prerequisites:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
pkg_tools:
- detox
- duplicity
- emacs
- firefox
- gawk
- gimp
- git
- git-cola
- gnome-tweak-tool
- goaccess
- htop
- imagemagick
- jq
- make
- mc
- meld
- ncdu
- rmlint
- rsync
- shellcheck
- sudo
- tlp
- tmux
- translate-shell
- tree
- vim
- wget
- xclip
pkg_java:
- ant
- gradle
- groovy
- maven
- openjdk-8-jdk
- openjdk-8-jre
pkg_js:
- nodejs
- npm
pkg_python:
- python
- python-apt
- python-dev
- python-pip
- python-virtualenv
- python3
- python3-apt
- python3-dev
- python3-pip
- python3-virtualenv
pkg_ruby:
- rake
- ruby
- ruby-bundler
- ruby-dev
python_pip:
- ansible
- awscli
- awslogs
- boto
- boto3
- botocore
- fabric
- ipython
snap_apps:
- chromium
- keepassxc
- spotify
snap_classic_apps:
- atom
- intellij-idea-community
- pycharm-community
- slack
tasks:
- name: ensure apt cache is updated
become: "yes"
apt:
update_cache: "yes"
cache_valid_time: 3600
- name: ensure tools packages are installed
become: "yes"
apt:
name: "{{ pkg_tools }}"
state: present
- name: ensure java packages are installed
become: "yes"
apt:
name: "{{ pkg_java }}"
state: present
- name: ensure js packages are installed
become: "yes"
apt:
name: "{{ pkg_js }}"
state: present
- name: ensure python packages are installed
become: "yes"
apt:
name: "{{ pkg_python }}"
state: present
- name: ensure ruby packages are installed
become: "yes"
apt:
name: "{{ pkg_ruby }}"
state: present
- name: ensure python pip are installed
become: "yes"
pip:
name: "{{ python_pip }}"
state: present
- name: ensure openvpn is installed
become: "yes"
apt:
name: network-manager-openvpn network-manager-openvpn-gnome openvpn
state: present
# SNAPS
- name: ensure snap apps are installed
command: snap install {{ item }}
with_items: "{{ snap_apps }}"
tags:
- skip_ansible_lint
- name: ensure snap classic apps are installed
command: snap install --classic {{ item }}
with_items: "{{ snap_classic_apps }}"
tags:
- skip_ansible_lint
# DOCKER
- name: ensure docker prerequisites packages are installed
become: "yes"
apt:
name: "{{ pkg_docker_prerequisites }}"
state: present
- name: ensure docker repository is configured
become: "yes"
apt_repository:
repo: |
deb [arch=amd64] https://download.docker.com/linux/ubuntu
{{ ansible_distribution_release }} stable
state: present
filename: docker
update_cache: "yes"
- name: ensure docker repository key is configured
become: "yes"
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: ensure docker is installed
become: "yes"
apt:
name: docker-ce
state: present
- name: ensure docker-compose is installed
become: "yes"
get_url:
url: |
https://github.com/docker/compose/releases/download/1.19.0/
docker-compose-{{ ansible_system }}-{{ ansible_architecture }}
dest: /usr/local/bin/docker-compose
checksum: |
sha512:a95454b71966f9c28bc30c04320eea3b1471b5b077fa05661fa6d5d94e822d3
b46649fd01190fe9fa16b3a53e1e67fd8a66561e5f7dfdd50d5a7cdbd641ab85e
check_mode: "no"
# VIRTUALBOX
- name: ensure virtualbox repository is configured
become: "yes"
apt_repository:
repo: |
deb https://download.virtualbox.org/virtualbox/debian
{{ ansible_distribution_release }} contrib
state: present
filename: virtualbox
update_cache: "yes"
- name: ensure virtualbox repository key is configured
become: "yes"
apt_key:
url: https://www.virtualbox.org/download/oracle_vbox_2016.asc
state: present
- name: ensure virtualbox is installed
become: "yes"
apt:
name: virtualbox-5.2
state: present
- name: ensure dkms is installed
become: "yes"
apt:
name: dkms
state: present
- name: ensure vagrant is downloaded
get_url:
url: |
https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb
dest: /tmp/vagrant_2.0.1_x86_64.deb
checksum: |
sha512:b5e13eef75ecf8d56eafde791920fe925dbcfa2ce5c6708767b3dd794507c3
887bb8ad99ca3049937d9908fa2c17a2f764a99ace9291f0eecb653b6b8babd2f9
check_mode: "no"
- name: ensure vagrant is installed
become: "yes"
apt:
deb: /tmp/vagrant_2.0.1_x86_64.deb
state: present
# TERRAFORM
- name: ensure terraform is downloaded
get_url:
url: |
https://releases.hashicorp.com/terraform/0.11.5/terraform_0.11.5_linux_amd64.zip
dest: /tmp/terraform_0.11.5_linux_amd64.zip
checksum: |
sha256:131c440263382c79c7f783b70ff35cd1d03eb31c44f7738d153d95a0b8436ac9
check_mode: "no"
- name: ensure terraform is installed
become: "yes"
unarchive:
src: /tmp/terraform_0.11.5_linux_amd64.zip
dest: /usr/local/bin
owner: root
group: root
mode: 0755
# NEXTCLOUD
- name: ensure nextcloud client is installed
become: "yes"
get_url:
url: |
https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.3.3-x86_64.AppImage
dest: /usr/local/bin/nextcloud
checksum: |
sha512:7ba827e7394c35c9503cb183be66d07c60169250efec71187556ccd33d6c08c4f
2c48abe523f247634ac76a6923e5137ee9bb6d893a51a7a869e1eeebc2addc6
owner: root
group: root
mode: 0755
# ORACLE JDK8 (needed for TDS)
- name: ensure oracle repository is configured
become: "yes"
apt_repository:
repo: ppa:webupd8team/java
state: present
filename: java
update_cache: "yes"
- name: ensure oracle jdk8 is installed
become: "yes"
apt:
name: oracle-java8-installer
state: present
- name: ensure correct java version selected
alternatives:
name: java
path: /usr/lib/jvm/java-8-oracle
# DIVERS
- name: ensure vim is default editor
alternatives:
name: editor
path: /usr/bin/vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment