diff --git a/tasks/config.yml b/tasks/config.yml index b1f7e2a..ca1a323 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,5 +1,13 @@ --- - name: Create service directory + file: + path: '{{ nimbus_fluffy_service_path }}' + state: directory + owner: '{{ nimbus_fluffy_user }}' + group: '{{ nimbus_fluffy_group }}' + mode: 0775 + +- name: Create data directory file: path: '{{ nimbus_fluffy_data_path }}' state: directory @@ -31,7 +39,7 @@ dest: '{{ nimbus_fluffy_rpc_script_path }}' owner: '{{ nimbus_fluffy_user }}' group: '{{ nimbus_fluffy_group }}' - mode: 0750 + mode: 0755 - name: Create Ansible toggle script copy: diff --git a/tasks/consul.yml b/tasks/consul.yml index f0b7cc9..8fc9a5b 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -9,10 +9,11 @@ port: '{{ nimbus_fluffy_listening_port }}' address: '{{ nimbus_fluffy_public_address }}' tags: ['{{ env }}.{{ stage }}', 'eth1', 'nimbus'] - #checks: - # - name: '{{ nimbus_fluffy_consul_service_name }}-test-health' - # type: 'http' - # http: 'http://localhost:{{ nimbus_fluffy_rest_port }}/eth/v1/node/version' + checks: + - name: '{{ nimbus_fluffy_consul_service_name }}-health' + type: 'script' + script: '{{ nimbus_fluffy_rpc_script_path }} discv5_nodeInfo' + timeout: '5s' - id: '{{ nimbus_fluffy_service_name }}-metrics' name: '{{ nimbus_fluffy_consul_metrics_service_name }}' diff --git a/templates/rpc.sh.j2 b/templates/rpc.sh.j2 index 95b5e15..e95c2b9 100644 --- a/templates/rpc.sh.j2 +++ b/templates/rpc.sh.j2 @@ -26,7 +26,7 @@ PAYLOAD="{ }" # The jq script checks if error exists and adjusts exit code. -curl -sS -X POST --max-time 10 \ +curl -sSf -X POST --max-time 5 \ -H "Content-type:application/json" \ --data "${PAYLOAD}" \ "${URL}" | \