-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplaybook.yml
84 lines (72 loc) · 1.87 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
- name: Setup server for Plex and friends
hosts: "all"
become: false
gather_facts: true
tasks:
- name: Install basic tools
apt: name={{item}} state=latest update_cache=yes
with_items: [wget, curl, make, ufw]
become: true
- name: Install Docker
# apt: name=docker-ce state=latest
# sudo apt-get upgrade docker-ce
shell: curl -L https://get.docker.com | bash creates=/etc/docker/ warn=False
become: true
- name: Install Docker Compose
pip:
name: docker-compose
state: latest
become: true
- name: Add docker-compose alias
lineinfile:
path: /home/vagrant/.bash_aliases
create: true
line: "alias ddc='f(){(cd /vagrant && docker-compose \"$@\")};f'"
- name: Make sure we don't have the default ctop
apt: name=ctop state=absent
become: true
- name: Add ctop alias
lineinfile:
path: /home/vagrant/.bash_aliases
line: 'alias ctop="docker run --rm -ti --name=ctop -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest"'
- name: Add user to docker group
user:
name: '{{ ansible_user_id }}'
groups: docker
append: yes
become: true
# # Setup Firewall rules
# - ufw:
# logging: on
# become: true
# - ufw:
# direction: incoming
# policy: deny
# become: true
# - ufw:
# direction: outgoing
# policy: allow
# become: true
# - ufw:
# rule: allow
# port: "{{item}}"
# proto: tcp
# with_items: [80, 443, ssh, 32400, 2015]
# become: true
# - ufw:
# rule: allow
# src: '{{ item }}'
# with_items:
# - 172.16.0.0/12
# become: true
# - ufw:
# state: enabled
# become: true
# - name: Create user
# user:
# name: plexflix
# uid: 2000
# groups: docker
# Add my public-key
# git clone plexflix
# create configuration