Skip to content

Commit 5008b2e

Browse files
committed
Change the logic of fethcing prometheus ip address
1 parent 526379f commit 5008b2e

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

infrastructure/ansible/inventories/prometheus.aws_ec2.yml

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

infrastructure/ansible/playbooks/api/roles/api/tasks/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
mode: 0600
1313

1414
- name: Get the ip address of the prometheus production server
15-
command: cd $(git rev-parse --show-toplevel); ansible-inventory -i infrastructure/ansible/inventories/prometheus.aws_ec2.yml --list | jq -r '.aws_ec2.hosts[0]'
15+
command: aws ec2 describe-instances \
16+
--region eu-central-1 \
17+
--profile dump-monitoring \
18+
--filters "Name=tag:Project,Values=dump-monitoring" "Name=tag:Environment,Values=production" \
19+
--query 'Reservations[0].Instances[0].PublicIpAddress' \
20+
--output text
1621
register: production_ip
1722

1823
- name: Create new api docker container

0 commit comments

Comments
 (0)