Run expand-groups.sh occasionally under cron

We only run expand-groups.sh during launch-node -- which makes sense
for additions as we don't have hosts appearing that don't come via
that path.  However nothing really runs it on removal of hosts,
meaning /etc/ansible/hosts/generated-groups can contain old entries
until the next time a new host is launched.  Simply run it once a day
to keep it fresh.

[1] http://git.openstack.org/cgit/openstack-infra/system-config/tree/launch/launch-node.py#n172

Change-Id: Ia112082df33b5ebf465f7d5a23685cc3e28b0551
This commit is contained in:
Ian Wienand 2017-12-20 10:44:18 +11:00
parent 6fff5a4bad
commit a44f2e6767

View File

@ -352,6 +352,29 @@ class openstack_project::puppetmaster (
source => 'puppet:///modules/openstack_project/puppetmaster/expand-groups.sh',
notify => Exec['expand_groups'],
}
cron { 'expandgroups':
user => 'root',
minute => 0,
hour => 4,
command => '/usr/local/bin/expand-groups.sh >> /var/log/expand_groups.log 2>&1',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
}
logrotate::file { 'expandgroups':
ensure => present,
log => '/var/log/expand_groups.log',
options => ['compress',
'copytruncate',
'delaycompress',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
require => Cron['expandgroups'],
}
# Temporarily pin paho-mqtt to 1.2.3 since 1.3.0 won't support TLS on
# Trusty's Python 2.7.
if $enable_mqtt {