Skip to content

Instantly share code, notes, and snippets.

@mcclory
Last active December 28, 2020 15:57
Show Gist options
  • Save mcclory/1e532be000d2c3b1d82967bba6af75b0 to your computer and use it in GitHub Desktop.
Save mcclory/1e532be000d2c3b1d82967bba6af75b0 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt update -y
sudo apt install python3-dev python3-pip
pip3 install ansible
---
# sudo apt install python3-pip
# sudo pip3 install ansible
# mkdir -p ~/.ansible/plugins/modules/
# curl https://raw.githubusercontent.com/jistr/ansible-gsetting/master/gsetting.py > ~/.ansible/plugins/modules/gsetting.py
# sudo ansible-playbook <name of this file>.yaml
- hosts: localhost
connection: local
become: yes
tasks:
- name: Update and upgrade apt repositories
apt:
update_cache: yes
upgrade: dist
- name: add apt keys
apt_key:
url: "{{ item }}"
state: present
loop:
- https://dl-ssl.google.com/linux/linux_signing_key.pub
- https://packages.cloud.google.com/apt/doc/apt-key.gpg
- https://packagecloud.io/AtomEditor/atom/gpgkey
- https://download.docker.com/linux/ubuntu/gpg
- https://apt.releases.hashicorp.com/gpg
- name: Add apt repositories for software
apt_repository:
repo: "{{ item }}"
state: present
loop:
- "deb https://packagecloud.io/AtomEditor/atom/any/ any main"
- "deb http://dl.google.com/linux/chrome/deb/ stable main"
- "deb https://packages.cloud.google.com/apt cloud-sdk main"
- "deb https://download.docker.com/linux/ubuntu bionic stable"
- "deb [arch=amd64] https://apt.releases.hashicorp.com bionic main"
- name: add PPAs
apt_repository:
repo: "{{ item }}"
loop:
- ppa:linrunner/tlp
- name: Install common apt packages
apt:
name: "{{ item }}"
state: latest
loop:
- software-properties-common
- apt-transport-https
- curl
- git
- atom
- google-chrome-stable
- google-cloud-sdk
- docker-ce
- docker-ce-cli
- containerd.io
- ubuntu-restricted-extras
- libavcodec-extra
- libdvd-pkg
- gdebi
- synaptic
- flashplugin-installer
- pepperflashplugin-nonfree
- tlp
- tlp-rdw
- linux-firmware
- terraform
- packer
- vagrant
- virtualbox
- virtualbox-ext-pack
- name: install docker-compose via pip
pip:
name: docker-compose
state: latest
- name: install global python packages
pip:
name: "{{ item }}"
state: latest
loop:
- poetry
- black
- isort
- python-language-server[all]
- name: Install packages from URL
apt:
deb: "{{ item }}"
state: present
loop:
- https://downloads.slack-edge.com/linux_releases/slack-desktop-4.8.0-amd64.deb
- name: Install/update nvidia drivers
shell: ubuntu-drivers autoinstall >> /usr/local/ubuntu-drivers.txt
args:
creates: /usr/local/ubuntu-drivers.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment