Skip to content

Commit

Permalink
Add port to explosure port for containers.
Browse files Browse the repository at this point in the history
To explose docker's port to outside, adding 'port' statement in
docker-compose files. The messages (for kibana/jenkins URL) are
also modified to adjust docker cases.
  • Loading branch information
s1061123 committed Feb 21, 2017
1 parent ccd46e1 commit 6318d51
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docker-compose-dovetail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "8080:8080"

logstash:
build:
Expand All @@ -26,6 +28,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "5044:5044"

elasticsearch:
build:
Expand All @@ -38,6 +42,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "9200:9200"

kibana:
build:
Expand All @@ -61,3 +67,6 @@ services:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "443:443"
- "5601:5601"
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "8080:8080"

logstash:
build:
Expand All @@ -25,6 +27,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "5044:5044"

elasticsearch:
build:
Expand All @@ -37,6 +41,8 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "9200:9200"

kibana:
build:
Expand All @@ -49,3 +55,6 @@ services:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
entrypoint: /sbin/init
ports:
- "443:443"
- "5601:5601"
14 changes: 12 additions & 2 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@

post_tasks:
- name: Where is Kibana located?

debug:
msg: "Kibana can be reached at http://{{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}:5601/"
when: elk_deployed
when: elk_deployed and ansible_connection != 'docker'

- name: Where is Kibana located? (docker)
debug:
msg: "Kibana can be reached at http://localhost:5601/"
when: elk_deployed and ansible_connection == 'docker'

- hosts: jenkins_master
tags:
Expand All @@ -42,3 +46,9 @@
- name: Where is Jenkins Master located?
debug:
msg: "Jenkins Master can be reached at http://{{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}:8080/"
when: ansible_connection != 'docker'

- name: Where is Jenkins Master located? (docker)
debug:
msg: "Jenkins Master can be reached at http://localhost:8080/"
when: ansible_connection == 'docker'

0 comments on commit 6318d51

Please sign in to comment.