some minor features and fixes for ansible role

pull/662/head
Muhammed Hussein Karimi 3 years ago
parent f05651d235
commit 2c0e22ad31

@ -15,8 +15,8 @@ I will try to make this readme better
3. prepare inventory hosts 3. prepare inventory hosts
4. put your certificates in files section in nginx role with this structure below: 4. put your certificates in files section in nginx role with this structure below:
``` ```
ansible -> roles -> nginx -> ssl -> <uptime kuma domain>.fullchain.pem ansible -> roles -> nginx -> files -> ssl -> <uptime kuma domain>.fullchain.pem
ansible -> roles -> nginx -> ssl -> <uptime kuma domain>.privkey.pem ansible -> roles -> nginx -> files -> ssl -> <uptime kuma domain>.privkey.pem
``` ```
5. to run playbook 5. to run playbook
```bash ```bash
@ -25,7 +25,14 @@ ansible-playbook ./playbook.yml -i <your inventory path> -e "kuma_domain=<uptime
you can use other ansible playbook options too you can use other ansible playbook options too
> Note: Replace `<uptime kuma domain>` with your desired domain for uptime kuma > Note: Replace `<uptime kuma domain>` with your desired domain for uptime kuma
> replace `<version>` with a version from https://github.com/louislam/uptime-kuma/releases > replace `<version>` with a version from https://github.com/louislam/uptime-kuma/releases
> replace `<alpine or debian>` with one of options > replace `<alpine or debian>` with one of options
> `-e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>"` is not required and you can remove this part or change only one of them (kuma_image_os is debian & kuma_image_version is 1 by default) > `-e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>"` is not required and you can remove this part or change only one of them (kuma_image_os is debian & kuma_image_version is 1 by default)
> If you are not using root user as your ansible_user use -bK option to become root > If you are not using root user as your ansible_user use -bK option to become root
> instead of `-e "kuma_image_os=<alpine or debian>" -e "kuma_image_version=<version>"` You can use `-e kuma_tag=<uptime kuma full tag>` and replace `<uptime kuma full tag>` with your desired tag (e.g. `latest`)
> you can also create a yaml file with variables that you want to set & use it (also: ansible-vars)

@ -6,9 +6,14 @@
- name: docker - name: docker
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: geerlingguy.docker, tags: ["docker"]} - {role: geerlingguy.docker, tags: ["docker"]}
- {role: geerlingguy.pip, tags: ["docker"]} - {role: geerlingguy.pip, tags: ["docker"]}
- {role: kuma, tags: ["kuma"]} - {role: uptime-kuma, tags: ["kuma"]}
- {role: nginx, tags: ["nginx"]} - {role: nginx, tags: ["nginx"]}

@ -8,10 +8,10 @@
- /compose/volumes/nginx - /compose/volumes/nginx
- /compose/volumes/nginx/log/{{ kuma_domain }} - /compose/volumes/nginx/log/{{ kuma_domain }}
- name: Ensure nginx config directory exist - name: Ensure nginx SSL certificates exist
copy: copy:
src: ssl src: ssl
dest: /compose/volumes/nginx/ssl dest: /compose/volumes/nginx
mode: 'preserve' mode: 'preserve'
group: root group: root
owner: root owner: root

@ -1,3 +1,4 @@
--- ---
kuma_image_version: '1' kuma_image_version: '1'
kuma_image_os: 'debian' kuma_image_os: 'debian'
kuma_tag: "{{kuma_image_version}}-{{kuma_image_os}}"

@ -20,4 +20,3 @@
state: present state: present
project_src: /compose/kuma project_src: /compose/kuma
pull: yes pull: yes

@ -9,7 +9,7 @@ services:
volumes: volumes:
- '/compose/volumes/uptime-kuma:/app/data' - '/compose/volumes/uptime-kuma:/app/data'
container_name: uptime-kuma container_name: uptime-kuma
image: 'louislam/uptime-kuma:{{kuma_image_version}}-{{kuma_image_os}}' image: 'louislam/uptime-kuma:{{kuma_tag}}'
nginx: nginx:
ports: ports:

Loading…
Cancel
Save