# VCenter appliance root password expiration set module name & playbook issue

**URL:** <https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942>\
**Category:** Get Help\
**Tags:** vmware, collections\
**Created:** [December 16, 2023, 1:12pm UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942 "2023-12-16T13:12:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkrishnasamy01](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kkrishnasamy01/32/1804_2.png) [@kkrishnasamy01](https://forum.ansible.com/u/kkrishnasamy01)\
**Post date:** [December 16, 2023, 1:12pm UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/1 "2023-12-16T13:12:37Z")

</div>

VCenter appliance root password expiration set module name & playbook issue

Hi Team,

Please share me module name for “VCenter appliance root password expiration set”.  
Getting “ERROR! couldn’t resolve module/action ‘vmware.vmware\_rest’. This often indicates a misspelling, missing collection, or incorrect module path.”

- hosts: localhost  
name: VC Root Password Expiration Set  
gather\_facts: false  
vars\_files: …/answerfile.ymltasks:
  - name: Password Expiration Set  
vmware.vmware\_rest:  
hostname: “{{ vcenter\_hostname }}”  
username: “{{ vcenter\_username }}”  
password: “{{ vcenter\_password }}”  
validate\_certs: no  
#max\_days\_between\_password\_change: 9999  
#min\_days\_between\_password\_change: 6  
#warn\_days\_before\_password\_expiration: 7  
root\_password\_expires: “{{ expire\_password }}”  
root\_password\_expire\_days: “{{ password\_expiration\_days }}”  
state: present  
delegate\_to: localhost

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [December 16, 2023, 1:41pm UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/2 "2023-12-16T13:41:20Z")

</div>

Is the collection installed? You can check this like this:

```bash
ansible-galaxy collection list | grep -e ^vmware.vmware_rest
vmware.vmware_rest 2.3.1  

```

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [December 16, 2023, 1:43pm UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/3 "2023-12-16T13:43:00Z")

</div>

Hi,

`vmware.vmware_rest` is a [collection](https://docs.ansible.com/ansible/latest/collections/vmware/vmware_rest/index.html), not a module. Also, you’re missing `tasks` keyword in your play.

Edit: I don’t know how familiar you are with Ansible, but for clarification, a task refers to a module, which would be part of a collection.  
Here `vmware.vmware_rest` is the collection namespace, and contains different modules (as well as plugins and perhaps roles), such as [vmware.vmware\_rest.vcenter\_vm](https://docs.ansible.com/ansible/latest/collections/vmware/vmware_rest/vcenter_vm_module.html#ansible-collections-vmware-vmware-rest-vcenter-vm-module), which you could use in a task to create a VM, for example.

Edit 2: I think [community.vmware.vcenter\_root\_password\_expiration module](https://docs.ansible.com/ansible/latest/collections/community/vmware/vcenter_root_password_expiration_module.html) would be a good fit for your needs, assuming I understand correctly what you’re trying to achieve.

---

<div class="post-metadata">

**Author:** ![kkrishnasamy01](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kkrishnasamy01/32/1804_2.png) [@kkrishnasamy01](https://forum.ansible.com/u/kkrishnasamy01)\
**Post date:** [December 18, 2023, 3:43am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/4 "2023-12-18T03:43:35Z")

</div>

yes chris…it is installed . The below are the output.  
root@ubuntu-virtual-machine:~# ansible-galaxy collection list | grep -e ^vmware.vmware\_rest  
vmware.vmware\_rest 2.2.0  
root@ubuntu-virtual-machine:~#

---

<div class="post-metadata">

**Author:** ![kkrishnasamy01](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kkrishnasamy01/32/1804_2.png) [@kkrishnasamy01](https://forum.ansible.com/u/kkrishnasamy01)\
**Post date:** [December 18, 2023, 3:46am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/5 "2023-12-18T03:46:48Z")

</div>

Hi Pierre,

Answer your first question : Yes , Im new to Ansible …I’m just started learning.

Answer to your second question : I’m going to achieve here is, I will set VCenter appliance root password expiration to 9999 days.  
by default 90 days …Could you please review my play book ?

I’ve change to “community.vmware.vcenter\_root\_password\_expiration” but still getting the same error.

**ERROR! couldn’t resolve module/action ‘community.vmware.vcenter\_root\_password\_expiration’. This often indicates a misspelling, missing collection, or incorrect module path.**

**The error appears to be in ‘/home/kkrishnasamy/VCenter\_deploy\_playbook/playbooks/04-VC-RootPWD-expiration-Set.yml’: line 8, column 8, but may**  
**be elsewhere in the file depending on the exact syntax problem.**

**The offending line appears to be:**

\*\* tasks:\*\*  
\*\* - name: Password Expiration Set\*\*  
\*\* ^ here\*\*

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [December 18, 2023, 7:39am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/6 "2023-12-18T07:39:32Z")

</div>

Could you also share your playbook ? As a side note, consider using [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) for better readability 🙂

---

<div class="post-metadata">

**Author:** ![kkrishnasamy01](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kkrishnasamy01/32/1804_2.png) [@kkrishnasamy01](https://forum.ansible.com/u/kkrishnasamy01)\
**Post date:** [December 18, 2023, 8:13am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/7 "2023-12-18T08:13:02Z")

</div>

Hi Pierre,

Please find my playbook.

* * *

- hosts: localhost  
name: VC Root Password Expiration Set  
gather\_facts: false  
vars\_files: …/answerfile.yml

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [December 18, 2023, 8:50am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/8 "2023-12-18T08:50:17Z")

</div>

Thanks ! Though you haven’t used a code block, so I can’t tell if you used correct indentation, as I suspect your issue lies there. Could you edit your post to paste your playbook content into one of those ?

---

<div class="post-metadata">

**Author:** ![kkrishnasamy01](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kkrishnasamy01/32/1804_2.png) [@kkrishnasamy01](https://forum.ansible.com/u/kkrishnasamy01)\
**Post date:** [December 18, 2023, 9:05am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/9 "2023-12-18T09:05:33Z")

</div>

Hi Pierre,

Yes, I’m not using code block.

Please find my playbook.

* * *

- hosts: localhost  
name: VC Root Password Expiration Set  
gather\_facts: false  
vars\_files: …/answerfile.ymltasks:
  - name: Password Expiration Set  
vcenter\_root\_password\_expiration:  
hostname: “{{ vcenter\_hostname }}”  
username: “{{ vcenter\_username }}”  
password: “{{ vcenter\_password }}”  
validate\_certs: no  
#max\_days\_between\_password\_change: 9999  
#min\_days\_between\_password\_change: 6  
#warn\_days\_before\_password\_expiration: 7  
root\_password\_expires: “{{ expire\_password }}”  
root\_password\_expire\_days: “{{ password\_expiration\_days }}”  
state: present  
delegate\_to: localhost

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [December 18, 2023, 9:13am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/10 "2023-12-18T09:13:24Z")

</div>

> Yes, I’m not using code block.

I think there might be a misunderstanding, sorry. I am asking you to use a code block to better format your code, because right now, I can’t tell if it is correctly indented (and I think this might be where your error comes from). So, would you ? 🙂

If that’s an issue for whatever reason, you can also share it from a [gist](https://gist.github.com/) or any other similar service.

Also I don’t understand why there was a `tasks` block the first time you shared it, but it is gone now.

---

<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 17, 2024, 9:13am UTC](https://forum.ansible.com/t/vcenter-appliance-root-password-expiration-set-module-name-playbook-issue/2942/11 "2024-01-17T09:13:57Z")

</div>

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