Skip to content

Commit 96f172a

Browse files
author
anandkumarpatel
committed
Merge pull request #202 from CodeNow/swarm-api
Swarm api
2 parents 17309c6 + 693bf1d commit 96f172a

12 files changed

Lines changed: 20 additions & 11 deletions

File tree

ansible/api-core.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- hosts: charon
66
- hosts: rabbitmq
77
- hosts: redis
8+
- hosts: swarm-manager
89

910
- hosts: api
1011
vars_files:

ansible/group_vars/all.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ pg_database: astral
4545
# charon
4646
charon_port: 53
4747

48+
# consul
49+
consul_host_address: "{{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}"
50+
consul_api_port: 8500
51+
4852
# datadog
4953
datadog_api_key: 6488896fe0c811965ef233b96809d70d
5054
datadog_host_address: "{{ ansible_default_ipv4.address }}"
@@ -103,6 +107,7 @@ shiva_port: 3000
103107

104108
# swarm
105109
swarm_master_port: 2375
110+
swarm_host_address: "{{ hostvars[groups['swarm-manager'][0]]['ansible_default_ipv4']['address'] }}"
106111

107112
# navi/link
108113
navi_mongo_database: navi

ansible/group_vars/alpha-api.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ container_envs: >
5050
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
5151
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
5252
-e DOCKER_IMAGE_BUILDER_WEAVE_PATH={{ weave_path }}
53+
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
5354
5455
container_run_opts: >
5556
-h {{ name }}

ansible/group_vars/alpha-consul.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ container_run_opts: >
2121
-p {{ ansible_default_ipv4.address }}:8302:8302
2222
-p {{ ansible_default_ipv4.address }}:8302:8302/udp
2323
-p {{ ansible_default_ipv4.address }}:8400:8400
24-
-p {{ ansible_default_ipv4.address }}:8500:8500
24+
-p {{ ansible_default_ipv4.address }}:{{ consul_api_port }}:8500
2525
--restart=always
2626
2727
container_run_args: >

ansible/group_vars/alpha-swarm-deamon.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "swarm-deamon"
22

33
# container_kill_start settings
44
container_image: swarm
5-
container_tag: 0.4.0
5+
container_tag: 1.0.0
66

77
# container_kill_start vars
88
log_driver: json-file
@@ -13,4 +13,4 @@ container_run_opts: >
1313
container_run_args: >
1414
join
1515
--addr={{ ansible_default_ipv4.address }}:{{ docker_port }}
16-
token://{{ swarm_token }}
16+
consul://{{ consul_host_address }}:{{ consul_api_port }}/swarm

ansible/group_vars/alpha-swarm-manager.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "swarm-manager"
22

33
# container_kill_start settings
44
container_image: swarm
5-
container_tag: 0.4.0
5+
container_tag: 1.0.0
66

77
# container_kill_start vars
88
log_driver: json-file
@@ -18,4 +18,4 @@ container_run_args: >
1818
--tlscacert={{ docker_ca_path }}
1919
--tlscert={{ docker_cert_path }}
2020
--tlskey={{ docker_key_path }}
21-
token://{{ swarm_token }}
21+
consul://{{ consul_host_address }}:{{ consul_api_port }}/swarm

ansible/group_vars/alpha-workers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ container_envs: >
4646
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
4747
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
4848
-e DOCKER_IMAGE_BUILDER_WEAVE_PATH={{ weave_path }}
49+
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
4950
5051
container_run_opts: >
5152
-h {{ name }}

ansible/roles/docker/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- name: change core dump path
33
sudo: yes
4+
when: docker_config == "runnable"
45
tags: coreDump
56
sysctl:
67
name=kernel.core_pattern
@@ -39,6 +40,7 @@
3940

4041
- name: copy docker config file
4142
sudo: yes
43+
when: docker_config == "runnable"
4244
template:
4345
src={{ docker_config }}
4446
dest=/etc/default/docker

ansible/roles/docker/templates/docks

Lines changed: 0 additions & 6 deletions
This file was deleted.

ansible/swarm-deamon.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
- hosts: consul
3+
24
- hosts: docks
35
vars_files:
46
- "group_vars/alpha-swarm-deamon.yml"

0 commit comments

Comments
 (0)