Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example using four networks to map #1731

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Tronde
Copy link

@Tronde Tronde commented May 12, 2023

SUMMARY

Added an example that shows how networks mapping is done with an OVA template that contains four source networks.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME
  • vmware_deploy_ovf
ADDITIONAL INFORMATION

Lines added:

    # Deploy an OVA template, with network mapping of four source networks (Internal, External, Management, and HA) to target networks (VM_NET_1, VM_NET_2, VM_NET_3, and VM_NET_4)
    - community.vmware.vmware_deploy_ovf:
        hostname: '{{ vcenter_hostname }}'
        username: '{{ vcenter_username }}'
        password: '{{ vcenter_password }}'
        datacenter: Datacenter1
        cluster: Cluster1
        datastore: vsandatastore
        name: NewVM
        networks:
          Internal: 'VM_NET_1'
          External: 'VM_NET_2'
          Management: 'VM_NET_3'
          HA: 'VM_NET_4'
        power_on: false
        ovf: files/mytemplate.ova
      delegate_to: localhost

Added an example that shows how networks mapping is done with an OVA template that contains four source networks.
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5c72b1ef57904c639cba5fcf303da6c1

✔️ ansible-tox-linters SUCCESS in 8m 25s
✔️ build-ansible-collection SUCCESS in 9m 12s
ansible-test-sanity-docker-devel FAILURE in 9m 36s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 35s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 59s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 35s
✔️ ansible-test-units-community-vmware-python38 SUCCESS in 6m 09s
✔️ ansible-galaxy-importer SUCCESS in 4m 02s

@mariolenz
Copy link
Collaborator

@Tronde I'm afraid this won't do. You see, the documentation is generated from the module code. So your changes will probably be undone when we release a another version (which includes re-generating the documentation). You should add this to the EXAMPLES in the module to be on the safe side, that is here:

EXAMPLES = r'''
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
ovf: /path/to/ubuntu-16.04-amd64.ovf
wait_for_ip_address: true
delegate_to: localhost
# Deploys a new VM named 'NewVM' in specific datacenter/cluster, with network mapping taken from variable and using ova template from an absolute path
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: Datacenter1
cluster: Cluster1
datastore: vsandatastore
name: NewVM
networks: "{u'VM Network':u'{{ ProvisioningNetworkLabel }}'}"
power_on: false
ovf: /absolute/path/to/template/mytemplate.ova
delegate_to: localhost
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: Datacenter1
esxi_hostname: test-server
datastore: test-datastore
ovf: /path/to/ubuntu-16.04-amd64.ovf
delegate_to: localhost
'''

@Tronde
Copy link
Author

Tronde commented May 13, 2023 via email

Added an example showing how to deploy an OVF/OVA template containing four source networks and map them to vSphere networks.
@Tronde
Copy link
Author

Tronde commented May 14, 2023

Hi @mariolenz ,
I moved the example from the .rst file to the module code. Could you please check if it's OK now?

Cheers,
Tronde

@Tronde
Copy link
Author

Tronde commented May 15, 2023

Sorry, I may need some help here as I cannot figure out what I did wrong causing the ansible/check to fail.

@mariolenz
Copy link
Collaborator

recheck

@mariolenz
Copy link
Collaborator

Sorry, I may need some help here as I cannot figure out what I did wrong causing the ansible/check to fail.

I don't understand why this fails, either :-/

BTW: You've committed your changes to the main branch of your fork. That might be problematic. Not for us, but for you. You should have created a so-called feature branch.

You see, merging the PR creates a new commit in this repo which will be different from the one in your fork. This will probably lead to a merge conflict. If you create a feature branch for a PR, you can simply delete it once the PR is merged and sync your main branch with ours. That's usually a lot easier.

@Tronde
Copy link
Author

Tronde commented May 15, 2023

Sorry, I may need some help here as I cannot figure out what I did wrong causing the ansible/check to fail.

I don't understand why this fails, either :-/

Well, at least that makes two of us. ;-)

BTW: You've committed your changes to the main branch of your fork. That might be problematic. Not for us, but for you. You should have created a so-called feature branch.

You see, merging the PR creates a new commit in this repo which will be different from the one in your fork. This will probably lead to a merge conflict. If you create a feature branch for a PR, you can simply delete it once the PR is merged and sync your main branch with ours. That's usually a lot easier.

Yeah, I know. I thought this would be an easy and quick one so I didn't bother creating a feature branch first. Who could have guessed that there would be an issue with just adding a comment. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants