VMware NSX

 View Only
  • 1.  Ansible module for NSX

    Posted Jul 18, 2022 06:18 AM

    Iam trying to run an ansible playbok  to create an overlay segment in NSX but getting the below error:

    ERROR! couldn't resolve module/action 'vmware.ansible_for_nsxt.nsxt_policy_segment'. This often indicates a misspelling, ssing collection, or incorrect module path.

    ---
    - hosts: localhost
       tasks:
        - name: Variables globales
          vmware.ansible_for_nsxt.nsxt_policy_segment:

    Ansible configuration file: 

    # config file for ansible -- https://ansible.com/
    # ===============================================

    # nearly all parameters can be overridden in ansible-playbook
    # or with command line flags. ansible will read ANSIBLE_CONFIG,
    # ansible.cfg in the current working directory, .ansible.cfg in
    # the home directory or /etc/ansible/ansible.cfg, whichever it
    # finds first

    [defaults]

    some basic default values...

    inventory = /etc/ansible/hosts
    library = /usr/share/my_modules/
    module_utils = /usr/share/my_module_utils/
    remote_tmp = ~/.ansible/tmp
    #local_tmp = ~/.ansible/tmp
    #plugin_filters_cfg = /etc/ansible/plugin_filters.yml
    #forks = 5
    #poll_interval = 15
    #sudo_user = root
    #ask_sudo_pass = True
    #ask_pass = True
    #transport = smart
    #remote_port = 22
    #module_lang = C
    #module_set_locale = Fa

    ls /usr/share/my_module_utils/
    ansible-for-nsxt  Ansible-NSXT

    ls /etc/ansible/
    ansible.cfg  hosts

     

    vSohill_0-1658125058680.png

     

    Did I missed module or pluggin ? Do I need to edit the ansible config and change the default settings ? 

    Many thanks for the help 

     



  • 2.  RE: Ansible module for NSX

    Broadcom Employee
    Posted Jul 21, 2022 09:10 PM

    I’ve same issue, if anyone have an answer !

    thanks



  • 3.  RE: Ansible module for NSX

    Posted Jul 25, 2022 08:14 PM

    It's looks like playbook not all the moudles  works 

    It works with below playbooks

    - hosts: localhost
       vars_files:
           - vars.yml
    tasks:
      - name: Update Tags on VMs
        vmware.ansible_for_nsxt.nsxt_vm_tags:
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
       #nsx_cert_path: /root/com.vmware.nsx.ncp/nsx.crt
       #nsx_key_path: /root/com.vmware.nsx.ncp/nsx.key
       validate_certs: False
       #ca_path: /path/to/my/ca-bundle
       virtual_machine_display_name: auto-vm
       remove_other_tags: False
       add_tags:
         - scope: "my-scope"
            tag: "my-tag"
    # - scope: "my-scope1"
    # tag: "my-tag"
       remove_tags_with_scope:
        - my-scope1