mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2026-05-25 02:03:34 +00:00
Enhance Docker infrastructure dashboard by adding support for dozzle_agent_17 and fed437a0f191_tugtainer_socket_proxy. Update APT update card to include docker_17 entities and remove reboot status references. Refactor button card templates for improved clarity. Remove unused Activity Feed view and related configurations.
This commit is contained in:
@@ -90,6 +90,15 @@
|
||||
variables:
|
||||
restart_button: button.dozzle_agent_14_restart_container
|
||||
name: dozzle_agent_14
|
||||
- entity_id: binary_sensor.dozzle_agent_17_status
|
||||
options:
|
||||
type: custom:button-card
|
||||
template: bearstone_infra_container_row
|
||||
name: dozzle_agent_17
|
||||
icon: mdi:docker
|
||||
variables:
|
||||
restart_button: button.dozzle_agent_17_restart_container
|
||||
name: dozzle_agent_17
|
||||
- entity_id: binary_sensor.dozzle_status
|
||||
options:
|
||||
type: custom:button-card
|
||||
@@ -117,6 +126,15 @@
|
||||
variables:
|
||||
restart_button: button.esphome_restart_container
|
||||
name: esphome
|
||||
- entity_id: binary_sensor.fed437a0f191_tugtainer_socket_proxy_status
|
||||
options:
|
||||
type: custom:button-card
|
||||
template: bearstone_infra_container_row
|
||||
name: fed437a0f191_tugtainer_socket_proxy
|
||||
icon: mdi:docker
|
||||
variables:
|
||||
restart_button: button.fed437a0f191_tugtainer_socket_proxy_restart_container
|
||||
name: fed437a0f191_tugtainer_socket_proxy
|
||||
- entity_id: binary_sensor.foodie_tracker_status
|
||||
options:
|
||||
type: custom:button-card
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
- type: grid
|
||||
column_span: 4
|
||||
columns: 3
|
||||
columns: 4
|
||||
square: false
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
@@ -44,16 +44,22 @@
|
||||
entity: sensor.docker_10_apt_status
|
||||
variables:
|
||||
last_update_sensor: sensor.docker_10_apt_last_update
|
||||
reboot_status_sensor: sensor.docker_10_apt_reboot_status
|
||||
prune_button: button.carlo_hass_prune_unused_images
|
||||
name: docker_10
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_apt_prune_tile
|
||||
name: docker_17
|
||||
entity: sensor.docker_17_apt_status
|
||||
variables:
|
||||
last_update_sensor: sensor.docker_17_apt_last_update
|
||||
prune_button: button.docker17_prune_unused_images
|
||||
name: docker_17
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_apt_prune_tile
|
||||
name: docker_69
|
||||
entity: sensor.docker_69_apt_status
|
||||
variables:
|
||||
last_update_sensor: sensor.docker_69_apt_last_update
|
||||
reboot_status_sensor: sensor.docker_69_apt_reboot_status
|
||||
prune_button: button.docker69_prune_unused_images
|
||||
name: docker_69
|
||||
- type: custom:button-card
|
||||
@@ -62,7 +68,6 @@
|
||||
entity: sensor.docker_14_apt_status
|
||||
variables:
|
||||
last_update_sensor: sensor.docker_14_apt_last_update
|
||||
reboot_status_sensor: sensor.docker_14_apt_reboot_status
|
||||
prune_button: button.docker2_prune_unused_images
|
||||
name: docker_14
|
||||
|
||||
|
||||
@@ -365,45 +365,6 @@
|
||||
tap_action:
|
||||
action: none
|
||||
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_alert_row
|
||||
entity: binary_sensor.docker_10_apt_reboot_required
|
||||
name: docker_10 needs reboot
|
||||
icon: mdi:restart-alert
|
||||
variables:
|
||||
alert_kind: binary_on
|
||||
tap_action:
|
||||
action: navigate
|
||||
navigation_path: /dashboard-infrastructure/docker
|
||||
state_display: >
|
||||
[[[ return 'REBOOT REQUIRED'; ]]]
|
||||
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_alert_row
|
||||
entity: binary_sensor.docker_14_apt_reboot_required
|
||||
name: docker_14 needs reboot
|
||||
icon: mdi:restart-alert
|
||||
variables:
|
||||
alert_kind: binary_on
|
||||
tap_action:
|
||||
action: navigate
|
||||
navigation_path: /dashboard-infrastructure/docker
|
||||
state_display: >
|
||||
[[[ return 'REBOOT REQUIRED'; ]]]
|
||||
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_alert_row
|
||||
entity: binary_sensor.docker_69_apt_reboot_required
|
||||
name: docker_69 needs reboot
|
||||
icon: mdi:restart-alert
|
||||
variables:
|
||||
alert_kind: binary_on
|
||||
tap_action:
|
||||
action: navigate
|
||||
navigation_path: /dashboard-infrastructure/docker
|
||||
state_display: >
|
||||
[[[ return 'REBOOT REQUIRED'; ]]]
|
||||
|
||||
- type: custom:auto-entities
|
||||
show_empty: false
|
||||
card:
|
||||
@@ -602,28 +563,3 @@
|
||||
- entity: sensor.speedtest_upload
|
||||
name: Upload
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Activity highlights (compact)
|
||||
# -------------------------------------------------------------------
|
||||
- type: grid
|
||||
column_span: 4
|
||||
columns: 1
|
||||
square: false
|
||||
cards:
|
||||
- type: custom:vertical-stack-in-card
|
||||
grid_options:
|
||||
columns: full
|
||||
card_mod:
|
||||
style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_panel_header
|
||||
name: Activity Highlights
|
||||
tap_action:
|
||||
action: navigate
|
||||
navigation_path: /dashboard-infrastructure/activity
|
||||
- type: logbook
|
||||
target:
|
||||
entity_id:
|
||||
- sensor.activity_feed
|
||||
hours_to_show: 24
|
||||
|
||||
@@ -150,87 +150,3 @@
|
||||
return `${days}d | ${exp}`;
|
||||
]]]
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Certificate health
|
||||
# -------------------------------------------------------------------
|
||||
- type: grid
|
||||
column_span: 4
|
||||
columns: 1
|
||||
square: false
|
||||
cards:
|
||||
- type: custom:vertical-stack-in-card
|
||||
grid_options:
|
||||
columns: full
|
||||
card_mod:
|
||||
style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_panel_header
|
||||
name: Certificate Health
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_list_row
|
||||
name: Cert telemetry sensors
|
||||
icon: mdi:certificate-outline
|
||||
state_display: >
|
||||
[[[
|
||||
const keys = Object.keys(states).filter((k) =>
|
||||
k.startsWith('sensor.') &&
|
||||
/(vcloudinfo|kingcrafthomes)/.test(k) &&
|
||||
/(cert|ssl|tls)/.test(k)
|
||||
);
|
||||
return keys.length === 0 ? 'Missing (domain expiry only)' : `${keys.length} sensor(s)`;
|
||||
]]]
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_list_row
|
||||
name: Minimum cert days remaining
|
||||
icon: mdi:calendar-alert
|
||||
state_display: >
|
||||
[[[
|
||||
const keys = Object.keys(states).filter((k) =>
|
||||
k.startsWith('sensor.') &&
|
||||
/(vcloudinfo|kingcrafthomes)/.test(k) &&
|
||||
/(cert|ssl|tls)/.test(k)
|
||||
);
|
||||
let min = null;
|
||||
keys.forEach((k) => {
|
||||
const n = Number(states[k]?.state);
|
||||
if (Number.isFinite(n)) min = (min === null) ? n : Math.min(min, n);
|
||||
});
|
||||
return (min === null) ? 'Not available' : `${Math.round(min)} days`;
|
||||
]]]
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_list_row
|
||||
name: Cert warning (< 30d)
|
||||
icon: mdi:alert-outline
|
||||
state_display: >
|
||||
[[[
|
||||
const keys = Object.keys(states).filter((k) =>
|
||||
k.startsWith('sensor.') &&
|
||||
/(vcloudinfo|kingcrafthomes)/.test(k) &&
|
||||
/(cert|ssl|tls)/.test(k)
|
||||
);
|
||||
let min = null;
|
||||
keys.forEach((k) => {
|
||||
const n = Number(states[k]?.state);
|
||||
if (Number.isFinite(n)) min = (min === null) ? n : Math.min(min, n);
|
||||
});
|
||||
return (min !== null && min < 30 && min >= 14) ? 'ALERT' : 'OK';
|
||||
]]]
|
||||
- type: custom:button-card
|
||||
template: bearstone_infra_list_row
|
||||
name: Cert critical (< 14d)
|
||||
icon: mdi:alert-circle
|
||||
state_display: >
|
||||
[[[
|
||||
const keys = Object.keys(states).filter((k) =>
|
||||
k.startsWith('sensor.') &&
|
||||
/(vcloudinfo|kingcrafthomes)/.test(k) &&
|
||||
/(cert|ssl|tls)/.test(k)
|
||||
);
|
||||
let min = null;
|
||||
keys.forEach((k) => {
|
||||
const n = Number(states[k]?.state);
|
||||
if (Number.isFinite(n)) min = (min === null) ? n : Math.min(min, n);
|
||||
});
|
||||
return (min !== null && min < 14) ? 'ALERT' : 'OK';
|
||||
]]]
|
||||
|
||||
@@ -165,11 +165,8 @@ bearstone_infra_apt_prune_tile:
|
||||
label: >-
|
||||
[[[
|
||||
const lastSensor = variables.last_update_sensor ? variables.last_update_sensor : '';
|
||||
const rebootSensor = variables.reboot_status_sensor ? variables.reboot_status_sensor : '';
|
||||
const lastValue = lastSensor ? (states[lastSensor]?.state ?? 'unknown') : 'unknown';
|
||||
const rebootValue = rebootSensor ? (states[rebootSensor]?.state ?? '') : '';
|
||||
const rebootText = rebootValue ? (" | " + rebootValue) : '';
|
||||
return "Last update: " + lastValue + rebootText + " | Hold to prune";
|
||||
return "Last update: " + lastValue + " | Hold to prune";
|
||||
]]]
|
||||
|
||||
bearstone_infra_container_row:
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
######################################################################
|
||||
# @CCOSTAN - Follow Me on X
|
||||
# For more info visit https://www.vcloudinfo.com/click-here
|
||||
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||
# -------------------------------------------------------------------
|
||||
# Infrastructure View - Untitled
|
||||
# YAML-exported Lovelace dashboard (split into view files).
|
||||
# -------------------------------------------------------------------
|
||||
# Notes: Exported from config/.storage/lovelace.dashboard_infrastructure view index 4.
|
||||
######################################################################
|
||||
|
||||
icon: mdi:clipboard-text-outline
|
||||
title: Activity
|
||||
path: activity
|
||||
type: sections
|
||||
theme: default
|
||||
max_columns: 4
|
||||
badges: []
|
||||
cards: []
|
||||
sections: !include /config/dashboards/infrastructure/partials/activity_sections.yaml
|
||||
@@ -6,7 +6,7 @@
|
||||
# Infrastructure Card - APT update status for Docker hosts
|
||||
# Paste this card into the existing Infrastructure dashboard (storage mode).
|
||||
# -------------------------------------------------------------------
|
||||
# Notes: Depends on `config/packages/apt_updates.yaml`.
|
||||
# Notes: Depends on `config/packages/docker_infrastructure.yaml`.
|
||||
######################################################################
|
||||
|
||||
type: entities
|
||||
@@ -18,18 +18,21 @@ entities:
|
||||
- entity: sensor.docker_10_apt_status
|
||||
- entity: sensor.docker_10_apt_last_check
|
||||
- entity: sensor.docker_10_apt_last_update
|
||||
- entity: sensor.docker_10_apt_reboot_status
|
||||
|
||||
- type: section
|
||||
label: docker_14
|
||||
- entity: sensor.docker_14_apt_status
|
||||
- entity: sensor.docker_14_apt_last_check
|
||||
- entity: sensor.docker_14_apt_last_update
|
||||
- entity: sensor.docker_14_apt_reboot_status
|
||||
|
||||
- type: section
|
||||
label: docker_17
|
||||
- entity: sensor.docker_17_apt_status
|
||||
- entity: sensor.docker_17_apt_last_check
|
||||
- entity: sensor.docker_17_apt_last_update
|
||||
|
||||
- type: section
|
||||
label: docker_69
|
||||
- entity: sensor.docker_69_apt_status
|
||||
- entity: sensor.docker_69_apt_last_check
|
||||
- entity: sensor.docker_69_apt_last_update
|
||||
- entity: sensor.docker_69_apt_reboot_status
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Infrastructure View - APT updates (3-column layout)
|
||||
# Paste this view into the Infrastructure dashboard (storage mode).
|
||||
# -------------------------------------------------------------------
|
||||
# Notes: Uses `sensor.docker_*` entities from `config/packages/apt_updates.yaml`.
|
||||
# Notes: Uses `sensor.docker_*` entities from `config/packages/docker_infrastructure.yaml`.
|
||||
######################################################################
|
||||
|
||||
title: "Infrastructure - APT Updates"
|
||||
@@ -25,7 +25,6 @@ sections:
|
||||
- entity: sensor.docker_10_apt_status
|
||||
- entity: sensor.docker_10_apt_last_check
|
||||
- entity: sensor.docker_10_apt_last_update
|
||||
- entity: sensor.docker_10_apt_reboot_status
|
||||
|
||||
- type: entities
|
||||
title: docker_14
|
||||
@@ -34,7 +33,14 @@ sections:
|
||||
- entity: sensor.docker_14_apt_status
|
||||
- entity: sensor.docker_14_apt_last_check
|
||||
- entity: sensor.docker_14_apt_last_update
|
||||
- entity: sensor.docker_14_apt_reboot_status
|
||||
|
||||
- type: entities
|
||||
title: docker_17
|
||||
show_header_toggle: false
|
||||
entities:
|
||||
- entity: sensor.docker_17_apt_status
|
||||
- entity: sensor.docker_17_apt_last_check
|
||||
- entity: sensor.docker_17_apt_last_update
|
||||
|
||||
- type: entities
|
||||
title: docker_69
|
||||
@@ -43,4 +49,3 @@ sections:
|
||||
- entity: sensor.docker_69_apt_status
|
||||
- entity: sensor.docker_69_apt_last_check
|
||||
- entity: sensor.docker_69_apt_last_update
|
||||
- entity: sensor.docker_69_apt_reboot_status
|
||||
|
||||
@@ -45,7 +45,7 @@ Live collection of plug-and-play Home Assistant packages. Each YAML file in this
|
||||
| [lightning.yaml](lightning.yaml) | Blitzortung lightning counter monitoring with snoozeable push actions. | `sensor.blitzortung_lightning_counter`, `input_boolean.snooze_lightning`, notify engine actions |
|
||||
| [logbook_activity_feed.yaml](logbook_activity_feed.yaml) | Dummy `sensor.activity_feed` + helper to write clean Activity entries (Issue #1550). | `sensor.activity_feed`, `script.send_to_logbook` |
|
||||
| [mariadb_monitoring.yaml](mariadb_monitoring.yaml) | MariaDB health sensors and Lovelace dashboard snippet for recorder stats. | `sensor.mariadb_status`, `sensor.database_size` |
|
||||
| [docker_infrastructure.yaml](docker_infrastructure.yaml) | Docker host patching + staggered auto-reboot flow + container-down Repairs alerts. | `sensor.docker_*_apt_status`, `repairs.create`, `repairs.remove` |
|
||||
| [docker_infrastructure.yaml](docker_infrastructure.yaml) | Docker host patching telemetry (docker_10/14/17/69) + host-side auto-reboots + container-down Repairs alerts. | `sensor.docker_*_apt_status`, `repairs.create`, `repairs.remove` |
|
||||
| [infrastructure_observability.yaml](infrastructure_observability.yaml) | Normalized WAN/DNS/backup/domain/cert health sensors used by the Infrastructure Home + Website Health dashboards. | `binary_sensor.infra_*`, `sensor.infra_*`, `script.send_to_logbook` |
|
||||
| [mariadb.yaml](mariadb.yaml) | MariaDB recorder health and capacity SQL sensors. | `sensor.mariadb_status`, `sensor.database_size` |
|
||||
| [tugtainer_updates.yaml](tugtainer_updates.yaml) | Tugtainer container update notifications via webhook + persistent alerts. | `persistent_notification.create`, `input_datetime.tugtainer_last_update` |
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||
# -------------------------------------------------------------------
|
||||
# Docker Infrastructure - Host patching and container alerts
|
||||
# APT webhook results and container down repairs.
|
||||
# APT webhook results (docker_10/14/17/69) and container down repairs.
|
||||
# -------------------------------------------------------------------
|
||||
# Notes: Hosts run weekly Wed 12:00 APT job and POST JSON to webhooks.
|
||||
# Notes: If reboot is required, hosts auto-schedule reboot after posting status.
|
||||
# Notes: Reboot staggering: docker_14 reboots first, docker_10 reboots later.
|
||||
# Notes: Reboots are handled directly on each host by apt_weekly.sh.
|
||||
# Notes: Reboot staggering: docker_14 first, docker_69 second, docker_10 third.
|
||||
# Notes: Container watchlist is explicit; extend entity list as needed.
|
||||
######################################################################
|
||||
|
||||
@@ -21,6 +21,14 @@ input_datetime:
|
||||
name: "docker_10 APT last update"
|
||||
has_date: true
|
||||
has_time: true
|
||||
apt_docker_17_last_check:
|
||||
name: "docker_17 APT last check"
|
||||
has_date: true
|
||||
has_time: true
|
||||
apt_docker_17_last_update:
|
||||
name: "docker_17 APT last update"
|
||||
has_date: true
|
||||
has_time: true
|
||||
apt_docker_14_last_check:
|
||||
name: "docker_14 APT last check"
|
||||
has_date: true
|
||||
@@ -42,6 +50,9 @@ input_text:
|
||||
apt_docker_10_last_result:
|
||||
name: "docker_10 APT last result"
|
||||
max: 255
|
||||
apt_docker_17_last_result:
|
||||
name: "docker_17 APT last result"
|
||||
max: 255
|
||||
apt_docker_14_last_result:
|
||||
name: "docker_14 APT last result"
|
||||
max: 255
|
||||
@@ -49,17 +60,6 @@ input_text:
|
||||
name: "docker_69 APT last result"
|
||||
max: 255
|
||||
|
||||
input_boolean:
|
||||
apt_docker_10_reboot_required:
|
||||
name: "docker_10 reboot required"
|
||||
icon: mdi:restart-alert
|
||||
apt_docker_14_reboot_required:
|
||||
name: "docker_14 reboot required"
|
||||
icon: mdi:restart-alert
|
||||
apt_docker_69_reboot_required:
|
||||
name: "docker_69 reboot required"
|
||||
icon: mdi:restart-alert
|
||||
|
||||
template:
|
||||
- sensor:
|
||||
- name: "docker_10 APT status"
|
||||
@@ -82,18 +82,30 @@ template:
|
||||
{% if stamp not in ['unknown', 'unavailable', 'none', ''] %}
|
||||
{{ as_local(as_datetime(stamp)) }}
|
||||
{% endif %}
|
||||
- name: "docker_10 APT reboot status"
|
||||
unique_id: apt_docker_10_reboot_status
|
||||
icon: >-
|
||||
{{ 'mdi:restart-alert' if is_state('input_boolean.apt_docker_10_reboot_required', 'on')
|
||||
else 'mdi:check-circle' }}
|
||||
state: >-
|
||||
{{ 'REBOOT REQUIRED' if is_state('input_boolean.apt_docker_10_reboot_required', 'on')
|
||||
else 'NO REBOOT NEEDED' }}
|
||||
- name: "docker_14 APT status"
|
||||
unique_id: apt_docker_14_status
|
||||
icon: mdi:package-up
|
||||
state: "{{ states('input_text.apt_docker_14_last_result') }}"
|
||||
- name: "docker_17 APT status"
|
||||
unique_id: apt_docker_17_status
|
||||
icon: mdi:package-up
|
||||
state: "{{ states('input_text.apt_docker_17_last_result') }}"
|
||||
- name: "docker_17 APT last check"
|
||||
unique_id: apt_docker_17_last_check
|
||||
device_class: timestamp
|
||||
state: >-
|
||||
{% set stamp = states('input_datetime.apt_docker_17_last_check') %}
|
||||
{% if stamp not in ['unknown', 'unavailable', 'none', ''] %}
|
||||
{{ as_local(as_datetime(stamp)) }}
|
||||
{% endif %}
|
||||
- name: "docker_17 APT last update"
|
||||
unique_id: apt_docker_17_last_update
|
||||
device_class: timestamp
|
||||
state: >-
|
||||
{% set stamp = states('input_datetime.apt_docker_17_last_update') %}
|
||||
{% if stamp not in ['unknown', 'unavailable', 'none', ''] %}
|
||||
{{ as_local(as_datetime(stamp)) }}
|
||||
{% endif %}
|
||||
- name: "docker_14 APT last check"
|
||||
unique_id: apt_docker_14_last_check
|
||||
device_class: timestamp
|
||||
@@ -110,14 +122,6 @@ template:
|
||||
{% if stamp not in ['unknown', 'unavailable', 'none', ''] %}
|
||||
{{ as_local(as_datetime(stamp)) }}
|
||||
{% endif %}
|
||||
- name: "docker_14 APT reboot status"
|
||||
unique_id: apt_docker_14_reboot_status
|
||||
icon: >-
|
||||
{{ 'mdi:restart-alert' if is_state('input_boolean.apt_docker_14_reboot_required', 'on')
|
||||
else 'mdi:check-circle' }}
|
||||
state: >-
|
||||
{{ 'REBOOT REQUIRED' if is_state('input_boolean.apt_docker_14_reboot_required', 'on')
|
||||
else 'NO REBOOT NEEDED' }}
|
||||
- name: "docker_69 APT status"
|
||||
unique_id: apt_docker_69_status
|
||||
icon: mdi:package-up
|
||||
@@ -138,31 +142,6 @@ template:
|
||||
{% if stamp not in ['unknown', 'unavailable', 'none', ''] %}
|
||||
{{ as_local(as_datetime(stamp)) }}
|
||||
{% endif %}
|
||||
- name: "docker_69 APT reboot status"
|
||||
unique_id: apt_docker_69_reboot_status
|
||||
icon: >-
|
||||
{{ 'mdi:restart-alert' if is_state('input_boolean.apt_docker_69_reboot_required', 'on')
|
||||
else 'mdi:check-circle' }}
|
||||
state: >-
|
||||
{{ 'REBOOT REQUIRED' if is_state('input_boolean.apt_docker_69_reboot_required', 'on')
|
||||
else 'NO REBOOT NEEDED' }}
|
||||
|
||||
- binary_sensor:
|
||||
- name: "docker_10 APT reboot required"
|
||||
unique_id: apt_docker_10_reboot_required
|
||||
device_class: problem
|
||||
icon: mdi:restart-alert
|
||||
state: "{{ is_state('input_boolean.apt_docker_10_reboot_required', 'on') }}"
|
||||
- name: "docker_14 APT reboot required"
|
||||
unique_id: apt_docker_14_reboot_required
|
||||
device_class: problem
|
||||
icon: mdi:restart-alert
|
||||
state: "{{ is_state('input_boolean.apt_docker_14_reboot_required', 'on') }}"
|
||||
- name: "docker_69 APT reboot required"
|
||||
unique_id: apt_docker_69_reboot_required
|
||||
device_class: problem
|
||||
icon: mdi:restart-alert
|
||||
state: "{{ is_state('input_boolean.apt_docker_69_reboot_required', 'on') }}"
|
||||
|
||||
automation:
|
||||
- alias: "APT Update Report - docker_10"
|
||||
@@ -180,22 +159,17 @@ automation:
|
||||
success: "{{ payload.get('success', true) | bool }}"
|
||||
updated: "{{ payload.get('updated', false) | bool }}"
|
||||
packages: "{{ payload.get('packages', 0) | int(0) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
auto_reboot_scheduled: "{{ payload.get('auto_reboot_scheduled', false) | bool }}"
|
||||
reboot_delay_minutes: "{{ payload.get('reboot_delay_minutes', 0) | int(0) }}"
|
||||
message: "{{ payload.get('message', '') | string }}"
|
||||
result: >-
|
||||
{% if not success %}
|
||||
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
|
||||
{% elif reboot_required and not updated %}
|
||||
REBOOT REQUIRED{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
{% elif updated %}
|
||||
UPDATED {{ packages }} PKGS{% if reboot_required %}; REBOOT REQUIRED{% endif %}{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
UPDATED {{ packages }} PKGS
|
||||
{% else %}
|
||||
NO UPDATES
|
||||
{% endif %}
|
||||
log_message: >-
|
||||
docker_10 updated {{ packages }} package{% if packages != 1 %}s{% endif %}{% if reboot_required %} (reboot required){% endif %}{% if auto_reboot_scheduled %}; auto reboot in {{ reboot_delay_minutes }} minute{% if reboot_delay_minutes != 1 %}s{% endif %}{% endif %}.
|
||||
docker_10 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
|
||||
action:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
@@ -207,16 +181,6 @@ automation:
|
||||
entity_id: input_text.apt_docker_10_last_result
|
||||
data:
|
||||
value: "{{ result }}"
|
||||
- choose:
|
||||
- conditions: "{{ success and reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_10_reboot_required
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_10_reboot_required
|
||||
- choose:
|
||||
- conditions: "{{ success and updated }}"
|
||||
sequence:
|
||||
@@ -245,22 +209,17 @@ automation:
|
||||
success: "{{ payload.get('success', true) | bool }}"
|
||||
updated: "{{ payload.get('updated', false) | bool }}"
|
||||
packages: "{{ payload.get('packages', 0) | int(0) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
auto_reboot_scheduled: "{{ payload.get('auto_reboot_scheduled', false) | bool }}"
|
||||
reboot_delay_minutes: "{{ payload.get('reboot_delay_minutes', 0) | int(0) }}"
|
||||
message: "{{ payload.get('message', '') | string }}"
|
||||
result: >-
|
||||
{% if not success %}
|
||||
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
|
||||
{% elif reboot_required and not updated %}
|
||||
REBOOT REQUIRED{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
{% elif updated %}
|
||||
UPDATED {{ packages }} PKGS{% if reboot_required %}; REBOOT REQUIRED{% endif %}{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
UPDATED {{ packages }} PKGS
|
||||
{% else %}
|
||||
NO UPDATES
|
||||
{% endif %}
|
||||
log_message: >-
|
||||
docker_14 updated {{ packages }} package{% if packages != 1 %}s{% endif %}{% if reboot_required %} (reboot required){% endif %}{% if auto_reboot_scheduled %}; auto reboot in {{ reboot_delay_minutes }} minute{% if reboot_delay_minutes != 1 %}s{% endif %}{% endif %}.
|
||||
docker_14 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
|
||||
action:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
@@ -272,16 +231,6 @@ automation:
|
||||
entity_id: input_text.apt_docker_14_last_result
|
||||
data:
|
||||
value: "{{ result }}"
|
||||
- choose:
|
||||
- conditions: "{{ success and reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_14_reboot_required
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_14_reboot_required
|
||||
- choose:
|
||||
- conditions: "{{ success and updated }}"
|
||||
sequence:
|
||||
@@ -295,6 +244,56 @@ automation:
|
||||
topic: "APT"
|
||||
message: "{{ log_message }}"
|
||||
|
||||
- alias: "APT Update Report - docker_17"
|
||||
id: apt_update_report_docker_17
|
||||
description: "Receive docker_17 APT results and update helpers/logbook."
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: webhook
|
||||
webhook_id: !secret apt_webhook_docker_17
|
||||
allowed_methods:
|
||||
- POST
|
||||
local_only: true
|
||||
variables:
|
||||
payload: "{{ trigger.json | default({}) }}"
|
||||
success: "{{ payload.get('success', true) | bool }}"
|
||||
updated: "{{ payload.get('updated', false) | bool }}"
|
||||
packages: "{{ payload.get('packages', 0) | int(0) }}"
|
||||
message: "{{ payload.get('message', '') | string }}"
|
||||
result: >-
|
||||
{% if not success %}
|
||||
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
|
||||
{% elif updated %}
|
||||
UPDATED {{ packages }} PKGS
|
||||
{% else %}
|
||||
NO UPDATES
|
||||
{% endif %}
|
||||
log_message: >-
|
||||
docker_17 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
|
||||
action:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.apt_docker_17_last_check
|
||||
data:
|
||||
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
|
||||
- service: input_text.set_value
|
||||
target:
|
||||
entity_id: input_text.apt_docker_17_last_result
|
||||
data:
|
||||
value: "{{ result }}"
|
||||
- choose:
|
||||
- conditions: "{{ success and updated }}"
|
||||
sequence:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.apt_docker_17_last_update
|
||||
data:
|
||||
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "{{ log_message }}"
|
||||
|
||||
- alias: "APT Update Report - docker_69"
|
||||
id: apt_update_report_docker_69
|
||||
description: "Receive docker_69 APT results and update helpers/logbook."
|
||||
@@ -310,22 +309,17 @@ automation:
|
||||
success: "{{ payload.get('success', true) | bool }}"
|
||||
updated: "{{ payload.get('updated', false) | bool }}"
|
||||
packages: "{{ payload.get('packages', 0) | int(0) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
auto_reboot_scheduled: "{{ payload.get('auto_reboot_scheduled', false) | bool }}"
|
||||
reboot_delay_minutes: "{{ payload.get('reboot_delay_minutes', 0) | int(0) }}"
|
||||
message: "{{ payload.get('message', '') | string }}"
|
||||
result: >-
|
||||
{% if not success %}
|
||||
ERROR{% if (message | trim) != '' %}: {{ message | trim }}{% endif %}
|
||||
{% elif reboot_required and not updated %}
|
||||
REBOOT REQUIRED{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
{% elif updated %}
|
||||
UPDATED {{ packages }} PKGS{% if reboot_required %}; REBOOT REQUIRED{% endif %}{% if auto_reboot_scheduled %}; AUTO REBOOT {{ reboot_delay_minutes }}M{% endif %}
|
||||
UPDATED {{ packages }} PKGS
|
||||
{% else %}
|
||||
NO UPDATES
|
||||
{% endif %}
|
||||
log_message: >-
|
||||
docker_69 updated {{ packages }} package{% if packages != 1 %}s{% endif %}{% if reboot_required %} (reboot required){% endif %}{% if auto_reboot_scheduled %}; auto reboot in {{ reboot_delay_minutes }} minute{% if reboot_delay_minutes != 1 %}s{% endif %}{% endif %}.
|
||||
docker_69 updated {{ packages }} package{% if packages != 1 %}s{% endif %}.
|
||||
action:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
@@ -337,16 +331,6 @@ automation:
|
||||
entity_id: input_text.apt_docker_69_last_result
|
||||
data:
|
||||
value: "{{ result }}"
|
||||
- choose:
|
||||
- conditions: "{{ success and reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_69_reboot_required
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_69_reboot_required
|
||||
- choose:
|
||||
- conditions: "{{ success and updated }}"
|
||||
sequence:
|
||||
@@ -360,151 +344,6 @@ automation:
|
||||
topic: "APT"
|
||||
message: "{{ log_message }}"
|
||||
|
||||
- alias: "APT Boot Report - docker_10"
|
||||
id: apt_boot_report_docker_10
|
||||
description: "Clear or keep reboot-required flag after docker_10 boots."
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: webhook
|
||||
webhook_id: !secret apt_boot_webhook_docker_10
|
||||
allowed_methods:
|
||||
- POST
|
||||
local_only: true
|
||||
variables:
|
||||
payload: "{{ trigger.json | default({}) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_10_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_10 boot report: reboot is still required."
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_10_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_10 reboot completed and reboot flag cleared."
|
||||
|
||||
- alias: "APT Boot Report - docker_14"
|
||||
id: apt_boot_report_docker_14
|
||||
description: "Clear or keep reboot-required flag after docker_14 boots."
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: webhook
|
||||
webhook_id: !secret apt_boot_webhook_docker_14
|
||||
allowed_methods:
|
||||
- POST
|
||||
local_only: true
|
||||
variables:
|
||||
payload: "{{ trigger.json | default({}) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_14_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_14 boot report: reboot is still required."
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_14_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_14 reboot completed and reboot flag cleared."
|
||||
|
||||
- alias: "APT Boot Report - docker_69"
|
||||
id: apt_boot_report_docker_69
|
||||
description: "Clear or keep reboot-required flag after docker_69 boots."
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: webhook
|
||||
webhook_id: !secret apt_boot_webhook_docker_69
|
||||
allowed_methods:
|
||||
- POST
|
||||
local_only: true
|
||||
variables:
|
||||
payload: "{{ trigger.json | default({}) }}"
|
||||
reboot_required: "{{ payload.get('reboot_required', false) | bool }}"
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ reboot_required }}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_69_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_69 boot report: reboot is still required."
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.apt_docker_69_reboot_required
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "APT"
|
||||
message: "docker_69 reboot completed and reboot flag cleared."
|
||||
|
||||
- alias: "APT Reboot Repairs"
|
||||
id: apt_reboot_repairs
|
||||
description: "Create or clear Repairs issues when Docker hosts need a reboot."
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.docker_10_apt_reboot_required
|
||||
- binary_sensor.docker_14_apt_reboot_required
|
||||
- binary_sensor.docker_69_apt_reboot_required
|
||||
variables:
|
||||
host_name: >-
|
||||
{% if 'docker_10' in trigger.entity_id %}
|
||||
docker_10
|
||||
{% elif 'docker_14' in trigger.entity_id %}
|
||||
docker_14
|
||||
{% else %}
|
||||
docker_69
|
||||
{% endif %}
|
||||
issue_id: >-
|
||||
{% if 'docker_10' in trigger.entity_id %}
|
||||
apt_docker_10_reboot_required
|
||||
{% elif 'docker_14' in trigger.entity_id %}
|
||||
apt_docker_14_reboot_required
|
||||
{% else %}
|
||||
apt_docker_69_reboot_required
|
||||
{% endif %}
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ trigger.to_state.state == 'on' }}"
|
||||
sequence:
|
||||
- service: repairs.create
|
||||
data:
|
||||
issue_id: "{{ issue_id }}"
|
||||
severity: warning
|
||||
persistent: true
|
||||
title: "{{ host_name }} needs reboot"
|
||||
description: >-
|
||||
{{ host_name }} reports a reboot is required after APT updates.
|
||||
Status: {{ states('sensor.' ~ host_name ~ '_apt_status') }}.
|
||||
default:
|
||||
- continue_on_error: true
|
||||
service: repairs.remove
|
||||
data:
|
||||
issue_id: "{{ issue_id }}"
|
||||
|
||||
- alias: "Docker Container Offline - Create Repairs"
|
||||
id: docker_container_offline_repairs_create
|
||||
description: "Create a Repairs issue when a watched container is down for 5+ minutes."
|
||||
|
||||
@@ -40,7 +40,6 @@ $targets = @(
|
||||
'/profile',
|
||||
'/dashboard-infrastructure',
|
||||
'/dashboard-infrastructure/home',
|
||||
'/dashboard-infrastructure/activity',
|
||||
'/dashboard-infrastructure/docker',
|
||||
'/dashboard-kiosk'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user