redhat-cop / cloud.vmware_ops

Ansible roles for managing VMware resources
GNU General Public License v3.0
4 stars 12 forks source link

cloud.vmware_ops.info make sure directory exists requires community.general #88

Closed IPvSean closed 2 months ago

IPvSean commented 2 months ago

This is the error->

➜  vmware-demos git:(main) ansible-navigator run vmware_visbility.yml --mode stdout
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [VMware visbility] *******************************************************************************************************************************************************

TASK [Set VCenter parameters] *************************************************************************************************************************************************
ok: [localhost]

TASK [cloud.vmware_ops.info : License info] ***********************************************************************************************************************************
included: /usr/share/ansible/collections/ansible_collections/cloud/vmware_ops/roles/info/tasks/license_info.yml for localhost

TASK [cloud.vmware_ops.info : Fetch the license information] ******************************************************************************************************************
ok: [localhost]

TASK [cloud.vmware_ops.info : Make sure directory exists] *********************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while templating '/tmp/license-{{ lookup('community.general.random_string', special=false) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: lookup plugin (community.general.random_string) not found"}

The playbook is super simple:

---
- name: VMware visbility
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Set VCenter parameters
      ansible.builtin.include_vars: login_info.yml

    - name: Use info role
      ansible.builtin.import_role:
        name: cloud.vmware_ops.info
      vars:
        info_license: true
        info_storage: true
        info_appliance: true
        info_guest: true
        info_hostname: "{{ vcenter_hostname }}"
        info_username: "{{ vcenter_username }}"
        info_password: "{{ vcenter_password }}"
        info_validate_certs: false
IPvSean commented 2 months ago

https://github.com/redhat-cop/cloud.vmware_ops/blob/main/roles/info/defaults/main.yml#L13

bardielle commented 2 months ago

@IPvSean thanks for your feedback I opened a PR to fix it