2020-12-30 15:41:34 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: recieve {{domain}} certificate
|
|
|
|
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
|
|
|
|
|
|
|
- name: configure {{domain}}.conf
|
2023-04-18 15:41:14 +02:00
|
|
|
template: src=roles/server_native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
|
2020-12-30 15:41:34 +01:00
|
|
|
notify: restart nginx
|
|
|
|
|
2020-12-31 09:44:05 +01:00
|
|
|
- name: create elasticsearch-sysctl.conf
|
|
|
|
copy:
|
|
|
|
src: "elasticsearch-sysctl.conf"
|
|
|
|
dest: /etc/sysctl.d/elasticsearch-sysctl.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
|
|
|
|
- name: set vm.max_map_count=262144
|
|
|
|
command:
|
|
|
|
cmd: sysctl -w vm.max_map_count=262144
|
|
|
|
|
2020-12-30 20:26:48 +01:00
|
|
|
- name: "create {{docker_elk_compose_path}}"
|
2020-12-30 15:41:34 +01:00
|
|
|
file:
|
2020-12-30 20:26:48 +01:00
|
|
|
path: "{{docker_elk_compose_path}}"
|
2020-12-30 15:41:34 +01:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
|
2023-04-18 15:41:14 +02:00
|
|
|
- name: git pull server_docker-elk
|
2020-12-30 20:26:48 +01:00
|
|
|
git:
|
2023-04-18 15:41:14 +02:00
|
|
|
repo: "https://github.com/kevinveenbirkenbach/server_docker-elk.git"
|
2020-12-30 20:26:48 +01:00
|
|
|
dest: "{{docker_elk_compose_path}}"
|
|
|
|
update: yes
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|
2023-05-28 23:08:38 +02:00
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Warn if repo is not reachable
|
|
|
|
debug:
|
|
|
|
msg: "Warning: Repository is not reachable."
|
|
|
|
when: git_result.failed
|
2020-12-30 20:26:48 +01:00
|
|
|
|
2023-04-19 00:03:13 +02:00
|
|
|
- name: copy docker-compose.yml
|
|
|
|
template: src=docker-compose.yml.j2 dest={{docker_elk_compose_path}}docker-compose.yml
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|
2020-12-30 20:26:48 +01:00
|
|
|
|
2020-12-30 15:41:34 +01:00
|
|
|
- name: copy elasticsearch.yml
|
2020-12-30 20:26:48 +01:00
|
|
|
template: src=elasticsearch.yml.j2 dest={{docker_elk_compose_path}}elasticsearch/config/elasticsearch.yml
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|
2020-12-30 15:41:34 +01:00
|
|
|
|
|
|
|
- name: copy kibana.yml
|
2020-12-30 20:26:48 +01:00
|
|
|
template: src=kibana.yml.j2 dest={{docker_elk_compose_path}}kibana/config/kibana.yml
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|
2020-12-30 15:41:34 +01:00
|
|
|
|
|
|
|
- name: copy logstash.yml
|
2020-12-30 20:26:48 +01:00
|
|
|
template: src=logstash.yml.j2 dest={{docker_elk_compose_path}}logstash/config/logstash.yml
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|
2020-12-30 15:41:34 +01:00
|
|
|
|
|
|
|
- name: copy logstash.conf
|
2020-12-30 20:26:48 +01:00
|
|
|
template: src=logstash.conf.j2 dest={{docker_elk_compose_path}}logstash/pipeline/logstash.conf
|
2023-04-18 15:41:14 +02:00
|
|
|
notify: recreate server_docker-elk
|