theforeman / foreman_expire_hosts

Foreman plugin for limiting host lifetime
GNU General Public License v3.0
5 stars 12 forks source link

e-mails + date issues #2

Closed unstantane closed 7 years ago

unstantane commented 8 years ago

Hello, I am using v 2.0.1-1, installed via RPM.

Plugin config :

Host

Issues :

Since the 2016-09-20, we receive everyday an email saying

The following hosts have been deleted from Foreman:

However, the host has not been deleted but stopped.

-> Seems like the wrong template is sent -> Can it be sent once instead on everyday ?

I understood the correct behavior would be that the host should be stopped on 2016-10-20, which make it unavailable/unreachable, then deleted 30 days later.

-> The host stopped 30 days earlier.

Are these issues already solved in 2.0.2 ?

timogoebel commented 8 years ago

@unstantane: Thank you for your report and sorry for the delay. Version 2.1.0 has just been released for Foreman 1.13. It should work a lot more reliable than 2.0.1. Why don't you try it and let me know how it works for you?

timogoebel commented 8 years ago

@unstantane : I clarified the README to explain the expected behavior better. Your host should have been shutdown on 2016-10-21 (expiry date +1) and deleted on 2016-11-19 (expiry date + 30).

Could you check the logs in /var/log/foreman/expired_hosts.log to see if there are any indicators why this does not match? To check which hosts fall into what scope, you can use Foreman console:

# foreman-rake console
irb(main):001:0> Host.expired # Hosts that would be shutdown
=> #<ActiveRecord::Relation []>
irb(main):002:0> Host.expired_past_grace_period # Hosts that would be deleted
=> #<ActiveRecord::Relation []>
unstantane commented 8 years ago

@timogoebel Thanks for update, we will wait for Foreman 1.13.1 before updating, I will let you know after the update how it goes

timogoebel commented 8 years ago

@unstantane : Any news on this?

unstantane commented 8 years ago

@timogoebel We will update Foreman to 1.13.1 and the plugin to 2.1.1 this week end, I'll keep you updated

unstantane commented 7 years ago

We are now using 1.13.1 with the plugin v 2.1.1. and it seems to behave much better, with proper dates. Thanks for the fix

timogoebel commented 7 years ago

Sure, glad it works now. Thanks for testing. I'll close this for now. Feel free to comment if you have any further issues.