Skip to content

Commit

Permalink
Merge pull request #11 from SODALITE-EU/fix/node_exporter
Browse files Browse the repository at this point in the history
Fixed node_exporter consul registration
  • Loading branch information
jramosrivas authored Mar 25, 2021
2 parents 780a483 + 9c9c481 commit 20da618
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions openstack/openstack_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ node_types:
consul_server_address:
description: Public IPv4 address of the consul server (for the node exporter to register into)
type: string
default: "/tmp"
default: ""
required: false
env:
description: Optional OpenStack environment
Expand Down Expand Up @@ -117,7 +117,7 @@ node_types:
primary: playbooks/vm_create.yml
dependencies:
- playbooks/egi_refresh_token.yml
- playbooks/node_exporter.json.j2
- artifacts/node_exporter.json.j2
delete:
inputs:
id: { type: string, default: { get_attribute: [ SELF, id ] } }
Expand Down
7 changes: 6 additions & 1 deletion openstack/playbooks/vm_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@
-o StrictHostKeyChecking=no
{{ additional_ssh_args | default("") }}
id: "{{ server_info.server.id }}"
public_adress: "{{ server_info.server.public_v4 }}"
public_address: "{{ server_info.server.public_v4 }}"


- hosts: vms
gather_facts: no
vars:
public_address: "{{ hostvars.server.public_address }}"
id: "{{ hostvars.server.id }}"

tasks:
- name: Wait for ssh to wake up
wait_for_connection:
Expand Down Expand Up @@ -178,3 +182,4 @@

- name: Register node-exporter in Consul server
shell: curl --request PUT --data @/tmp/node_exporter.json http://{{ consul_server_address|quote }}:8500/v1/agent/service/register
when: consul_server_address != ""

0 comments on commit 20da618

Please sign in to comment.