vm-ansible/roles/neko/tasks/main.yaml

74 lines
1.6 KiB
YAML
Raw Normal View History

2022-04-12 16:26:46 +02:00
---
- name: "Install haproxy via apt"
2023-03-05 19:00:38 +01:00
ansible.builtin.apt:
2022-04-12 16:26:46 +02:00
update_cache: yes
state: present
name:
- haproxy
2022-04-17 12:22:22 +02:00
- name: Copy haproxy configuration
2023-03-05 19:00:38 +01:00
ansible.builtin.copy:
2022-04-17 12:22:22 +02:00
src: haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
mode: 0644
owner: root
group: root
2022-05-04 14:45:34 +02:00
- name: Enable and stop haproxy
2023-03-05 19:00:38 +01:00
ansible.builtin.service:
2022-04-12 17:33:48 +02:00
name: haproxy
2022-05-04 14:45:34 +02:00
state: stopped
2022-04-12 17:33:48 +02:00
enabled: yes
2022-04-12 17:13:13 +02:00
- name: "Install certbot via apt"
2023-03-05 19:00:38 +01:00
ansible.builtin.apt:
2022-04-12 17:13:13 +02:00
update_cache: yes
state: present
name:
- python3-certbot
2022-12-30 16:09:47 +01:00
- name: Generate certificate for Neko domain
2023-03-05 19:00:38 +01:00
ansible.builtin.command:
2022-05-04 14:45:34 +02:00
cmd: certbot certonly --non-interactive --agree-tos -m tormakristof@tormakristof.eu --standalone -d neko.tormakristof.eu
2022-12-30 16:09:47 +01:00
- name: Generate certificate for TURN domain
2023-03-05 19:00:38 +01:00
ansible.builtin.command:
2022-12-30 16:09:47 +01:00
cmd: certbot certonly --non-interactive --agree-tos -m tormakristof@tormakristof.eu --standalone -d turn.tormakristof.eu
2022-05-04 14:45:34 +02:00
- name: Enable and start haproxy
2023-03-05 19:00:38 +01:00
ansible.builtin.service:
2022-05-04 14:45:34 +02:00
name: haproxy
state: started
enabled: yes
2022-04-17 12:22:22 +02:00
- name: Copy certbot cronjob
2023-03-05 19:00:38 +01:00
ansible.builtin.copy:
2022-04-17 12:22:22 +02:00
src: certbot
dest: /etc/cron.weekly/certbot
mode: 0755
owner: root
group: root
2022-04-12 16:26:46 +02:00
- name: Reset ufw rules to default
community.general.ufw:
state: reset
2022-04-12 16:49:59 +02:00
- name: Enable ufw
community.general.ufw:
state: enabled
2022-04-17 12:22:22 +02:00
2022-05-29 15:15:02 +02:00
- name: "Install haproxy exporter"
2023-03-05 19:00:38 +01:00
ansible.builtin.apt:
2022-04-17 12:22:22 +02:00
update_cache: yes
state: present
name:
2022-05-29 15:15:02 +02:00
- prometheus-haproxy-exporter
2022-05-29 21:28:56 +02:00
- name: Allow node-exporter via ufw
community.general.ufw:
rule: allow
port: 9100
proto: tcp
src: 192.168.69.0/24
2022-04-16 19:55:29 +02:00
...