- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Setting the ansible_user variable to use for an an...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:27 AM
12-12-2023 11:27 AM
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.
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!
- Tags:
- Ansible

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 06:45 AM
02-23-2024 06:45 AM
Re: Setting the ansible_user variable to use for an ansible integration
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.