forked from craigfurman/linux-playground
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yml
101 lines (88 loc) · 2.57 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
- hosts: all
vars:
downloads_dir: /tmp/downloads
tasks:
- name: add apt repositories
become: true
become_method: sudo
apt_repository: repo={{ item }}
with_items:
- ppa:git-core/ppa
- name: install apt packages
become: true
become_method: sudo
apt:
name: "{{ packages }}"
vars:
packages:
- automake
- autotools-dev
- build-essential
- curl
- debootstrap
- direnv
- exuberant-ctags
- git
- htop
- libcap-dev
- libncurses5-dev
- libseccomp-dev
- libtool
- neovim
- pkg-config
- python-dev
- python-pip
- python3-dev
- python3-pip
- shellcheck
- silversearcher-ag
- tmux
- tree
- util-linux
- valgrind
- vim-nox
- wget
- btrfs-progs
- libbtrfs-dev
- name: install neovim pip package
pip: name=neovim executable=/usr/bin/pip
- name: install neovim pip3 package
pip: name=neovim executable=/usr/bin/pip3
- name: ensure downloads directory exists
file: path={{downloads_dir}} state=directory
- name: copy config files
copy: src={{item.src}} dest={{item.dst}} mode=0664 force=true
with_items:
- {src: config/tmux.conf, dst: ~/.tmux.conf}
- {src: config/gitconfig, dst: ~/.gitconfig}
- {src: config/vimrc.local.plugins, dst: ~/.vimrc.local.plugins}
- name: copy systemwide config files
become: true
become_method: sudo
copy: src={{item.src}} dest={{item.dst}} mode=0664 force=true
with_items:
- {src: config/golang.sh, dst: /etc/profile.d/golang.sh}
- {src: config/utils.sh, dst: /etc/profile.d/utils.sh}
- name: get TPM
git:
repo: https://github.com/tmux-plugins/tpm
dest: ~/.tmux/plugins/tpm
- name: download go
get_url: url=https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz dest={{downloads_dir}}/go.tar.gz
- name: extract go
become: true
become_method: sudo
unarchive: copy=no src={{downloads_dir}}/go.tar.gz dest=/usr/local creates=/usr/local/go
- name: clone vim config
git: repo=https://github.com/masters-of-cats/a-new-hope dest=~/.config/nvim
- name: install docker
shell: curl -sSL https://get.docker.com/ | sh
- name: check if test rootfs exists
stat: path=/tmp/test/rootfs
register: rootfs
- name: extract test rootfs
become: true
become_method: sudo
shell: mkdir -p /tmp/test/rootfs && docker run -d busybox echo hi | xargs docker export | tar -x -C /tmp/test/rootfs
when: not rootfs.stat.isdir is defined or not rootfs.stat.isdir