Reopening - VCenter appliance root password expiration set module name & playbook issue

Hallo Team,
Referring the below closed topic

VCenter appliance root password expiration set module name & playbook issue

I found that there is no module. Check my output here

cd  /usr/lib/python3.9/site-packages/ansible_collections/community/vmware/plugins/modules
ls -l vcenter_*
-rw-r--r--. 1 root root  6433 Nov  8  2023 vcenter_domain_user_group_info.py
-rw-r--r--. 1 root root  3397 Nov  8  2023 vcenter_extension_info.py
-rw-r--r--. 1 root root  7219 Nov  8  2023 vcenter_extension.py
-rw-r--r--. 1 root root 16819 Nov  8  2023 vcenter_folder.py
-rw-r--r--. 1 root root  9710 Nov  8  2023 vcenter_license.py
-rw-r--r--. 1 root root 32248 Nov  8  2023 vcenter_standard_key_provider.py

There is no file with name vcenter_root_password_expiration
Looks like this file was left out somewhere.

Reference playbook

---
- name: Change vCenter Root Password expiry
  hosts: localhost
  gather_facts: false
  vars_files:
    - vcenter_vars.yaml
  tasks:
    - name: Change the vCenter password expiry
      community.vmware.vcenter_root_password_expiration:
        hostname: "{{ vc_name }}"
        username: "{{ vc_usr_name }}"
        password: "{{ vc_passwd }}"
        validate_certs: "{{ vc_vali_certs }}"
        max_days_between_password_change: 365
        min_days_between_password_change: 3
        warn_days_before_password_expiration: 7
        email: ansible@zonkos.ict
        state: present
      delegate_to: localhost
└─[$] <> ansible-playbook playbook.yaml --check
[WARNING]: Unable to parse /root/vc_passwd/inventory/vcenters.ini as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
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 '/root/vc_passwd/playbook.yaml': line 10, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  tasks:
    - name: Change the vCenter password expiry
      ^ here
You have new mail.
┌─[root@hatchery] - [~/vc_passwd] - [Wed May 15, 14:47]
└─[$] <>    

Hi, community.vmware.vcenter_root_password_expiration was introduced community.vmware 3.10.0.

New in community.vmware 3.10.0
community.vmware.vcenter_root_password_expiration module – root password expiration of vCSA — Ansible Community Documentation

Ensure your installed version by ansible-galaxy collection list | grep community.vmware and consider upgrading the collection.

thank you, it explains everything :slight_smile:

That’s good :smiley: If you don’t have any further questions, could you please mark my post as a solution? Thanks :smiley:

if you do not mind, can you also help me with the below error

[sugrible@ansiblerocky plugins]$ ansible-galaxy collection install vmware.collection --force -vvvv --no-cache
ansible-galaxy [core 2.14.14]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/sugrible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/sugrible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-galaxy
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
Initial connection to galaxy_server: https://galaxy.ansible.com
Opened /home/sugrible/.ansible/galaxy_token
Calling Galaxy at https://galaxy.ansible.com/api/
Found API version 'v3, pulp-v3, v1' with Galaxy server default (https://galaxy.ansible.com/api/)
Calling Galaxy at https://galaxy.ansible.com/api/v3/collections/vmware/collection/versions/?limit=100
ERROR! Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* vmware.collection:* (direct request)
[sugrible@ansiblerocky plugins]$

Specify community.vmware instead of vmware.collection

1 Like

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