Skip to content

Commit cfc3dd1

Browse files
author
anandkumarpatel
committed
Merge pull request #216 from CodeNow/add-mavis-to-sauron
Add mavis to sauron, move sauron off the docks
2 parents 9faab90 + 8084a5d commit cfc3dd1

14 files changed

Lines changed: 124 additions & 61 deletions

File tree

ansible/beta-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ beta-redis
7676
[redis-slave]
7777
beta-redis-slave
7878

79+
[sauron]
80+
beta-services
81+
7982
[shiva]
8083
beta-services
8184

@@ -110,6 +113,7 @@ rabbitmq
110113
redis
111114
redis-slave
112115
registry
116+
sauron
113117
shiva
114118
swarm-manager
115119
web

ansible/gamma-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ gamma-redis
6767
[redis-slave]
6868
gamma-redis-slave
6969

70+
[sauron]
71+
gamma-services
72+
7073
[shiva]
7174
gamma-services
7275

@@ -96,6 +99,7 @@ mavis
9699
optimus
97100
rabbitmq
98101
eru
102+
sauron
99103
shiva
100104
swarm-manager
101105

ansible/group_vars/all.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ rabbit_port: 54321
102102
redis_host_address: "{{ hostvars[groups['redis'][0]]['ansible_default_ipv4']['address'] }}"
103103
redis_port: 6379
104104

105-
# sauron
106-
weave_path: "/usr/local/bin/weave"
107-
108105
# shiva
109106
pg_user: shiva
110107
shiva_port: 3000

ansible/group_vars/alpha-api.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ container_envs: >
4949
-e ROLLBAR_KEY={{ api_rollbar_key }}
5050
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
5151
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
52-
-e DOCKER_IMAGE_BUILDER_WEAVE_PATH={{ weave_path }}
5352
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
5453
5554
container_run_opts: >
Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# upstart template variables
22
name: sauron
33

4-
app_name: "{{ name }}"
5-
app_repo: "git@github.com:CodeNow/{{ name }}.git"
6-
7-
enviroment_vars:
8-
LOGGLY_TOKEN: "{{ loggly_token }}"
9-
RABBITMQ_HOSTNAME: "{{ rabbit_host_address }}"
10-
RABBITMQ_PASSWORD: "{{ rabbit_password }}"
11-
RABBITMQ_PORT: "{{ rabbit_port }}"
12-
RABBITMQ_USERNAME: "{{ rabbit_username }}"
13-
REDIS_IPADDRESS: "{{ redis_host_address }}"
14-
REDIS_PORT: "{{ redis_port }}"
4+
container_image: "registry.runnable.com/runnable/{{ name }}"
5+
container_tag: "{{ git_branch }}"
6+
repo: "git@github.com:CodeNow/{{ name }}.git"
7+
node_version: "4.2.2"
8+
npm_version: "2.14.7"
9+
10+
weave_path: "/bin/weave"
11+
docker_path: "/bin/docker"
12+
13+
dockerfile_pre_install_commands: [
14+
"curl -L https://get.docker.com/builds/Linux/x86_64/docker-1.6.2 -o {{ docker_path }}",
15+
"chmod a+x {{ docker_path }}",
16+
"curl -L https://github.com/weaveworks/weave/releases/download/v1.3.1/weave -o {{ weave_path }}",
17+
"chmod a+x {{ weave_path }}"
18+
]
19+
20+
container_envs: >
21+
-e LOGGLY_TOKEN="{{ loggly_token }}"
22+
-e MAVIS_URL="http://{{ mavis_hostname }}"
23+
-e RABBITMQ_HOSTNAME="{{ rabbit_host_address }}"
24+
-e RABBITMQ_PASSWORD="{{ rabbit_password }}"
25+
-e RABBITMQ_PORT="{{ rabbit_port }}"
26+
-e RABBITMQ_USERNAME="{{ rabbit_username }}"
27+
-e WEAVE_PATH={{ weave_path }}
28+
29+
container_run_opts: >
30+
-h {{ name }}
31+
-d
32+
-v /opt/ssl/docker/{{ name }}:/etc/ssl/docker:ro
33+
{{ container_envs }}

ansible/group_vars/alpha-workers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ container_envs: >
4545
-e ROLLBAR_KEY={{ api_rollbar_key }}
4646
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
4747
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
48-
-e DOCKER_IMAGE_BUILDER_WEAVE_PATH={{ weave_path }}
4948
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
5049
5150
container_run_opts: >
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- hosts: docks
2+
gather_facts: no
3+
serial: 1
4+
tasks:
5+
- name: kill weave containers
6+
sudo: yes
7+
shell: 'sudo docker ps | grep weaveworks/weave | cut -d" " -f 1 | xargs sudo docker kill'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
- hosts: docks
2+
gather_facts: no
3+
tasks:
4+
- fail: msg="`name` needs to be defined for this role"
5+
when: name is not defined
6+
7+
- name: stop service
8+
sudo: yes
9+
service:
10+
name={{ name }}
11+
state=stopped
12+
13+
- name: remove files
14+
sudo: yes
15+
file:
16+
path={{ item }}
17+
state=absent
18+
with_items:
19+
- /etc/init/{{ name }}.conf
20+
- /etc/init/{{ name }}.conf.bak
21+
- /etc/init/{{ name }}.override
22+
- /opt/runnable/{{ name }}

ansible/palantiri.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
- "group_vars/alpha-palantiri.yml"
77
roles:
88
- { role: notify, tags: "notify" }
9+
- { role: docker_client }
910
- { role: builder, tags: "build" }
1011
- { role: container_kill_start, tags: "deploy" }

ansible/prod-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ alpha-redis-slave
8585
[registry]
8686
alpha-registry
8787

88+
[sauron]
89+
alpha-api-old
90+
8891
[shiva]
8992
alpha-api-old
9093

@@ -118,6 +121,7 @@ rabbitmq
118121
redis
119122
redis-slave
120123
registry
124+
sauron
121125
shiva
122126
swarm-manager
123127
web

0 commit comments

Comments
 (0)