noticket - cleanup of unused sites, containers
This commit is contained in:
@@ -1,131 +0,0 @@
|
||||
---
|
||||
- name: create required graylog volumes
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ podman_subuid.stdout }}"
|
||||
group: "{{ podman_user }}"
|
||||
mode: 0755
|
||||
notify: restorecon podman
|
||||
loop:
|
||||
- "{{ graylog_path }}/mongo"
|
||||
- "{{ graylog_path }}/opensearch"
|
||||
- "{{ graylog_path }}/conf"
|
||||
- "{{ graylog_path }}/bin"
|
||||
|
||||
- name: copy configuration files
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "files/graylog/{{ item.src }}"
|
||||
dest: "{{ graylog_path }}/{{ item.dest }}"
|
||||
owner: "{{ podman_subuid.stdout }}"
|
||||
group: "{{ podman_user }}"
|
||||
mode: 0644
|
||||
loop:
|
||||
- src: "graylogctl"
|
||||
dest: "bin/graylogctl"
|
||||
- src: "graylog.conf"
|
||||
dest: "conf/graylog.conf"
|
||||
notify: restorecon podman
|
||||
|
||||
- name: unshare chown the opensearch volume
|
||||
become: true
|
||||
become_user: "{{ podman_user }}"
|
||||
changed_when: false
|
||||
ansible.builtin.command: |
|
||||
podman unshare chown -R 1000:1000 {{ graylog_path }}/opensearch
|
||||
|
||||
- name: flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- 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: "{{ db_image }}"
|
||||
restart_policy: on-failure:3
|
||||
network:
|
||||
- shared
|
||||
volumes:
|
||||
- "{{ graylog_path }}/mongo:/data/db"
|
||||
|
||||
- name: create systemd startup job for graylog-mongo
|
||||
include_tasks: podman/systemd-generate.yml
|
||||
vars:
|
||||
container_name: graylog-mongo
|
||||
|
||||
- import_tasks: podman/podman-check.yml
|
||||
vars:
|
||||
container_name: graylog-opensearch
|
||||
container_image: "{{ os_image }}"
|
||||
|
||||
- name: create graylog opensearch container
|
||||
become: true
|
||||
become_user: "{{ podman_user }}"
|
||||
containers.podman.podman_container:
|
||||
name: graylog-opensearch
|
||||
image: "{{ os_image }}"
|
||||
restart_policy: on-failure:3
|
||||
network:
|
||||
- shared
|
||||
volumes:
|
||||
- "{{ graylog_path }}/opensearch:/usr/share/opensearch/data"
|
||||
env:
|
||||
OPENSEARCH_JAVA_OPTS: "-Xms1g -Xmx1g"
|
||||
bootstrap.memory_lock: "true"
|
||||
discovery.type: "single-node"
|
||||
action.auto_create_index: "false"
|
||||
plugins.security.ssl.http.enabled: "false"
|
||||
plugins.security.disabled: "true"
|
||||
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "{{ graylog_secret }}"
|
||||
|
||||
- name: create systemd startup job for graylog-opensearch
|
||||
include_tasks: podman/systemd-generate.yml
|
||||
vars:
|
||||
container_name: graylog-opensearch
|
||||
|
||||
- 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: "{{ image }}"
|
||||
restart_policy: on-failure:3
|
||||
sysctl:
|
||||
net.ipv6.conf.all.disable_ipv6: 1
|
||||
net.ipv6.conf.default.disable_ipv6: 1
|
||||
network:
|
||||
- shared
|
||||
volumes:
|
||||
- "{{ graylog_path }}/conf:/usr/share/graylog/data/config"
|
||||
- "{{ graylog_path }}/bin:/usr/share/graylog/bin"
|
||||
env:
|
||||
GRAYLOG_PASSWORD_SECRET: "{{ graylog_secret }}"
|
||||
GRAYLOG_ROOT_PASSWORD_SHA2: "{{ graylog_root_pass_sha2 }}"
|
||||
GRAYLOG_HTTP_EXTERNAL_URI: http://{{ ansible_default_ipv4.address }}:9000/
|
||||
GRAYLOG_HTTP_BIND_ADDRESS: 0.0.0.0:9000
|
||||
GRAYLOG_MONGODB_URI: mongodb://graylog-mongo/graylog
|
||||
GRAYLOG_ELASTICSEARCH_HOSTS: http://graylog-opensearch:9200
|
||||
GRAYLOG_REPORT_DISABLE_SANDBOX: "true"
|
||||
ports:
|
||||
- "{{ graylog_port }}:9000"
|
||||
- "{{ syslog_udp_default }}:{{ syslog_udp_default }}/udp"
|
||||
- "{{ syslog_udp_unifi }}:{{ syslog_udp_unifi }}/udp"
|
||||
- "{{ syslog_udp_error }}:{{ syslog_udp_error }}/udp"
|
||||
|
||||
- name: create systemd startup job for graylog
|
||||
include_tasks: podman/systemd-generate.yml
|
||||
vars:
|
||||
container_name: graylog
|
||||
Reference in New Issue
Block a user