Initial commit

This commit is contained in:
Adriano Caloiaro 2020-05-21 09:23:17 -04:00
commit e141e03880
No known key found for this signature in database
GPG key ID: 9FFD0E7601F166AB
9 changed files with 296 additions and 0 deletions

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# Local Setup
## Installation
```bash
$ sudo apt install ansible
$ ansible-playbook desktop.yml --limit localhost -v -K
```

2
ansible.cfg Normal file
View file

@ -0,0 +1,2 @@
[defaults]
inventory = ./local

43
desktop.yml Normal file
View file

@ -0,0 +1,43 @@
---
- name: Provision a new work computer
hosts: all, localhost
gather_facts: yes
vars:
user:
name: adriano
group: adriano
home: /home/adriano
pre_tasks:
- name: What is this?
tags: pre_tasks
debug:
msg: "{{ ansible_distribution }}"
- name: Update all packages
tags: pre_tasks
apt:
upgrade: dist
update_cache: yes
become: true
roles:
- {role: regolith/base, tags: base, become: true}
- {role: regolith/user, tags: user}
#- {role: desktop/alacritty, tags: alacritty}
#- {role: desktop/neovim, tags: neovim}
#- {role: desktop/iptables, tags: iptables, become: true}
# post_tasks:
#- name: Add {{ user.name }} to docker group
#tags:
#- docker
#- groups
#user:
#name: "{{ user.name }}"
#groups:
#- docker
#- sudo
#append: true
#become: true

5
local Normal file
View file

@ -0,0 +1,5 @@
[local]
localhost ansible_connection=local
[local:vars]
ansible_python_interpreter=/usr/bin/python3

View file

@ -0,0 +1,86 @@
# vim: set foldmethod=marker nospell:
---
- name: Install packages # {{{
tags: [packages, core]
apt:
name: "{{packages}}"
state: latest
update_cache: true
# }}}
- name: Install desktop packages # {{{
tags: [packages, desktop, i3packages]
apt:
name:
- gimp
- i3lock-fancy
- i3xrocks-battery
- i3xrocks-cpu-usage
- i3xrocks-media-player
- i3xrocks-memory
- i3xrocks-net-traffic
- i3xrocks-nm-vpn
- i3xrocks-volume
- i3xrocks-weather
- qutebrowser # This is to get the prereqs
state: latest
# }}}
- name: Install zoom client # {{{
tags: [packages, desktop, zoom]
apt:
deb: https://zoom.us/client/latest/zoom_amd64.deb
state: present
# }}}
# Install spotify {{{
- name: Add apt keys for spotify
tags: [packages, spotify]
apt_key:
url: https://download.spotify.com/debian/pubkey.gpg
- name: Add apt repository for spotify
tags: [packages, spotify]
apt_repository:
repo: deb http://repository.spotify.com stable non-free
state: present
update_cache: yes
- name: Install spotify
tags: [packages, spotify]
apt:
pkg: spotify-client
state: present
# }}}
# Install docker # {{{
- name: Add apt keys for docker
tags: [packages, docker]
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- name: Add apt repository for docker
tags: [packages, docker]
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ docker_engine.ubuntu_release }} stable"
state: present
update_cache: yes
- name: Install docker
tags: [packages, docker]
apt:
pkg: docker-ce
state: present
# }}}
- name: Install docker-compose # {{{
tags: [packages, docker, docker-compose]
get_url:
url: "https://github.com/docker/compose/releases/download/{{ docker_compose.version }}/docker-compose-Linux-x86_64"
dest: /usr/local/bin/docker-compose
owner: root
group: root
mode: 0755
# }}}
- name: Install jq # {{{
tags: jq
get_url:
url: https://github.com/stedolan/jq/releases/download/jq-{{ jq.version }}/jq-linux64
dest: /usr/local/bin/jq
owner: root
group: root
mode: 0755
force: true
# }}}

View file

@ -0,0 +1,25 @@
docker_compose:
version: 1.25.4
docker_engine:
version: 19*
ubuntu_release: bionic
jq:
version: "1.6"
packages:
- bash
- cmake
- ctags
- curl
- elinks
- git
- golang
- gnupg2
- htop
- libasound2-dev # di-tui
- libffi-dev # qutebrowser
- regolith-st
- tmux

View file

@ -0,0 +1,3 @@
#!/bin/bash
gopass "$@" | head -1

View file

@ -0,0 +1,117 @@
# vim: set foldmethod=marker:
---
- name: Install di-tui
tags: [music]
shell: |
go get -u github.com/acaloiaro/di-tui
# Install gopass {{{
- name: Set gopass url
tags: [gopass]
set_fact:
gopass_url: https://github.com/gopasspw/gopass/releases/download/v{{ gopass.version }}/gopass-{{ gopass.version }}-linux-amd64.tar.gz
- name: Create gopass install dir
tags: [gopass]
file: path=/tmp/gopass state=directory
- name: Unpack gopass
tags: [gopass]
unarchive:
src: "{{ gopass_url }}"
dest: /tmp/gopass/
remote_src: true
- name: Install gopass
tags: [gopass]
become: true
copy:
src: /tmp/gopass/gopass
remote_src: true
dest: /usr/local/bin/gopass
owner: root
group: root
mode: 0755
- name: Install gopass completion
tags: [gopass]
become: true
copy:
src: /tmp/gopass/zsh.completion
remote_src: true
dest: /usr/local/share/zsh/site-functions/_gopass
owner: root
group: root
- name: Remove gopass installation files
tags: [gopass]
file:
path: /tmp/gopass
state: absent
# }}}
# install oh-my-zsh {{{
- name: Install Oh-My-Zsh
tags: [zsh]
command: curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh
# }}}
- name: Set shell to zsh # {{{
tags: [zsh]
become: true
user:
name: "{{ user.name }}"
append: true
shell: /usr/bin/zsh
# }}}
- name: Ensure bin exists
tags: [yadm, gopass]
file:
dest: ~/bin
mode: 0755
state: directory
- name: Install slack client # {{{
tags: [packages, desktop, slack]
apt:
deb: "https://downloads.slack-edge.com/linux_releases/slack-desktop-{{ slack.version }}-amd64.deb"
state: present
# }}}
# {{{ Install gopasspwd
- name: Copy gopasspwd
tags: [gopass]
copy:
src: gopasspwd
dest: ~/bin
mode: 0755
# }}}
- name: Install asdf #{{{
tags: [asdf]
git:
repo: https://github.com/asdf-vm/asdf.git
dest: ~/.asdf
version: "{{asdf.version}}"
- name: Install asdf plugins
tags: [asdf, asdf-plugins]
shell: |
. ~/.asdf/asdf.sh
asdf plugin add {{item.name}}
args:
executable: /bin/bash
creates: "~/.asdf/plugins/{{item.name}}"
with_items: "{{asdf.plugins}}"
- name: Install versions
tags: [asdf, asdf-plugins]
shell: |
. ~/.asdf/asdf.sh
asdf install {{item.name}} {{item.version}}
asdf global {{item.name}} {{item.version}}
asdf reshim
args:
executable: /bin/bash
creates: "~/.asdf/installs/{{item.name}}/{{item.version}}"
with_items: "{{asdf.plugins}}"
#}}}

View file

@ -0,0 +1,6 @@
gopass:
version: 1.9.2
slack:
version: 4.4.3