major cleanup of ansible tasks in podman role

This commit is contained in:
Bastian de Byl
2023-07-24 13:38:34 -04:00
parent 71e9f4590b
commit 4c40a42707
18 changed files with 227 additions and 249 deletions

View File

@@ -13,7 +13,6 @@
- "{{ graylog_path }}/elastic"
- "{{ graylog_path }}/conf"
- "{{ graylog_path }}/bin"
tags: graylog
- name: copy configuration files
become: true
@@ -29,7 +28,6 @@
- src: "graylog.conf"
dest: "conf/graylog.conf"
notify: restorecon podman
tags: graylog
- name: unshare chown the elastic volume
become: true
@@ -37,41 +35,43 @@
changed_when: false
ansible.builtin.command: |
podman unshare chown -R 1000:1000 {{ graylog_path }}/elastic
tags: graylog
- name: flush handlers
ansible.builtin.meta: flush_handlers
tags: graylog
- import_tasks: podman/podman-check.yml
vars:
container_name: graylog-mongo
container_image: "{{ db_image }}"
- name: create graylog mongodb container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: graylog-mongo
image: docker.io/mongo:4.2
recreate: false
restart: false
image: "{{ db_image }}"
restart_policy: on-failure:3
network:
- shared
volumes:
- "{{ graylog_path }}/mongo:/data/db"
tags: graylog
- name: create systemd startup job for graylog-mongo
include_tasks: systemd-generate.yml
include_tasks: podman/systemd-generate.yml
vars:
container_name: graylog-mongo
tags: graylog
- import_tasks: podman/podman-check.yml
vars:
container_name: graylog-elastic
container_image: "{{ es_image }}"
- name: create graylog elasticsearch container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: graylog-elastic
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
recreate: false
restart: false
image: "{{ es_image }}"
restart_policy: on-failure:3
network:
- shared
@@ -83,22 +83,23 @@
network.host: "0.0.0.0"
cluster.name: "graylog"
ES_JAVA_OPTS: "-Dlog4j2.formatMsgNoLookups=true -Xms512m -Xmx2048m"
tags: graylog
- name: create systemd startup job for graylog-elastic
include_tasks: systemd-generate.yml
include_tasks: podman/systemd-generate.yml
vars:
container_name: graylog-elastic
tags: graylog
- import_tasks: podman/podman-check.yml
vars:
container_name: graylog
container_image: "{{ image }}"
- name: create graylog container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: graylog
image: docker.io/graylog/graylog:4.3.11
recreate: true
restart: true
image: "{{ image }}"
restart_policy: on-failure:3
sysctl:
net.ipv6.conf.all.disable_ipv6: 1
@@ -120,10 +121,8 @@
- "{{ syslog_udp_default }}:{{ syslog_udp_default }}/udp"
- "{{ syslog_udp_unifi }}:{{ syslog_udp_unifi }}/udp"
- "{{ syslog_udp_error }}:{{ syslog_udp_error }}/udp"
tags: graylog
- name: create systemd startup job for graylog
include_tasks: systemd-generate.yml
include_tasks: podman/systemd-generate.yml
vars:
container_name: graylog
tags: graylog