setting up graylog docker swarm services

This commit is contained in:
2017-06-14 14:22:05 -04:00
parent a05d635641
commit aa4f5952d1
18 changed files with 402 additions and 44 deletions

View File

@@ -12,6 +12,10 @@
- "letsencrypt"
when: ansible_os_family == "Debian"
- name: create webroot /var/www/xai-corp.net
file:
state: directory
path: /var/www/xai-corp.net
- name: create first certificates
command: "letsencrypt certonly --webroot -w /var/www/xai-corp.net -d {{ item }}"

View File

@@ -1,8 +1,10 @@
---
# main tasks for running graylog on a docker host
# configure host for graylog
# create folders for certs, data,
- name: create data folders (/opt/dkregistry)
run_once: true
file:
path: "{{ item }}"
state: directory
@@ -17,6 +19,7 @@
- /opt/shared/graylog/data/mongo
- name: install default config files
run_once: true
copy:
src: "{{ item }}"
dest: "/opt/shared/graylog/config/{{ item }}"
@@ -24,12 +27,9 @@
- graylog.conf
- log4j2.xml
- name: copy composer file
copy:
src: docker-compose.yml
dest: /opt/shared/graylog/docker-compose.yml
- name: run docker up
shell: "docker-compose down && docker-compose up -d"
args:
chdir: /opt/shared/graylog
# setup graylog docker service
#- name: run docker up
# shell: "DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml graylog"
# run_once: true
# args:
# chdir: roles/docker_graylog/files

View File

@@ -25,8 +25,14 @@
repo: deb https://apt.dockerproject.org/repo ubuntu-xenial main
state: present
- name: import repo key
apt_key:
id: 58118E89F3A912897C070ADBF76221572C52609D
keyserver: "hkp://ha.pool.sks-keyservers.net:80"
state: present
- name: install prerequisits
shell: apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
shell: apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual
- name: create docker group
@@ -72,7 +78,7 @@
## install docker-compose
- name: install docker-compose from git repo
shell: |
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
## expose the docker daemon on tcp

View File

@@ -29,16 +29,22 @@ gluster IN A 192.168.2.12
home02 IN A 192.168.2.22
dkhost IN A 192.168.2.41
dkhost IN A 192.168.2.43
dkhost IN A 192.168.2.53
dkhost IN A 192.168.2.54
dkhost01 IN A 192.168.2.41
dkregistry IN A 192.168.2.41
sql IN A 192.168.2.41
tripbuilder IN A 192.168.2.41
logs IN A 192.168.2.42
dkhost02 IN A 192.168.2.43
fs IN A 192.168.2.43
git IN A 192.168.2.43
dkui IN A 192.168.2.43
jenkins IN A 192.168.2.43
logs IN A 192.168.2.43
dkhost03 IN A 192.168.2.53
dkhost04 IN A 192.168.2.54

View File

@@ -21,3 +21,5 @@ $ORIGIN 2.168.192.IN-ADDR.ARPA.
22 IN PTR home02.xai-corp.net.
41 IN PTR dkhost01.xai-corp.net.
43 IN PTR dkhost02.xai-corp.net.
53 IN PTR dkhost03.xai-corp.net.
54 IN PTR dkhost04.xai-corp.net.