forked from calvinbui/ansible-monorepo
/
phpinfoil.yml
64 lines (54 loc) · 1.81 KB
/
phpinfoil.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
---
- hosts: homelab
vars:
application: phpinfoil
docker_network: "{{ networks.iot }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
- name: Clone repo
ansible.builtin.git:
repo: "https://github.com/TheyKilledKenny/PHPinfoil/"
version: "main"
single_branch: true
dest: "{{ config_directory }}"
update: true
notify: Restart
register: _phpinfoil_repo_updated
- name: Build image
community.docker.docker_image:
name: "{{ application }}"
build:
path: "{{ config_directory }}"
dockerfile: Dockerfile
pull: true
source: build
state: present
force_source: "{{ true if _phpinfoil_repo_updated.changed else false }}"
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: "{{ application }}"
volumes:
- "{{ config_directory }}/cache:/var/www/html/cache"
- "{{ common_directory_games }}/Switch/Games:/var/www/html/data/games"
ipv4_address: "{{ docker_network.prefix }}.65"
labels:
chadburn.enabled: "true"
chadburn.job-exec.phpinfoil-reset-cache.schedule: "@every 1m"
chadburn.job-exec.phpinfoil-reset-cache.command: "/usr/bin/curl --silent --output /dev/null http://localhost/?reset"
chadburn.job-exec.phpinfoil-reset-cache.tty: "true"
com.centurylinklabs.watchtower.enable: "false"