-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprovision.yml
41 lines (35 loc) · 1.32 KB
/
provision.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
---
- name: Install nginx, Docker, and Docker CLI on Ubuntu 22.04 LTS
hosts: "{{ target_host }}"
remote_user: "{{ ansible_user | default('root') }}"
become: yes
pre_tasks:
- name: Ensure apt cache is updated.
apt: update_cache=true cache_valid_time=600
- name: Check if ansibleadmin user exists
command: "id ansibleadmin"
ignore_errors: true
register: user_exists
- set_fact:
ansible_user: "{{ 'ansibleadmin' if user_exists.rc == 0 else 'root' }}"
- name: Ignore PEP 668 because it's silly.
ansible.builtin.file:
path: /usr/lib/python3.12/EXTERNALLY-MANAGED
state: absent
vars:
pip_install_packages:
- name: docker
roles:
- { role: common, tags: [common] }
- { role: users, tags: [users] }
- { role: geerlingguy.git }
- { role: geerlingguy.firewall, tags: [security] }
- { role: geerlingguy.security, tags: [security] }
- { role: geerlingguy.nginx, tags: [nginx] }
- { role: geerlingguy.certbot, tags: [letsencrypt] }
- { role: geerlingguy.pip, tags: [docker] }
- { role: geerlingguy.docker, tags: [docker] }
- { role: cronjobs, tags: [cronjobs] }
- { role: nginx-setup, tags: [nginx, nginx-setup] }
- { role: custom-systemd, tags: [systemd] }
- { role: darkwizard242.lazydocker, tags: [ common ]}