Open damacus opened 3 years ago
After digging around with the issue, it seems the problem is as follows: Service resource for fail2ban is notified with action restart (delayed timing), so the service is restarted at the end of the Chef Client run. Unfortunately reload action is notified for fail2ban service resource, directly after restart action was notified by using fail2ban_jail resource. This introduces a something like a race condition, as the service may not be ready to accept connections after the restart.
I think it would be good to change the notified action to from within fail2ban_jail resource to :restart
or to allow the cookbook user to specify the action via custom resource properties (as symbol type).
BTW: When using :reload
action from within this cookbook, the service resource should explicitly declare it to be supported using supports
property.
@djessich have you found a workaround for this issue ?
@PowerKiKi No, I haven't found a workaround or solution yet.
My workaround for now is to specify :restart
, even though :reload
would be the more efficient option. So something like that:
notifies :restart, 'service[fail2ban]'
For me fail2ban service does not reload on Chef 17. See the following output: