-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.yml
87 lines (74 loc) · 2.42 KB
/
bootstrap.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
# Playbook used to setup local environment.
# This configuration is suited for Ubuntu-based environments.
# It performs setup of:
# - Docker
# - SSH
# It assumes Ansible and Python packages are already installed on the control node.
---
- name: Install Docker and SSH client
hosts: localhost
become: true
tasks:
- name: Fetch Machine Architecture
ansible.builtin.command: "dpkg --print-architecture"
changed_when: false
register: machine_architecture
- name: Install Required Packages (Docker + SSH)
ansible.builtin.apt:
pkg:
- openssh-client
- ca-certificates
- curl
- gnupg
- lsb-release
- python3-requests
update_cache: true
- name: Setup Docker
block:
- name: Docker PGP Key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/trusted.gpg.d/docker.asc
mode: "0644"
- name: Docker APT Repository
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.asc]
https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
state: present
- name: Install Docker Packages
ansible.builtin.apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
- websocketd
update_cache: true
- name: Add user to docker group
user:
name: "{{ lookup('env', 'USER') }}"
groups: docker
append: yes
- name: Install docker-compose v1.29.2
ansible.builtin.get_url:
url: https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
dest: /usr/bin/docker-compose
mode: "0755"
- name: Install pypsrp python package
ansible.builtin.pip:
name: pypsrp
- name: Install requests[socks] python package
ansible.builtin.pip:
name: requests[socks]
- name: Install dotenv python package
ansible.builtin.pip:
name: python-dotenv
- name: Install Fetch CTFs dependencies
ansible.builtin.pip:
requirements: "$PWD/ctfs/requirements.txt"
# ------------------ Mesh ------------------ #
- name: Mesh Network Tasks
hosts: localhost
roles:
- mesh