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

Fixes #16330 - random and MAC name generators #437

Merged
merged 1 commit into from Jun 20, 2018

Conversation

lzap
Copy link
Member

@lzap lzap commented Jun 1, 2018

With deacon gem as foreman core dependency, it is possible to implement naming discovered hosts via deacon's MAC address generator.

https://github.com/lzap/deacon

This makes a lot of sense because the name stays with server until decommission. It's a feature of deacon gem - same MAC maps to same name. See the README.

@theforeman-bot
Copy link
Member

Issues: #16330

@lzap
Copy link
Member Author

lzap commented Jun 1, 2018

This is fun! It needs a small core PR: theforeman/foreman#5637

Copy link
Contributor

@ik5 ik5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests breaks on me, the reason is that the ensure part is not part of a begin and not part of a method, but rather inside a block call.

It should be something like that:

...
  begin
   ...
  ensure
     Setting[:discovery_naming] = "Fact"
  end
end

@lzap
Copy link
Member Author

lzap commented Jun 15, 2018

Yeah, weird it looks like newer version of Ruby supports it, good catch Jenkins! Rebasing, I actually removed those, it's not necessary since Settings are fixture records. They are reset on every test.

Copy link
Member

@dLobatog dLobatog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, works pretty well @lzap . Can we get the discovery docs updated to include this?

@dLobatog dLobatog merged commit e098d27 into theforeman:develop Jun 20, 2018
@lzap lzap deleted the deacon-discovery-16330 branch June 20, 2018 13:06
Ron-Lavi pushed a commit to Ron-Lavi/foreman_discovery that referenced this pull request Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants