bundles/c3voc-addons: add upgrade-and-reboot to bundle
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
0f0ee046b1
commit
0893156723
6 changed files with 39 additions and 1 deletions
|
@ -55,6 +55,8 @@ DEBIAN_FRONTEND=noninteractive apt-get -y -q autoremove
|
||||||
|
|
||||||
if [[ -f /var/run/reboot-required ]]
|
if [[ -f /var/run/reboot-required ]]
|
||||||
then
|
then
|
||||||
|
% if 'mail' in data:
|
||||||
date | mail -s "SYSREBOOTNOW ${node.name}" ${data['mail']}
|
date | mail -s "SYSREBOOTNOW ${node.name}" ${data['mail']}
|
||||||
|
% endif
|
||||||
systemctl reboot
|
systemctl reboot
|
||||||
fi
|
fi
|
||||||
|
|
1
bundles/c3voc-addons/files/check_unattended_upgrades
Symbolic link
1
bundles/c3voc-addons/files/check_unattended_upgrades
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../apt/files/check_unattended_upgrades
|
1
bundles/c3voc-addons/files/upgrade-and-reboot
Symbolic link
1
bundles/c3voc-addons/files/upgrade-and-reboot
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../apt/files/upgrade-and-reboot
|
|
@ -51,6 +51,25 @@ directories = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
files = {
|
||||||
|
'/usr/local/share/icinga/plugins/check_unattended_upgrades': {
|
||||||
|
'mode': '0755',
|
||||||
|
},
|
||||||
|
'/usr/local/sbin/upgrade-and-reboot': {
|
||||||
|
'content_type': 'mako',
|
||||||
|
'mode': '0700',
|
||||||
|
'context': {
|
||||||
|
'data': node.metadata.get('apt', {}).get('unattended-upgrades', {}),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'/etc/cron.d/upgrade-and-reboot': {
|
||||||
|
'content': '{minute} 1 * * {day} root /usr/local/sbin/upgrade-and-reboot'.format(
|
||||||
|
minute=node.magic_number % 30,
|
||||||
|
day=node.metadata.get('apt', {}).get('unattended-upgrades', {}).get('day', 5),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
for vhost, config in node.metadata.get('nginx', {}).get('vhosts', {}).items():
|
for vhost, config in node.metadata.get('nginx', {}).get('vhosts', {}).items():
|
||||||
if not 'domain' in config:
|
if not 'domain' in config:
|
||||||
config['domain'] = vhost
|
config['domain'] = vhost
|
||||||
|
@ -78,4 +97,12 @@ for vhost, config in node.metadata.get('nginx', {}).get('vhosts', {}).items():
|
||||||
|
|
||||||
svc_systemd = {
|
svc_systemd = {
|
||||||
'nginx': {},
|
'nginx': {},
|
||||||
|
'apt-daily.timer': {
|
||||||
|
'running': False,
|
||||||
|
'enabled': False,
|
||||||
|
},
|
||||||
|
'apt-daily-upgrade.timer': {
|
||||||
|
'running': False,
|
||||||
|
'enabled': False,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
defaults = {
|
defaults = {
|
||||||
'icinga2_api': {
|
'icinga2_api': {
|
||||||
|
'apt': {
|
||||||
|
'services': {
|
||||||
|
'UNATTENDED UPGRADES': {
|
||||||
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_unattended_upgrades',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
'nginx': {
|
'nginx': {
|
||||||
'services': {
|
'services': {
|
||||||
'NGINX PROCESS': {
|
'NGINX PROCESS': {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
% for monitored_node in sorted(monitored_nodes):
|
% for monitored_node in sorted(monitored_nodes):
|
||||||
% if monitored_node.has_bundle('apt'):
|
% if not monitored_node.dummy:
|
||||||
object ScheduledDowntime "unattended_upgrades" {
|
object ScheduledDowntime "unattended_upgrades" {
|
||||||
host_name = "${monitored_node.name}"
|
host_name = "${monitored_node.name}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue