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

Support different OU's for different hostgroups #17

Open
wiad opened this issue Sep 27, 2018 · 3 comments
Open

Support different OU's for different hostgroups #17

wiad opened this issue Sep 27, 2018 · 3 comments

Comments

@wiad
Copy link

wiad commented Sep 27, 2018

We have different OU's for our machine accounts in AD for different types of machines - linux server, windows servers, clients. It would be great if you could set which OU to use based on for exampel hostgroups and/or OS.

@wiad
Copy link
Author

wiad commented Jan 10, 2019

I guess the way to do it is to install multiple realm-foreman-proxies and then use hostgroups to specify which proxy to use.

@wiad wiad closed this as completed Jan 10, 2019
@wiad
Copy link
Author

wiad commented Feb 15, 2019

Well, this did not work as I thought it would since the realms you create in Foreman has to have the same name as the AD domain. So I can't have multiple realms for the purpose of using different OU's for Windows Server/Linux Servers/Linux desktops in the same AD domain.

So this would still be useful, unless anyone knows another way of achieving this?

@wiad wiad reopened this Feb 15, 2019
@martencassel
Copy link
Contributor

martencassel commented Sep 23, 2024

This could be a solution

  1. Foreman can pass the hostgroup to the plugin during HTTP requests
  2. The administrator could set up hostgroup to OU mapping in the yaml configuration file.
  3. The Foreman host Group is available as a parameter known as userclass,
- HTTP POST /realm/:realm hostname=host.example.com&userclass=webservers
- HTTP POST /realm/:realm hostname=host.example.com&userclass=linux
- HTTP POST /realm/:realm hostname=host.example.com&userclass=windows
# Optional: Machines can be placed into different OU's based on the hostgroup
:hostgroup_to_ou_mapping:
  :linux: OU=Linux,OU=Servers,DC=lab,DC=local
  :windows: OU=Windows,OU=Servers,DC=lab,DC=local
  :webservers: OU=Webservers,OU=Servers,DC=lab,DC=local
  1. If no hostgroups are matched, the host could be placed in the default OU
# Optional: Default OU where the machine account shall be placed
:default_ou: OU=Linux,OU=Servers,DC=example,DC=com

https://projects.theforeman.org/projects/smart-proxy/wiki/API

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

No branches or pull requests

2 participants