i have a task to manage AD objects like create, delete using ansible task right now i am using win_shell command module to run the command on windows target and creating AD objects. But I need to do it the same using an inbuilt ansible module like microsoft.ad about my target host will be localhost as its linux so that no dependency of windows target any one can guide me on this.
I am using AWX tower to run the playbook and AWX is running on the K8 cluster.
I’m slightly confused about what you are asking for.
It sounds like you are currently managing AD objects in an existing domain controller by using win_shell commands targeting that domain controller. So far so good.
The part that confuses me is “my target host will be localhost as it’s linux” and “no dependency of windows target”. Are you running a windows domain on linux with a linux host as the domain controller? Are we talking about a genuine windows domain here and not an IPA suite? (Although that would be sweet!)
Then I’m even more confused by “I am using AWX […] on [kubernetes]”. Surely you aren’t running your domain controller on the same host(s) as your AWX instance(s)?
I’m not a windows domain admin — which may be painfully obvious from my confusion, displayed above. But if my guesses are correct, then the crucially important point is tucked away in these docs’ “Notes” section:
If running on a server that is not a Domain Controller, credential delegation through CredSSP or Kerberos with delegation must be used or the domain_username, domain_password must be set.
If you do get it working, please drop a followup message to this thread indicating what you needed to do. You surely aren’t the only one with the issue.
There is the sssd service for Linux that joins a Linux host to an AD domain. With that you can use properly credentialed adcli commands to manipulate AD objects.
Why would you not want to be running the MS AD modules against a dedicate Windows AD management server? Understandably to tno run on an actual AD server, but most Windows domains have a dedicated Management/Utilities host for doing things like this. All the Microsoft AD community modules require the ActiveDirectory Powershell module. That is going to cause you several issue with running on the AWX controller (bad idea in general). You should look at Ansible execution environments to use Ansible builder to build a linux powershell container in your K8 cluster to for this. That of course assumes that the ActiveDirectory powershell module is available on Linux.
That of course assumes that the ActiveDirectory powershell module is available on Linux.
It isn’t, it’s a Windows only component that cannot be installed independently. What OP wants to do with the microsoft.ad.x modules cannot be done outside of a Windows target host. They would have to find another tool/set of modules that can run on Linux.
jborean93-Thanks for the confirmation. I was pretty sure that was the case, but had only recently learned that Powershell had linux versions and not up on what has or has not been ported over yet.
Actually I have terraform file to build a Linux and Windows server on Vcenter. I have been asked to create Custom EE and using that need to build a Windows and Linux servers
So I just created Custom EE for AWX with terraform installed now, when I come to build a window VM the prerequisites is to create AD object first then only I can Able to add VM to domain and i suggested to use loca host only not a delegation option for adding object creation that’s why I am trying to install ad module on my Custom EE the below dependency I need to install my Execution environment to manage full infra cycle management
Terraform - build a VM
packer - to build a Temple
Ad module - to manage AD Module
Ping module - for ping a ip to know the free IPs
Vinyl CLI - our won CLI to register ip in IP control