Skip to content

Commit

Permalink
Double timeouts for monitoring (#74)
Browse files Browse the repository at this point in the history
We're getting excessive warnings. I've pulled these numbers out of thin
air, opinions welcome.

---------

Co-authored-by: Daniel Matthews <[email protected]>
  • Loading branch information
paddyroddy and drmatthews authored Feb 16, 2024
1 parent e8bb00a commit 3a09e67
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 31 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
warn_list:
- no-handler
- galaxy[no-changelog]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Add issue to project

# yamllint disable-line rule:truthy
on:
issues:
types:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Linting

# yamllint disable-line rule:truthy
on:
push:
branches:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-firewalld.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test firewalld

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/molecule-install-xnat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Test install_xnat playbook

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-monitoring.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test install_monitoring playbook

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-nginx.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test nginx

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-postgresql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test PostgreSQL

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-provision.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test provision

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-provision_accounts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test provision_accounts

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule-python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test Python

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
name: Test with Molecule

# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
repos:
- repo: https://github.com/UCL-MIRSG/.github
rev: v0.40.0
rev: v0.47.0
hooks:
- id: mirsg-hooks
26 changes: 13 additions & 13 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"customManagers": [
{
"customType": "regex",
"description": "Update Tomcat version specfied in playbooks/group_vars/web.yml",
"description": "Update Tomcat version specified in playbooks/group_vars/web.yml",
"fileMatch": ["(^|/)*web.yml$"],
"matchStrings": ["tomcat_version:\\s?(?<currentValue>.*?)\\n"],
"depNameTemplate": "org.apache.tomcat:tomcat",
"datasourceTemplate": "maven"
},
{
"customType": "regex",
"description": "Update XNAT version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["(^|/)*defaults/main.yml$"],
"matchStrings": ["xnat_version:\\s?(?<currentValue>.*?)\\n"],
"depNameTemplate": "xnatdev/xnat-web",
Expand All @@ -53,79 +53,79 @@
},
{
"customType": "regex",
"description": "Update XNAT-sync plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT-sync plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["xsync-plugin-all-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatdev/xsync",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT ldap-auth plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT ldap-auth plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["ldap-auth-plugin-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/ldap-auth-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT Container Service plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT Container Service plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["container-service-(?<currentValue>.*?)-fat.jar"],
"depNameTemplate": "xnatdev/container-service",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT batch launch plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT batch launch plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["batch-launch-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/xnatx-batch-launch-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT dax plugin specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT dax plugin specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["dax-plugin-genProcData-(?<currentValue>.*?).jar"],
"depNameTemplate": "VUIIS/dax",
"datasourceTemplate": "custom.VUIIS-dax"
},
{
"customType": "regex",
"description": "Update OHIF Viewer plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update OHIF Viewer plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["ohif-viewer-(?<currentValue>.*?).jar"],
"depNameTemplate": "icrimaginginformatics/ohif-viewer-xnat-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT ML plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT ML plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["ml-plugin-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/ml-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT datasets plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT datasets plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["datasets-plugin-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/datasets-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT image viewer plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT image viewer plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["ximgview-plugin(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatdev/xnat-image-viewer-plugin",
"datasourceTemplate": "bitbucket-tags"
},
{
"customType": "regex",
"description": "Update XNAT dxm plugin version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT dxm plugin version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["dxm-settings-plugin-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/xnatx-dxm-settings-plugin",
Expand All @@ -134,7 +134,7 @@
},
{
"customType": "regex",
"description": "Update XNAT pipeline version specfied in roles/xnat/defaults/main.yml",
"description": "Update XNAT pipeline version specified in roles/xnat/defaults/main.yml",
"fileMatch": ["(^|/)*defaults/main.yml$"],
"matchStrings": ["xnat_pipeline_version:\\s?(?<currentValue>.*?)\\n"],
"depNameTemplate": "NrgXnat/xnat-pipeline-engine",
Expand Down
22 changes: 14 additions & 8 deletions roles/install_python/tasks/check_default_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
- name: Check if Python 2 is the default version for the OS
ansible.builtin.set_fact:
default_python_version: "2"
when: >
(ansible_os_family == 'RedHat') and (ansible_distribution_major_version | int < 8) or
(ansible_distribution == 'Debian') and (ansible_distribution_major_version | int < 10) or
(ansible_distribution == 'Ubuntu') and (ansible_distribution_major_version | int < 18)
when: >-
(ansible_os_family == 'RedHat') and
(ansible_distribution_major_version | int < 8) or
(ansible_distribution == 'Debian') and
(ansible_distribution_major_version | int < 10) or
(ansible_distribution == 'Ubuntu') and
(ansible_distribution_major_version | int < 18)
- name: Check if Python 3 is the default version for the OS
ansible.builtin.set_fact:
default_python_version: "3"
when: >
(ansible_os_family == 'RedHat') and (ansible_distribution_major_version | int >= 8) or
(ansible_distribution == 'Debian') and (ansible_distribution_major_version | int >= 10) or
(ansible_distribution == 'Ubuntu') and (ansible_distribution_major_version | int >= 18)
when: >-
(ansible_os_family == 'RedHat') and
(ansible_distribution_major_version | int >= 8) or
(ansible_distribution == 'Debian') and
(ansible_distribution_major_version | int >= 10) or
(ansible_distribution == 'Ubuntu') and
(ansible_distribution_major_version | int >= 18)
1 change: 1 addition & 0 deletions roles/monitoring_server/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Restart prometheus
community.docker.docker_container:
name: "{{ monitoring_server_prometheus.container_name }}"
Expand Down
10 changes: 5 additions & 5 deletions roles/monitoring_server/templates/prometheus_rules.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ groups:
rules:
- alert: SSLCertExpiringSoon
expr: probe_ssl_earliest_cert_expiry - time() < 60 * 60 * 24 * 14
for: 1m
for: 2m
labels:
severity: warning
annotations:
Expand All @@ -13,7 +13,7 @@ groups:
rules:
- alert: EndpointDown
expr: probe_success == 0
for: 1m
for: 5m
labels:
severity: critical
annotations:
Expand All @@ -40,17 +40,17 @@ groups:
description: "Instance memory usage more than 90% within 5 minutes, value:{{ $labels.value }}%"

- alert: CpuLoadHigh
expr: 100 - avg by(instance)(rate(node_cpu_seconds_total{mode="idle"}[5m]))*100 > 90
expr: 100 - avg by(instance)(rate(node_cpu_seconds_total{mode="idle"}[10m]))*100 > 90
for: 0m
labels:
severity: warning
annotations:
summary: Instance cpu load high (Instance:{{ $labels.instance }})
description: "Instance cpu load more than 90% within 5 minutes, value: {{ $labels.value }}%"
description: "Instance cpu load more than 90% within 10 minutes, value: {{ $labels.value }}%"

- alert: FilesystemFull
expr: 100 - node_filesystem_free_bytes{mountpoint!~"/*|/boot.*|/run.*"}/node_filesystem_size_bytes*100 > 90
for: 5m
for: 10m
labels:
severity: warning
annotations:
Expand Down
1 change: 1 addition & 0 deletions roles/nginx/molecule/resources/files/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

app = Flask(__name__)


@app.route("/")
def index():
return "<h1>Hello World!</h1>"
3 changes: 2 additions & 1 deletion roles/postgresql/molecule/centos7/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# test this scenario from the roles/postgresql directory with the command
# molecule --base-config ../../molecule_configs/centos7_base_config.yml test --scenario centos7
# molecule --base-config ../../molecule_configs/centos7_base_config.yml
# test --scenario centos7
2 changes: 1 addition & 1 deletion roles/provision_accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There are several variables that **must be set** to use this role.
containing:

- `username`: The name of the user
- `crypted_password`: Encrypted user password.
- `encrypted_password`: Encrypted user password.

`os_user_groups`: OS groups the user should belong to expressed as a single
string with commas separating each group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# mirsg.infrastructure.provision_accounts
os_users:
- username: test-user
crypted_password: $6$TSoIGqmpZJw24vqP$lrhHcIeuv3oi8kpBu3SVyqPeTLuXi5TJf5u7hUOY0vRb4MXWTp1Z/gsjAwC28EQrVnKOJwpw00tN8ExM6AoIC.
encrypted_password: $6$TSoIGqmpZJw24vqP$lrhHcIeuv3oi8kpBu3SVyqPeTLuXi5TJf5u7hUOY0vRb4MXWTp1Z/gsjAwC28EQrVnKOJwpw00tN8ExM6AoIC.

os_users_groups: "wheel"
2 changes: 1 addition & 1 deletion roles/provision_accounts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
state: present
groups: "{{ os_users_groups }}"
append: true
password: "{{ item.crypted_password }}"
password: "{{ item.encrypted_password }}"
update_password: always
loop: "{{ os_users }}"

0 comments on commit 3a09e67

Please sign in to comment.