Premier commit
This commit is contained in:
44
roles/docker-graylog/files/docker-compose.yml
Normal file
44
roles/docker-graylog/files/docker-compose.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
version: '2'
|
||||
services:
|
||||
# MongoDB: https://hub.docker.com/_/mongo/
|
||||
mongodb:
|
||||
image: mongo:3
|
||||
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4
|
||||
environment:
|
||||
- http.host=172.16.0.20
|
||||
- transport.host=localhost
|
||||
- network.host=0.0.0.0
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
mem_limit: 1g
|
||||
# Graylog: https://hub.docker.com/r/graylog/graylog/
|
||||
graylog:
|
||||
image: graylog/graylog:2.5.1
|
||||
environment:
|
||||
# CHANGE ME!
|
||||
- GRAYLOG_PASSWORD_SECRET=somepasswordpepper
|
||||
# Password: admin
|
||||
- GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
|
||||
- GRAYLOG_WEB_ENDPOINT_URI=http://127.0.0.1:9000/api
|
||||
links:
|
||||
- mongodb:mongo
|
||||
- elasticsearch
|
||||
depends_on:
|
||||
- mongodb
|
||||
- elasticsearch
|
||||
ports:
|
||||
# Graylog web interface and REST API
|
||||
- 9000:9000
|
||||
# Syslog TCP
|
||||
- 515:514
|
||||
# Syslog UDP
|
||||
- 515:514/udp
|
||||
# GELF TCP
|
||||
- 12201:12201
|
||||
# GELF UDP
|
||||
- 12201:12201/udp
|
13
roles/docker-graylog/files/fstab
Normal file
13
roles/docker-graylog/files/fstab
Normal file
@@ -0,0 +1,13 @@
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
# Use 'blkid' to print the universally unique identifier for a
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
/dev/mapper/stretch64--vg-root / ext4 errors=remount-ro 0 1
|
||||
# /boot was on /dev/sda1 during installation
|
||||
UUID=8f340ef0-94a1-4730-8da3-81ce5e38d666 /boot ext2 defaults 0 2
|
||||
/dev/mapper/stretch64--vg-swap_1 none swap sw 0 0
|
||||
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
|
||||
/dev/sdb1 /var/lib/containers ext4 defaults 0 0
|
2
roles/docker-graylog/files/https_proxy.conf
Normal file
2
roles/docker-graylog/files/https_proxy.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[Service]
|
||||
Environment="HTTPS_PROXY=http://192.168.99.99:8080/"
|
3
roles/docker-graylog/handlers/main.yml
Normal file
3
roles/docker-graylog/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: restart docker
|
||||
service: name=docker state=restarted
|
62
roles/docker-graylog/tasks/main.yml
Normal file
62
roles/docker-graylog/tasks/main.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
- name: Installation de apt-transport-https
|
||||
apt: name=apt-transport-https state=present
|
||||
|
||||
- name: Installation de ca-certificates
|
||||
apt: name=ca-certificates state=present
|
||||
|
||||
- name: Installation de gnupg2
|
||||
apt: name=gnupg2 state=present
|
||||
|
||||
- name: Installation de software-properties-common
|
||||
apt: name=software-properties-common state=present
|
||||
|
||||
- name: Installation de sudo
|
||||
apt: name=sudo state=present
|
||||
|
||||
- name: Installation de docker
|
||||
shell: export https_proxy=http://192.168.99.99:8080 && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
|
||||
|
||||
- name: Récupération des paquets docker-ce et docker-compose
|
||||
shell: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
|
||||
|
||||
- name: Création du répertoire docker.service.d
|
||||
file:
|
||||
path: /etc/systemd/system/docker.service.d
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0775
|
||||
recurse: yes
|
||||
|
||||
- name: Copie https_proxy.conf
|
||||
copy: src=https_proxy.conf dest=/etc/systemd/system/docker.service.d/
|
||||
notify:
|
||||
- restart docker
|
||||
|
||||
- name: Vérification des nouveaux paquets
|
||||
shell: sudo apt-get update
|
||||
|
||||
- name: Installation de docker-ce
|
||||
shell: sudo apt-get install -y docker-ce
|
||||
|
||||
- name: Installation de docker-compose
|
||||
shell: export https_proxy=http://192.168.99.99:8080 && curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
|
||||
- name: Modification des droits de docker-compose
|
||||
shell: chmod +x /usr/local/bin/docker-compose
|
||||
|
||||
- name: Copie du fichier fstab
|
||||
copy: src=fstab dest=/etc/
|
||||
|
||||
- name: Création du répertoire graylog
|
||||
shell: mkdir /root/graylog
|
||||
|
||||
- name: Copie du docker-compose.yml graylog
|
||||
copy: src=docker-compose.yml dest=/root/graylog
|
||||
|
||||
- name: Changement du système de fichier de /dev/sdb1 en ext4
|
||||
shell: mkfs.ext4 /dev/sdb1
|
||||
|
||||
- name: Montage /dev/sdb1 sur /var/lib/docker
|
||||
shell: mount /dev/sdb1 /var/lib/docker
|
Reference in New Issue
Block a user