Skip to content

Commit 3427908

Browse files
Merge branch 'master' into SAN-4053-user-tracking
2 parents 14373fd + b8917a6 commit 3427908

18 files changed

Lines changed: 147 additions & 58 deletions

File tree

ansible/base.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
---
2+
- hosts: localhost
3+
connection: local
4+
tasks:
5+
- fail: msg="`host` (target host) needs to be defined to run this role"
6+
when: host is not defined
7+
8+
- add_host:
9+
name={{ host }}
10+
groups=dock
11+
212
- hosts: "{{ host }}"
313
roles:
4-
- { role: notify, tags: [ notify ], app_name: base_sshd, git_branch: latest, name: base_sshd }
5-
- { role: package-dock, tags: [dock, package] }
6-
- { role: package-aws, tags: [dock, package] }
14+
- { role: package-dock, tags: [ dock, package ] }
15+
- { role: package-aws, tags: [ dock, package ] }
716
- { role: package_ntp }
8-
- { role: docker, tags: [docker] }
9-
- { role: datadog, tags: [datadog] }
10-
- { role: ulimits, tags: [ulimits] }
11-
- { role: loggly, tags: [loggly] }
17+
- { role: build_essential }
18+
- { role: docker, tags: [ docker ] }
19+
- { role: datadog, tags: [ datadog ] }
20+
- { role: ulimits, tags: [ ulimits ] }
21+
- { role: loggly, tags: [ loggly, clean ] }
1222
- { role: node }

ansible/delta-hosts/hosts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ delta-registry
9999
delta-dock-services
100100

101101
[swarm-manager]
102-
delta-dock-services
102+
delta-swarm-manager
103103

104104
[metis]
105105
delta-app-services

ansible/dock.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
- include: dock-init.yml git_branch="{{ dock_init_version }}"
1414
- include: filibuster.yml git_branch="{{ filibuster_version }}"
1515
- include: image-builder.yml git_branch="{{ image_builder_version }}"
16+
- include: krain.yml git_branch="{{ krain_version }}"

ansible/docker-listener.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- hosts: rabbitmq
33
- hosts: consul
4+
- hosts: swarm-manager
45

56
- hosts: docker-listener
67
vars_files:

ansible/eru.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- hosts: consul
33
- hosts: mongodb
44
- hosts: redis
5+
- hosts: rabbitmq
56
- hosts: socket-server-proxy
67

78
- hosts: eru

ansible/group_vars/alpha-eru.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ container_envs: >-
2727
-e MONGODB_REPLSET={{ eru_mongodb_replset }}
2828
-e MONGODB_USERNAME={{ eru_mongodb_username }}
2929
-e NODE_ENV=production
30+
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
31+
-e RABBITMQ_PORT={{ rabbit_port }}
32+
-e RABBITMQ_USERNAME={{ rabbit_username }}
33+
-e RABBITMQ_PASSWORD={{ rabbit_password }}
3034
-e REDIS_HOSTNAME={{ redis_host_address }}
3135
-e REDIS_PORT={{ redis_port }}
3236
-e RUNNABLE_DOMAIN={{ domain }}

ansible/group_vars/alpha-khronos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cron_rabbit_auth: --username {{ rabbit_username }} --password {{ rabbit_password
3030
container_envs: >
3131
-e API_SOCKET_SERVER=https://{{ api_socket_server_hostname }}
3232
-e API_URL={{ api_url }}
33+
-e CONSUL_HOST={{ consul_host_address }}:{{ consul_api_port }}
3334
-e CANARY_API_TOKEN={{ khronos_canary_token | default('undefined') }}
3435
-e CANARY_GITHUB_BRANCHES_INSTANCE_ID={{ khronos_canary_github_branches_instance_id | default('undefined') }}
3536
-e CANARY_LOG_INSTANCE_ID={{ khronos_canary_logs_instance_id | default('undefined') }}

ansible/group_vars/alpha-sauron.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dockerfile_pre_install_commands: [
1717
]
1818

1919
container_envs: >
20+
-e CONSUL_HOST={{ consul_host_address }}:{{ consul_api_port }}
2021
-e DATADOG_HOST={{ datadog_host_address }}
2122
-e DATADOG_PORT={{ datadog_port }}
2223
-e LOGGLY_TOKEN="{{ loggly_token }}"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# PLAYBOOK DOCUMENTATION: https://github.com/CodeNow/devops-scripts/wiki/Reset-Customer-Local-Registry
3+
set -e
4+
5+
export DOCK_INIT_BASE="/opt/runnable/dock-init"
6+
export CONSUL_HOSTNAME="{{ consul_host_address }}"
7+
export CONSUL_PORT="8500"
8+
export ORG_ID="$(cat /etc/default/docker | perl -n -e'/org=(\d+)/ && print $1')"
9+
export VAULT_TOKEN="{{ vault_token }}"
10+
11+
REGISTRY_STATUS=$(curl localhost/debug/health)
12+
if [[ "$REGISTRY_STATUS" == "404 page not found" ]]; then
13+
echo "do not need to fix registry"
14+
exit 0
15+
fi
16+
17+
CURRENT_REGISTRY=$(docker ps | awk '/bin\/registry/{ print $1 }')
18+
docker stop -t 5 "$CURRENT_REGISTRY"
19+
docker rm "$CURRENT_REGISTRY"
20+
21+
source "$DOCK_INIT_BASE/lib/container.sh"
22+
23+
echo "starting container"
24+
container::_start_registry_container
25+
26+
sleep 5
27+
28+
echo "checking container"
29+
curl localhost/debug/health
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# DOCUMENTATION https://github.com/CodeNow/devops-scripts/wiki/Reset-Customer-Local-Registry
3+
- hosts: consul
4+
5+
- hosts: docks
6+
gather_facts: no
7+
tasks:
8+
- fail: msg="`vault_token` needs to be defined for this role"
9+
when: vault_token is not defined
10+
11+
- fail: msg="`consul_host_address` needs to be defined for this role"
12+
when: consul_host_address is not defined
13+
14+
- name: put script on machine
15+
become: yes
16+
template:
17+
dest: /tmp/reset-registry.sh
18+
src: reset-registry.sh.j2
19+
mode: 0550
20+
21+
- name: run script
22+
become: yes
23+
command: /tmp/reset-registry.sh
24+
25+
- name: remove script
26+
become: yes
27+
command: shred -u /tmp/reset-registry.sh

0 commit comments

Comments
 (0)