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

Add a domain name if not present in a vm's name #356

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

eric-eisenhart
Copy link

@eric-eisenhart eric-eisenhart commented Nov 3, 2023

Tested and works for me...

Purpose explained in #355

Two new params. Intended to handle these types of things:

  • shortname -> shortname.example.com (add domain)
  • foo.site1 -> foo.site1.example.com (add domain)
  • foo.site2.example.com -> foo.site2.example.com (no change)
  • foobar.example.net -> foobar.example.net

For when names in vCenter have an implied domain if not included.

@eric-eisenhart eric-eisenhart marked this pull request as ready for review November 7, 2023 02:03
@eric-eisenhart eric-eisenhart changed the title First pass at adding a domain name if not present in a vm's name. Add a domain name if not present in a vm's name Nov 7, 2023
@bb-Ricardo
Copy link
Owner

Hi,

This would be a great addition. I'm afraid that it would not cover the case where one would only assign a missing domain to certain VMs. Could you change it to work the same way as existing relations?

@eric-eisenhart
Copy link
Author

You mean something like this?

vm_domain_name_relation = ^[a-z]\.foo$ = example.net, ^[a-z]-bar$ = example.com

Replacing simple add_vm_domain_name with:

vm_domain_name_relation = .* = example.net

Should that still have the keep_vm_domain_name_filter regex param to skip things that already have a domain name on them?

@bb-Ricardo
Copy link
Owner

Sorry @eric-eisenhart I missed your comment.

the first example looks good to me. Would need to craft your config precisely. And if the relation matches but the correct domain name is already part of the VM name then it would not add the domain name again.

What do you think?

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

Successfully merging this pull request may close these issues.

2 participants