mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Merge pull request #1449 from mhkarimi1383/ansible-unofficial
making it functional when you have a minimal host
This commit is contained in:
commit
c742153d4d
6 changed files with 42 additions and 11 deletions
|
@ -1,10 +1,11 @@
|
||||||
# Ansible Playbook to install uptime kuma using docker
|
# Ansible Playbook to install uptime kuma using docker
|
||||||
|
|
||||||
This playbook comes with three roles
|
This playbook comes with three tags
|
||||||
|
|
||||||
1. docker (to install docker)
|
1. requirements (will install anything needed to make next parts working)
|
||||||
2. nginx (to install nginx using docker with ssl)
|
2. docker (to install docker)
|
||||||
3. uptime kuma (to install uptime kuma using docker)
|
3. nginx (to install nginx using docker with ssl)
|
||||||
|
4. uptime kuma (to install uptime kuma using docker)
|
||||||
|
|
||||||
To see more info see docker-compose, tasks and config files
|
To see more info see docker-compose, tasks and config files
|
||||||
I will try to make this readme better
|
I will try to make this readme better
|
||||||
|
|
|
@ -3,16 +3,17 @@
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
pip_install_packages:
|
pip_install_packages:
|
||||||
|
- name: wheel
|
||||||
|
- name: pip
|
||||||
|
state: latest
|
||||||
|
- name: setuptools
|
||||||
|
- name: cffi
|
||||||
- name: docker
|
- name: docker
|
||||||
|
- name: dockerpty
|
||||||
docker_compose_version: "v2.0.1"
|
docker_compose_version: "v2.0.1"
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: Ensure {{inventory_hostname}} is set as hostname
|
|
||||||
hostname:
|
|
||||||
name: "{{inventory_hostname}}"
|
|
||||||
tags: ["hostname"]
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- {role: requirements, tags: ["docker", "requirements"]}
|
||||||
- {role: geerlingguy.docker, tags: ["docker"]}
|
- {role: geerlingguy.docker, tags: ["docker"]}
|
||||||
- {role: geerlingguy.pip, tags: ["docker"]}
|
- {role: geerlingguy.pip, tags: ["docker"]}
|
||||||
- {role: nginx, tags: ["nginx"]}
|
- {role: nginx, tags: ["nginx"]}
|
||||||
|
|
|
@ -77,7 +77,7 @@ http {
|
||||||
# location ~ (?<no_slash>.+)/$ {
|
# location ~ (?<no_slash>.+)/$ {
|
||||||
# return 302 https://$host$no_slash;
|
# return 302 https://$host$no_slash;
|
||||||
# }
|
# }
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass http://uptime-kuma:3001/;
|
proxy_pass http://uptime-kuma:3001/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|
11
ansible/roles/requirements/tasks/main.yml
Normal file
11
ansible/roles/requirements/tasks/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- name: Ensure {{inventory_hostname}} is set as hostname
|
||||||
|
hostname:
|
||||||
|
name: "{{inventory_hostname}}"
|
||||||
|
tags: ["hostname"]
|
||||||
|
|
||||||
|
- include_tasks: setup-RedHat.yml
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- include_tasks: setup-Debian.yml
|
||||||
|
when: ansible_os_family == 'Debian'
|
9
ansible/roles/requirements/tasks/setup-Debian.yml
Normal file
9
ansible/roles/requirements/tasks/setup-Debian.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
- name: Ensure packages for some requirements are installed
|
||||||
|
apt:
|
||||||
|
pkg:
|
||||||
|
- libffi-dev
|
||||||
|
- libzbar-dev
|
||||||
|
- libzbar0
|
||||||
|
- python3-docopt
|
||||||
|
update_cache: yes
|
||||||
|
state: present
|
9
ansible/roles/requirements/tasks/setup-RedHat.yml
Normal file
9
ansible/roles/requirements/tasks/setup-RedHat.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
- name: Ensure packages for some requirements are installed
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- libffi-devel
|
||||||
|
- zbar-devel
|
||||||
|
- zbar
|
||||||
|
- python3-docopt
|
||||||
|
update_cache: yes
|
||||||
|
state: present
|
Loading…
Reference in a new issue