Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auto-cleanup of deleted hosts #303

Open
gombasg opened this issue Dec 5, 2018 · 2 comments
Open

Implement auto-cleanup of deleted hosts #303

gombasg opened this issue Dec 5, 2018 · 2 comments

Comments

@gombasg
Copy link
Contributor

gombasg commented Dec 5, 2018

aii-shellfe has the --remove and --removelist options for cleaning up hosts which are no longer needed. However, these options work only if the host still exists, because they check the hostname against profiles-info.xml, and try to refresh the host profile. So these options cannot be used for cleaning up hosts which have already been deleted.

It would be useful to have an option to automatically clean up hosts which are no longer mentioned in profiles-info.xml, but which still have a profile cached under /var/quattor/cache. This cleanup variant should use the last available cached profile, and it should not try to update it (justification: the profile may not exist anymore, and even if it does exist, the various configuration files under /tftpboot and elsewhere were created using the cached version of the profile, so the cleanup should use the same information).

Actually, it could be argued that even --remove and --removelist should avoid trying to refresh the profiles of the hosts being removed, exactly because the items to clean up should be dictated by the already downloaded profile, and not any newer one.

@stdweird
Copy link
Member

stdweird commented Dec 5, 2018

@gombasg about not checking the template on --remove, i'm not in favour, because we have remove hooks, and you never know you want to fix them before removing/reinstalling the host.
i propose we add a --cleanup option to handle missing profiles

@gombasg
Copy link
Contributor Author

gombasg commented Dec 5, 2018

@stdweird well, I said it can be argued about :-) I could imagine a hybrid solution, like --remove refreshing the profile if the host is still present in profiles-info.xml, and using the last cached profile otherwise. I only took a quick look at the code though, so I don't know which solution would be easier to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants