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

79 lines
1.5 KiB
YAML
Raw Normal View History

2022-04-12 16:26:46 +02:00
---
- name: "Install haproxy via apt"
apt:
update_cache: yes
state: present
name:
- haproxy
2022-04-17 12:22:22 +02:00
- name: Copy haproxy configuration
copy:
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
2022-04-12 17:33:48 +02:00
service:
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"
apt:
update_cache: yes
state: present
name:
- python3-certbot
2022-04-17 12:22:22 +02:00
- name: Generate certificate for all proxied domains
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
- name: Enable and start haproxy
service:
name: haproxy
state: started
enabled: yes
2022-04-17 12:22:22 +02:00
- name: Copy certbot cronjob
copy:
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
- name: Copy datadog repo config
copy:
src: datadog.list
dest: /etc/apt/sources.list.d/datadog.list
mode: 0655
owner: root
group: root
- name: "Install datadog-agent"
apt:
update_cache: yes
state: present
name:
- datadog-agent
- name: "Generate datadog configuration"
ansible.builtin.template:
src: datadog.yaml
2022-05-04 17:05:19 +02:00
dest: /etc/datadog-agent/datadog.yaml
2022-04-17 12:22:22 +02:00
owner: dd-agent
group: dd-agent
mode: '0640'
2022-04-16 19:55:29 +02:00
...