Skip to content
Snippets Groups Projects
Commit 590d4920 authored by Temur Maisuradze's avatar Temur Maisuradze
Browse files

Merge branch 'dev5' into 'master'

Dev5

See merge request !2
parents 8065bf39 610c626c
No related branches found
No related tags found
1 merge request!2Dev5
Showing
with 161 additions and 87 deletions
---
- name: Manage docker containers
hosts: soctoolsmain
roles:
- docker
---
- name: Reconfigure and start haproxy
hosts: haproxy
roles:
- haproxy
- name: Reconfigure and start mysql
hosts: mysql
roles:
- mysql
- name: Reconfigure and start Cassandra
hosts: cassandra
roles:
- cassandra
- name: Reconfigure and start Keycloak
hosts: keycloakcontainers
roles:
- keycloak
- name: Reconfigure and start MISP
hosts: mispcontainers
roles:
- misp
- name: Reconfigure and start NiFi
hosts: nificontainers
roles:
- nifi
- name: Reconfigure and start TheHive
hosts: thehive
roles:
- thehive
- name: Reconfigure and start Cortex
hosts: cortex
roles:
- cortex
- name: Reconfigure and start OpenDistro for Elasticsearch
hosts: odfeescontainers
roles:
- odfees
- name: Reconfigure and start OpenDistro Kibana for Elasticsearch
hosts: odfekibanacontainers
roles:
- odfekibana
- name: Install and run filebeat
hosts: filebeat
roles:
- filebeat
---
- name: Configure Cassandra
remote_user: cassandra
template:
src: cassandra.yaml.j2
dest: /usr/share/cassandra/conf/cassandra.yaml
- name: Set Autostart for supervisord's services
replace:
path: /etc/supervisord.conf
regexp: '^autostart=false$'
replace: 'autostart=true'
--- ---
- include: init.yml
tags:
- init
- include: start.yml - include: start.yml
tags: tags:
- start - start
- start-cassandra
- init
- include: stop.yml - include: stop.yml
tags: tags:
- stop - stop
......
...@@ -4,3 +4,10 @@ ...@@ -4,3 +4,10 @@
remote_user: root remote_user: root
command: "supervisorctl restart cassandra" command: "supervisorctl restart cassandra"
- name: Wait for Cassandra
remote_user: root
wait_for:
host: "{{groups['cassandra'][0]}}"
port: 9042
state: started
delay: 5
--- ---
- name: Configure Cassandra
remote_user: cassandra
template:
src: cassandra.yaml.j2
dest: /usr/share/cassandra/conf/cassandra.yaml
- name: Start Cassandra - name: Start Cassandra
remote_user: root remote_user: root
command: "supervisorctl start cassandra" command: "supervisorctl start cassandra"
...@@ -18,10 +12,4 @@ ...@@ -18,10 +12,4 @@
state: started state: started
delay: 5 delay: 5
- name: Set Autostart for supervisord's services
replace:
path: /etc/supervisord.conf
regexp: '^autostart=false$'
replace: 'autostart=true'
...@@ -6,10 +6,3 @@ ...@@ -6,10 +6,3 @@
src: cassandra.yaml.j2 src: cassandra.yaml.j2
dest: /usr/share/cassandra/conf/cassandra.yaml dest: /usr/share/cassandra/conf/cassandra.yaml
- name: Wait for Cassandra
remote_user: root
wait_for:
host: "{{groups['cassandra'][0]}}"
port: 9042
state: started
delay: 5
---
- name: Copy cacert to ca-trust dir
remote_user: root
copy:
src: "{{playbook_dir}}/secrets/CA/ca.crt"
dest: /etc/pki/ca-trust/source/anchors/ca.crt
- name: Install cacert to root truststore
remote_user: root
command: "update-ca-trust"
- name: Copy certificates in cortex conf dir
remote_user: cortex
copy:
src: "{{ item }}"
dest: "/etc/cortex/"
mode: 0600
with_items:
- "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.p12"
- "{{playbook_dir}}/secrets/CA/issued/{{ inventory_hostname }}.crt"
- "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.key"
- "{{playbook_dir}}/secrets/CA/cacerts.jks"
- "{{playbook_dir}}/secrets/CA/ca.crt"
- name: Get openid authkey
set_fact:
cortexsecret: "{{lookup('file', '{{playbook_dir}}/secrets/tokens/cortexsecret',convert_data=False) | from_json}}"
- name: Configure embedded Elasticsearch 6
remote_user: root
template:
src: jvm.options.j2
dest: /etc/elasticsearch/jvm.options
- name: Configure Cortex
remote_user: cortex
template:
src: application.conf.j2
dest: /etc/cortex/application.conf
- name: Set Autostart for supervisord's services
replace:
path: /etc/supervisord.conf
regexp: '^autostart=false$'
replace: 'autostart=true'
--- ---
- include: init.yml
tags:
- init
- include: start.yml - include: start.yml
tags: tags:
- start - start
- start-cortex
- init
- include: stop.yml - include: stop.yml
tags: tags:
- stop - stop
......
--- ---
- name: Copy cacert to ca-trust dir
remote_user: root
copy:
src: "{{playbook_dir}}/secrets/CA/ca.crt"
dest: /etc/pki/ca-trust/source/anchors/ca.crt
- name: Install cacert to root truststore
remote_user: root
command: "update-ca-trust"
- name: Copy certificates in cortex conf dir
remote_user: cortex
copy:
src: "{{ item }}"
dest: "/etc/cortex/"
mode: 0600
with_items:
- "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.p12"
- "{{playbook_dir}}/secrets/CA/issued/{{ inventory_hostname }}.crt"
- "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.key"
- "{{playbook_dir}}/secrets/CA/cacerts.jks"
- "{{playbook_dir}}/secrets/CA/ca.crt"
- name: Get openid authkey
set_fact:
cortexsecret: "{{lookup('file', '{{playbook_dir}}/secrets/tokens/cortexsecret',convert_data=False) | from_json}}"
- name: Configure embedded Elasticsearch 6
remote_user: root
template:
src: jvm.options.j2
dest: /etc/elasticsearch/jvm.options
- name: Start embedded Elasticsearch 6 - name: Start embedded Elasticsearch 6
remote_user: root remote_user: root
command: "supervisorctl start elasticsearch" command: "supervisorctl start elasticsearch"
- name: Configure Cortex
remote_user: cortex
template:
src: application.conf.j2
dest: /etc/cortex/application.conf
- name: Start Cortex - name: Start Cortex
remote_user: root remote_user: root
command: "supervisorctl start cortex" command: "supervisorctl start cortex"
...@@ -55,9 +16,3 @@ ...@@ -55,9 +16,3 @@
state: started state: started
delay: 5 delay: 5
- name: Set Autostart for supervisord's services
replace:
path: /etc/supervisord.conf
regexp: '^autostart=false$'
replace: 'autostart=true'
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
interactive: "yes" interactive: "yes"
with_items: "{{ groups['cassandra'] }}" with_items: "{{ groups['cassandra'] }}"
tags: tags:
- start - start-docker-containers
- name: Disconnect cassandra containers from network and remove - name: Disconnect cassandra containers from network and remove
docker_container: docker_container:
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
state: absent state: absent
with_items: "{{ groups['cassandra'] }}" with_items: "{{ groups['cassandra'] }}"
tags: tags:
- stop - stop-docker-containers
...@@ -8,15 +8,12 @@ ...@@ -8,15 +8,12 @@
networks: networks:
- name: "{{ soctools_netname }}" - name: "{{ soctools_netname }}"
networks_cli_compatible: yes networks_cli_compatible: yes
# published_ports:
# - "9001:9001"
volumes: volumes:
- "{{item}}:/var/lib/elasticsearch/" - "{{item}}:/var/lib/elasticsearch/"
interactive: "yes" interactive: "yes"
with_items: "{{ groups['cortex'] }}" with_items: "{{ groups['cortex'] }}"
tags: tags:
- start - start-docker-containers
- startcortex
- name: Disconnect cortex containers from network and remove - name: Disconnect cortex containers from network and remove
docker_container: docker_container:
...@@ -24,5 +21,4 @@ ...@@ -24,5 +21,4 @@
state: absent state: absent
with_items: "{{ groups['cortex'] }}" with_items: "{{ groups['cortex'] }}"
tags: tags:
- stop - stop-docker-containers
- stopcortex
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
- "9001:9001" - "9001:9001"
interactive: "yes" interactive: "yes"
tags: tags:
- start - start-docker-containers
- name: Destroy haproxy container - name: Destroy haproxy container
docker_container: docker_container:
name: "{{ haproxy_name }}" name: "{{ haproxy_name }}"
state: absent state: absent
tags: tags:
- stop - stop-docker-containers
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
interactive: "yes" interactive: "yes"
with_items: "{{ groups['keycloakcontainers'] }}" with_items: "{{ groups['keycloakcontainers'] }}"
tags: tags:
- start - start-docker-containers
- name: Disconnect keycloak containers from network and remove - name: Disconnect keycloak containers from network and remove
docker_container: docker_container:
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
state: absent state: absent
with_items: "{{ groups['keycloakcontainers'] }}" with_items: "{{ groups['keycloakcontainers'] }}"
tags: tags:
- stop - stop-docker-containers
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
published_ports: published_ports:
- "6443:6443" - "6443:6443"
tags: tags:
- start - start-docker-containers
- name: Destroy misp container - name: Destroy misp container
docker_container: docker_container:
name: "{{ misp_name }}" name: "{{ misp_name }}"
state: absent state: absent
tags: tags:
- stop - stop-docker-containers
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
volumes: volumes:
- "{{mysql_name}}:/var/opt/rh/rh-mariadb103/lib/mysql" - "{{mysql_name}}:/var/opt/rh/rh-mariadb103/lib/mysql"
tags: tags:
- start - start-docker-containers
- name: Destroy mysql container - name: Destroy mysql container
docker_container: docker_container:
name: "{{ mysql_name }}" name: "{{ mysql_name }}"
state: absent state: absent
tags: tags:
- stop - stop-docker-containers
...@@ -7,6 +7,5 @@ ...@@ -7,6 +7,5 @@
ipam_config: ipam_config:
- subnet: "{{ soctools_network }}" - subnet: "{{ soctools_network }}"
tags: tags:
- start - start-docker-containers
- startcortex
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
name: "{{ soctools_netname }}" name: "{{ soctools_netname }}"
state: absent state: absent
tags: tags:
- stop - stop-docker-containers
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
interactive: "yes" interactive: "yes"
with_items: "{{ groups['nificontainers'] }}" with_items: "{{ groups['nificontainers'] }}"
tags: tags:
- start - start-docker-containers
- name: Disconnect Nifi containers from network and remove - name: Disconnect Nifi containers from network and remove
docker_container: docker_container:
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
state: absent state: absent
with_items: "{{ groups['nificontainers'] }}" with_items: "{{ groups['nificontainers'] }}"
tags: tags:
- stop - stop-docker-containers
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
interactive: "yes" interactive: "yes"
with_items: "{{ groups['odfeescontainers'] }}" with_items: "{{ groups['odfeescontainers'] }}"
tags: tags:
- start - start-docker-containers
- name: Disconnect odfe elasticsearch containers from network and remove - name: Disconnect odfe elasticsearch containers from network and remove
docker_container: docker_container:
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
state: absent state: absent
with_items: "{{ groups['odfeescontainers'] }}" with_items: "{{ groups['odfeescontainers'] }}"
tags: tags:
- stop - stop-docker-containers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment