Setting the ansible_user variable to use for an ansible integration

I wanted to ask if there is a better way to set the “ansible_user” variable for a run of an Ansible integration. I was originally trying to set it via the inventory file in an [all:vars] using a custom option section but it is getting overridden by the inline host entry in the inventory. Here is a screenshot showing our variables in the custom inventory file where I’m trying to set the ansible_user via a custom option on the instance.

Screenshot 2023-12-12 at 11.29.26 AM

And here is what one of the host entries in the inventory ends up looking like. Note that ansible_user is set to Administrator no matter what I set the custom option to.

ansible_host=<host_IPD> ansible_connection=winrm ansible_become_method=runas ansible_port=5985 ansible_winrm_transport=ntlm ansible_winrm_message_encryption=always ansible_user=Administrator ansible_morpheus_container_id=15675 ansible_ssh_common_args=‘-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no’

I have gotten it to work by setting the ansible_user via a command line argument on the task. However, we would like to use this task on multiple types of OSes that will require different ansible_users. So while this sets it to what I want, it would require us to have a task per OS when the playbook itself is the same. Here’s what the COMMAND OPTIONS of the task are set to.

–extra-vars “ansible_user=admin_user”

So my question boils down to, is there another way to set the ansible_user variable dynamically per layout or instance so that we can reuse a single task to run the playbook rather than having multiple tasks for each OS that do the same with with different ansible command options.

Also for context as to why I would like to not use the Administrator user for Ansible on windows is because our IT department has set a policy to automatically change the Administrator password on domain join. So we can connect using the account as the password is not known to us.

We are on Morpheus version 5.4.15.

Thanks!

I am also facing the same issue, and it is causing a significant problem for us. We just acquired Morpheus, and during the configuration process, we encountered this issue. This is not a positive experience for a first-time user of this product.