# Machine credential not working

**URL:** <https://forum.ansible.com/t/machine-credential-not-working/2973>\
**Category:** Get Help\
**Tags:** infra-config-as-code, awx\
**Created:** [December 18, 2023, 8:55pm UTC](https://forum.ansible.com/t/machine-credential-not-working/2973 "2023-12-18T20:55:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschilen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jschilen/32/1828_2.png) [@jschilen](https://forum.ansible.com/u/jschilen)\
**Post date:** [December 18, 2023, 8:55pm UTC](https://forum.ansible.com/t/machine-credential-not-working/2973/1 "2023-12-18T20:55:14Z")

</div>

Hello,

I’m using AWX on minikube. I’m working on a project to automate the AWX config using infra. I’ve got it working to create an RHV credential, Project, and job template.

Whenever I try to get it to create a machine credential type with the example here: [controller\_configuration/roles/credentials at devel · redhat-cop/controller\_configuration · GitHub](https://github.com/redhat-cop/controller_configuration/tree/devel/roles/credentials)

It causes the credentials task to fail.

The file in controller\_credentials.d looks like this:

```---
controller_credentials:
  - name: KSU-CREDENTIAL-MACHINE / localuser
    description: awx-build Testing Machine Credential example with become_method input
    credential_type: Machine
    inputs:
      username: localuser
      password: password
      become_method: sudo

```

```auto
TASK [infra.controller_configuration.credentials : Managing Controller Credentials | Wait for finish the credential management] ***15:27:59

165

**FAILED - RETRYING: [localhost]: Managing Controller Credentials | Wait for finish the credential management (30 retries left).**

166

changed: [localhost] => (item=None)

167

failed: [localhost] (item=None) => {"attempts": 1, "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}

168

fatal: [localhost]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": true}

```

I have another credential file in the same directory of type Red Hat Virtualization that works fine. It just seems to be as soon as I try to create a Machine type.

Am I doing something wrong?  
Can I get more detailed errors somehow?

---

<div class="post-metadata">

**Author:** ![jschilen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jschilen/32/1828_2.png) [@jschilen](https://forum.ansible.com/u/jschilen)\
**Post date:** [December 21, 2023, 1:57pm UTC](https://forum.ansible.com/t/machine-credential-not-working/2973/2 "2023-12-21T13:57:50Z")

</div>

Well here I am 3 days later and the same code just worked. There’s no difference in the code so I don’t know what I changed elsewhere that made this work ¯\_(ツ)\_/¯.

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 28, 2023, 12:56am UTC](https://forum.ansible.com/t/machine-credential-not-working/2973/3 "2023-12-28T00:56:18Z")

</div>

Hello @jschilen welcome to the Ansible Forum Community!

Good to see you came up with a solution yourself with no effort at all 😛

Just for housekeeping sake, may I ask you to tick the solved check ✅ ? (of course, you can set your own response as the solution!)

In any case, if the issue pops up again, don’t hesitate to reach out. We’re here and more than happy to help! 😊

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 27, 2024, 12:56am UTC](https://forum.ansible.com/t/machine-credential-not-working/2973/4 "2024-01-27T00:56:52Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
