Skip to content

Commit 68ffe21

Browse files
use consul for swarm, update swarm to 1.0.0
1 parent 3f2df1f commit 68ffe21

8 files changed

Lines changed: 14 additions & 23 deletions

File tree

ansible/group_vars/all.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ pg_database: astral
4444
# charon
4545
charon_port: 53
4646

47+
# consul
48+
consul_host_address: "{{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}"
49+
consul_api_port: 8500
50+
4751
# datadog
4852
datadog_api_key: 6488896fe0c811965ef233b96809d70d
4953
datadog_host_address: "{{ ansible_default_ipv4.address }}"
@@ -102,4 +106,4 @@ shiva_port: 3000
102106

103107
# swarm
104108
swarm_master_port: 2375
105-
109+
swarm_host_address: "{{ hostvars[groups['swarm-manager'][0]]['ansible_default_ipv4']['address'] }}"

ansible/group_vars/alpha-api.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ 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://{{ hostvars[groups['swarm-manager'][0]]['ansible_default_ipv4']['address'] }}:2375
54-
-e CONTAINER_MEMORY_LIMIT_BYTES=100000000
53+
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
54+
5555
container_run_opts: >
5656
-h {{ name }}
5757
-d

ansible/group_vars/alpha-consul.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ container_run_opts: >
2020
-p {{ ansible_default_ipv4.address }}:8302:8302
2121
-p {{ ansible_default_ipv4.address }}:8302:8302/udp
2222
-p {{ ansible_default_ipv4.address }}:8400:8400
23-
-p {{ ansible_default_ipv4.address }}:8500:8500
23+
-p {{ ansible_default_ipv4.address }}:{{ consul_api_port }}:{{ consul_api_port }}
2424
--restart=always
2525
2626
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +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://{{ hostvars[groups['swarm-manager'][0]]['ansible_default_ipv4']['address'] }}:2375
50-
-e CONTAINER_MEMORY_LIMIT_BYTES=100000000
49+
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
5150
5251
container_run_opts: >
5352
-h {{ name }}

ansible/roles/docker/tasks/main.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,9 @@
3838
update_cache: yes
3939
state: present
4040

41-
- name: get org id
42-
sudo: yes
43-
when: docker_config == "docks"
44-
shell: "cut -d, -f 1 /opt/runnable/host_tags"
45-
register: org_id
46-
4741
- name: copy docker config file
4842
sudo: yes
43+
when: docker_config == "runnable"
4944
template:
5045
src={{ docker_config }}
5146
dest=/etc/default/docker

ansible/roles/docker/templates/docks

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

0 commit comments

Comments
 (0)