-
Notifications
You must be signed in to change notification settings - Fork 65
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
updating lookup docs to be more descriptive #503
updating lookup docs to be more descriptive #503
Conversation
f8fc37b
to
72e221b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #503 +/- ##
=======================================
Coverage 34.20% 34.20%
=======================================
Files 143 143
Lines 11032 11032
Branches 2279 2279
=======================================
Hits 3774 3774
Misses 7258 7258
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 11m 13s |
plugins/lookup/cluster_moid.py
Outdated
|
||
# Alternatively, you can add the connection arguments to a dictionary variable, and then pass that variable to the | ||
# lookup plugins. This makes the individual lookup plugin calls simpler | ||
- name: Set Connection Argument Variable | ||
ansible.builtin.set_fact: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better than setting fact, use a block
and set this in the vars:
section of it, avoids a lot of memory misuse for data that is not really host specific. You can also use the block name instead for the extra info instead of comments as some documentation tools will strip the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, thats a good tip. I am not sure a block makes sense here though, since the example is showing the user can set this auth variable once early in the playbook and then reference it throughout the play.
I could update the example to be a stub playbook though? like
- hosts: all
vars:
connection_args:
.....
tasks:
- debug: ...
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 8m 38s |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 13m 08s |
@mariolenz @bardielle https://ansible.softwarefactory-project.io/zuul/build/43290fd054634db9a13e116f54b79853 - this build shows that no datastores are present on the cluster, and then fails because its trying to create a vm and cant find the specified datastore https://ansible.softwarefactory-project.io/zuul/build/4f0cd2db3c8e4f7995f3a5c984802c13 - this build is trying to run a tox job that no longer exists. It was removed in a previous commit 29688ba |
@alinabuzachis can you review it as well? |
I don't understand the CI failure. I've opened #507 to investigate how to fix this. |
recheck |
Build succeeded. ✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 10m 45s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikemorency I left some small suggestions.
d2dea5b
to
98c0d0c
Compare
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: You can compare to the docs for the File changes:
Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. The diff output was truncated because it exceeded the maximum size. diff --git a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/cluster_moid_lookup.html b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/cluster_moid_lookup.html
index c9c15cd..a9391f1 100644
--- a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/cluster_moid_lookup.html
+++ b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/cluster_moid_lookup.html
@@ -182,7 +182,10 @@ see <a class="reference internal" href="#ansible-collections-vmware-vmware-rest-
<div class="ansibleOptionAnchor" id="parameter-_terms"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-terms"><strong>Terms</strong></p>
<a class="ansibleOptionLink" href="#parameter-_terms" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
-<td><div class="ansible-option-cell"><p>Path to query.</p>
+<td><div class="ansible-option-cell"><p>The absolute folder path to the object you would like to lookup.</p>
+<p>Folder paths always start with the datacenter name, and then the object type (host, vm, network, datastore).</p>
+<p>If the object is in a sub folder, the sub folder path should be added after the object type (for example /my_dc/vm/some/sub_folder/vm_name_to_lookup).</p>
+<p>Enter the object or folder names as seen in the VCenter GUI. Do not escape spaces or special characters.</p>
</div></td>
</tr>
</tbody>
@@ -200,6 +203,15 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-object_type"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-object-type"><strong>object_type</strong></p>
+<a class="ansibleOptionLink" href="#parameter-object_type" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Should not be set by the user, it is set internally when using a specific lookup plugin.</p>
+<p>Describes the type of object to lookup. Example, cluster, datacenter, datastore, etc.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"cluster"</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_hostname"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-vcenter-hostname"><strong>vcenter_hostname</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_hostname" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -210,7 +222,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_password"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-vcenter-password"><strong>vcenter_password</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_password" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -221,7 +233,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_rest_log_file"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-vcenter-rest-log-file"><strong>vcenter_rest_log_file</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_rest_log_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -234,7 +246,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_username"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-vcenter-username"><strong>vcenter_username</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_username" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -245,7 +257,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_validate_certs"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-cluster-moid-lookup-parameter-vcenter-validate-certs"><strong>vcenter_validate_certs</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -271,24 +283,106 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
<ul class="simple">
<li><p>When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
<code class="docutils literal notranslate"><span class="pre">lookup('vmware.vmware_rest.cluster_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code> and <code class="docutils literal notranslate"><span class="pre">query('vmware.vmware_rest.cluster_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code></p></li>
+<li><p>Lookup plugins are run on the ansible controller and are used to lookup information from an external resource. See <a class="reference external" href="https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins">https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins</a></p></li>
+<li><p>This collection’s plugins allow you to quickly gather VMWare resource identifiers and either store or use them, instead of requiring multiple modules and tasks to do the same thing. See the examples section for a comparison.</p></li>
</ul>
</div>
</section>
<section id="examples">
<h2><a class="toc-backref" href="#id6" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
-<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1"># lookup sample</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set connection info</span>
-<span class="w"> </span><span class="nt">ansible.builtin.set_fact</span><span class="p">:</span>
+<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1">#</span>
+<span class="c1">#</span>
+<span class="c1"># The examples below assume you have a datacenter named 'my_dc' and a cluster named 'my_cluster'.</span>
+<span class="c1"># Replace these values as needed for your environment.</span>
+<span class="c1">#</span>
+<span class="c1">#</span>
+
+<span class="c1">#</span>
+<span class="c1"># Authentication / Connection Arguments</span>
+<span class="c1">#</span>
+<span class="c1"># You can explicitly set the connection arguments in each lookup. This may be clearer for some use cases</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Pass In Connection Arguments Explicitly</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">>-</span>
+<span class="w"> </span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">,</span>
+ <span class="nv">vcenter_hostname</span><span class="o">=</span><span class="s2">"vcenter.test"</span><span class="o">,</span>
+ <span class="nv">vcenter_username</span><span class="o">=</span><span class="s2">"administrator@vsphere.local"</span><span class="o">,</span>
+ <span class="nv">vcenter_password</span><span class="o">=</span><span class="s2">"1234"</span><span class="o">)</span> <span class="cp">}}</span>
+
+<span class="c1"># Alternatively, you can add the connection arguments to a dictionary variable, and then pass that variable to the</span>
+<span class="c1"># lookup plugins. This makes the individual lookup plugin calls simpler</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Example Playbook</span>
+<span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">all</span>
+<span class="w"> </span><span class="nt">vars</span><span class="p">:</span>
<span class="w"> </span><span class="nt">connection_args</span><span class="p">:</span>
<span class="w"> </span><span class="nt">vcenter_hostname</span><span class="p">:</span><span class="w"> </span><span class="s">"vcenter.test"</span>
<span class="w"> </span><span class="nt">vcenter_username</span><span class="p">:</span><span class="w"> </span><span class="s">"administrator@vsphere.local"</span>
<span class="w"> </span><span class="nt">vcenter_password</span><span class="p">:</span><span class="w"> </span><span class="s">"1234"</span>
+<span class="w"> </span><span class="nt">tasks</span><span class="p">:</span>
+<span class="w"> </span><span class="c1"># Add more tasks or lookups as needed, referencing the same connection_args variable</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lookup MoID of the object</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1"># Finally, you can also leverage the environment variables associated with each connection arg, and avoid passing</span>
+<span class="c1"># extra args to the lookup plugins</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Use a lookup plugin with VMWARE_* environment variables set</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object inside the path</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/'</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1">#</span>
+<span class="c1"># Cluster Search Path Examples</span>
+<span class="c1">#</span>
+<span class="c1"># Clusters are located under the 'host' folder in a datacenter.</span>
+<span class="c1"># The basic path for a cluster should look like '/<datacenter-name>/host/<cluster-name>'</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lookup Cluster Named 'my_cluster' in Datacenter 'my_dc'</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
+
+<span class="c1">#</span>
+<span class="c1"># Usage in Playbooks</span>
+<span class="c1">#</span>
+<span class="c1">#</span>
+<span class="c1"># The lookup plugin can be used to simplify your playbook. Here is an example of how you might use it.</span>
+<span class="c1">#</span>
+<span class="c1"># Without the lookup, this takes two modules which both run on the remote host. This can slow down execution</span>
+<span class="c1"># and adds extra steps to the playbook:</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Retrieve details about a cluster named 'my_cluster'</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_cluster_info</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">names</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_cluster</span>
+<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_cluster_info</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create a VM</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_vm</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">placement</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">cluster</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">my_cluster_info.value</span><span class="o">[</span><span class="m">0</span><span class="o">]</span><span class="nv">.cluster</span> <span class="cp">}}</span><span class="s">"</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test_vm1</span>
+<span class="w"> </span><span class="nt">guest_OS</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">RHEL_7_64</span>
+<span class="w"> </span><span class="nt">hardware_version</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VMX_11</span>
+<span class="w"> </span><span class="nt">memory</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">size_MiB</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1024</span>
+<span class="w"> </span><span class="nt">disks</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">SATA</span>
+<span class="w"> </span><span class="nt">new_vmdk</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">first_disk</span>
+<span class="w"> </span><span class="nt">capacity</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3200</span>
+
+<span class="c1"># With the lookup, playbooks are shorter, quicker, and more intuitive:</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create a VM</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_vm</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">placement</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">cluster</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.cluster_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test_vm1</span>
+<span class="w"> </span><span class="nt">guest_OS</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">RHEL_7_64</span>
+<span class="w"> </span><span class="nt">hardware_version</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VMX_11</span>
+<span class="w"> </span><span class="nt">memory</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">size_MiB</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1024</span>
+<span class="w"> </span><span class="nt">disks</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">SATA</span>
+<span class="w"> </span><span class="nt">new_vmdk</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">first_disk</span>
+<span class="w"> </span><span class="nt">capacity</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3200</span>
</pre></div>
</div>
</section>
diff --git a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/datacenter_moid_lookup.html b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/datacenter_moid_lookup.html
index e25cdc3..355472e 100644
--- a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/datacenter_moid_lookup.html
+++ b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/datacenter_moid_lookup.html
@@ -182,7 +182,10 @@ see <a class="reference internal" href="#ansible-collections-vmware-vmware-rest-
<div class="ansibleOptionAnchor" id="parameter-_terms"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-terms"><strong>Terms</strong></p>
<a class="ansibleOptionLink" href="#parameter-_terms" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
-<td><div class="ansible-option-cell"><p>Path to query.</p>
+<td><div class="ansible-option-cell"><p>The absolute folder path to the object you would like to lookup.</p>
+<p>Folder paths always start with the datacenter name, and then the object type (host, vm, network, datastore).</p>
+<p>If the object is in a sub folder, the sub folder path should be added after the object type (for example /my_dc/vm/some/sub_folder/vm_name_to_lookup).</p>
+<p>Enter the object or folder names as seen in the VCenter GUI. Do not escape spaces or special characters.</p>
</div></td>
</tr>
</tbody>
@@ -200,6 +203,15 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-object_type"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-object-type"><strong>object_type</strong></p>
+<a class="ansibleOptionLink" href="#parameter-object_type" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Should not be set by the user, it is set internally when using a specific lookup plugin.</p>
+<p>Describes the type of object to lookup. Example, cluster, datacenter, datastore, etc.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"cluster"</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_hostname"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-vcenter-hostname"><strong>vcenter_hostname</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_hostname" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -210,7 +222,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_password"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-vcenter-password"><strong>vcenter_password</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_password" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -221,7 +233,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_rest_log_file"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-vcenter-rest-log-file"><strong>vcenter_rest_log_file</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_rest_log_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -234,7 +246,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_username"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-vcenter-username"><strong>vcenter_username</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_username" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -245,7 +257,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_validate_certs"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datacenter-moid-lookup-parameter-vcenter-validate-certs"><strong>vcenter_validate_certs</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -271,24 +283,105 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
<ul class="simple">
<li><p>When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
<code class="docutils literal notranslate"><span class="pre">lookup('vmware.vmware_rest.datacenter_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code> and <code class="docutils literal notranslate"><span class="pre">query('vmware.vmware_rest.datacenter_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code></p></li>
+<li><p>Lookup plugins are run on the ansible controller and are used to lookup information from an external resource. See <a class="reference external" href="https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins">https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins</a></p></li>
+<li><p>This collection’s plugins allow you to quickly gather VMWare resource identifiers and either store or use them, instead of requiring multiple modules and tasks to do the same thing. See the examples section for a comparison.</p></li>
</ul>
</div>
</section>
<section id="examples">
<h2><a class="toc-backref" href="#id6" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
-<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1"># lookup sample</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set connection info</span>
-<span class="w"> </span><span class="nt">ansible.builtin.set_fact</span><span class="p">:</span>
+<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1">#</span>
+<span class="c1">#</span>
+<span class="c1"># The examples below assume you have a datacenter named 'my_dc'.</span>
+<span class="c1"># Replace these values as needed for your environment.</span>
+<span class="c1">#</span>
+<span class="c1">#</span>
+
+<span class="c1">#</span>
+<span class="c1"># Authentication / Connection Arguments</span>
+<span class="c1">#</span>
+<span class="c1"># You can explicitly set the connection arguments in each lookup. This may be clearer for some use cases</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Pass In Connection Arguments Explicitly</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">>-</span>
+<span class="w"> </span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">,</span>
+ <span class="nv">vcenter_hostname</span><span class="o">=</span><span class="s2">"vcenter.test"</span><span class="o">,</span>
+ <span class="nv">vcenter_username</span><span class="o">=</span><span class="s2">"administrator@vsphere.local"</span><span class="o">,</span>
+ <span class="nv">vcenter_password</span><span class="o">=</span><span class="s2">"1234"</span><span class="o">)</span> <span class="cp">}}</span>
+
+<span class="c1"># Alternatively, you can add the connection arguments to a dictionary variable, and then pass that variable to the</span>
+<span class="c1"># lookup plugins. This makes the individual lookup plugin calls simpler</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Example Playbook</span>
+<span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">all</span>
+<span class="w"> </span><span class="nt">vars</span><span class="p">:</span>
<span class="w"> </span><span class="nt">connection_args</span><span class="p">:</span>
-<span class="w"> </span><span class="nt">vcenter_hostname</span><span class="p">:</span><span class="w"> </span><span class="s">"vcenter.test"</span>
-<span class="w"> </span><span class="nt">vcenter_username</span><span class="p">:</span><span class="w"> </span><span class="s">"administrator@vsphere.local"</span>
-<span class="w"> </span><span class="nt">vcenter_password</span><span class="p">:</span><span class="w"> </span><span class="s">"1234"</span>
+<span class="w"> </span><span class="nt">vcenter_hostname</span><span class="p">:</span><span class="w"> </span><span class="s">"vcenter.test"</span>
+<span class="w"> </span><span class="nt">vcenter_username</span><span class="p">:</span><span class="w"> </span><span class="s">"administrator@vsphere.local"</span>
+<span class="w"> </span><span class="nt">vcenter_password</span><span class="p">:</span><span class="w"> </span><span class="s">"1234"</span>
+<span class="w"> </span><span class="nt">tasks</span><span class="p">:</span>
+<span class="w"> </span><span class="c1"># Add more tasks or lookups as needed, referencing the same connection_args variable</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lookup MoID of the object</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1"># Finally, you can also leverage the environment variables associated with each connection arg, and avoid passing</span>
+<span class="c1"># extra args to the lookup plugins</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Use a lookup plugin with VMWARE_* environment variables set</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object inside the path</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_folder/'</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1">#</span>
+<span class="c1"># Datacenter Search Path Examples</span>
+<span class="c1">#</span>
+<span class="c1"># Datacenters are located at the root of VMWare paths.</span>
+<span class="c1"># The basic path for a datacenter should look like '/<datacenter-name>'</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lookup Datacenter 'my_dc'</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
+
+<span class="c1"># Usage in Playbooks</span>
+<span class="c1">#</span>
+<span class="c1">#</span>
+<span class="c1"># The lookup plugin can be used to simplify your playbook. Here is an example of how you might use it.</span>
+<span class="c1">#</span>
+<span class="c1"># Without the lookup, this takes two modules which both run on the remote host. This can slow down execution</span>
+<span class="c1"># and adds extra steps to the playbook:</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Retrieve details about a datacenter named 'my_dc'</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_datacenter_info</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">names</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_dc</span>
+<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my_dc_info</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create a VM</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_vm</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">placement</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">datacenter</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">my_dc_info.value</span><span class="o">[</span><span class="m">0</span><span class="o">]</span><span class="nv">.datacebter</span> <span class="cp">}}</span><span class="s">"</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test_vm1</span>
+<span class="w"> </span><span class="nt">guest_OS</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">RHEL_7_64</span>
+<span class="w"> </span><span class="nt">hardware_version</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VMX_11</span>
+<span class="w"> </span><span class="nt">memory</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">size_MiB</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1024</span>
+<span class="w"> </span><span class="nt">disks</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">SATA</span>
+<span class="w"> </span><span class="nt">new_vmdk</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">first_disk</span>
+<span class="w"> </span><span class="nt">capacity</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3200</span>
+
+<span class="c1"># With the lookup, playbooks are shorter, quicker, and more intuitive:</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create a VM</span>
+<span class="w"> </span><span class="nt">vmware.vmware_rest.vcenter_vm</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">placement</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">datacenter</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datacenter_moid'</span><span class="o">,</span> <span class="s1">'/my_dc'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">test_vm1</span>
+<span class="w"> </span><span class="nt">guest_OS</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">RHEL_7_64</span>
+<span class="w"> </span><span class="nt">hardware_version</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">VMX_11</span>
+<span class="w"> </span><span class="nt">memory</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">size_MiB</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1024</span>
+<span class="w"> </span><span class="nt">disks</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">SATA</span>
+<span class="w"> </span><span class="nt">new_vmdk</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">first_disk</span>
+<span class="w"> </span><span class="nt">capacity</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3200</span>
</pre></div>
</div>
</section>
diff --git a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/datastore_moid_lookup.html b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/datastore_moid_lookup.html
index ffb7192..d823e4c 100644
--- a/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/base/collections/vmware/vmware_rest/datastore_moid_lookup.html
+++ b/home/runner/work/vmware.vmware_rest/vmware.vmware_rest/docsbuild/head/collections/vmware/vmware_rest/datastore_moid_lookup.html
@@ -182,7 +182,10 @@ see <a class="reference internal" href="#ansible-collections-vmware-vmware-rest-
<div class="ansibleOptionAnchor" id="parameter-_terms"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-terms"><strong>Terms</strong></p>
<a class="ansibleOptionLink" href="#parameter-_terms" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
-<td><div class="ansible-option-cell"><p>Path to query.</p>
+<td><div class="ansible-option-cell"><p>The absolute folder path to the object you would like to lookup.</p>
+<p>Folder paths always start with the datacenter name, and then the object type (host, vm, network, datastore).</p>
+<p>If the object is in a sub folder, the sub folder path should be added after the object type (for example /my_dc/vm/some/sub_folder/vm_name_to_lookup).</p>
+<p>Enter the object or folder names as seen in the VCenter GUI. Do not escape spaces or special characters.</p>
</div></td>
</tr>
</tbody>
@@ -200,6 +203,15 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-object_type"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-object-type"><strong>object_type</strong></p>
+<a class="ansibleOptionLink" href="#parameter-object_type" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Should not be set by the user, it is set internally when using a specific lookup plugin.</p>
+<p>Describes the type of object to lookup. Example, cluster, datacenter, datastore, etc.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"cluster"</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_hostname"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-vcenter-hostname"><strong>vcenter_hostname</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_hostname" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -210,7 +222,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_password"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-vcenter-password"><strong>vcenter_password</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_password" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -221,7 +233,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_rest_log_file"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-vcenter-rest-log-file"><strong>vcenter_rest_log_file</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_rest_log_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -234,7 +246,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_username"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-vcenter-username"><strong>vcenter_username</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_username" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
@@ -245,7 +257,7 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-vcenter_validate_certs"></div><p class="ansible-option-title" id="ansible-collections-vmware-vmware-rest-datastore-moid-lookup-parameter-vcenter-validate-certs"><strong>vcenter_validate_certs</strong></p>
<a class="ansibleOptionLink" href="#parameter-vcenter_validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -271,24 +283,114 @@ examples: <code class="docutils literal notranslate"><span class="pre">lookup('v
<ul class="simple">
<li><p>When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
<code class="docutils literal notranslate"><span class="pre">lookup('vmware.vmware_rest.datastore_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code> and <code class="docutils literal notranslate"><span class="pre">query('vmware.vmware_rest.datastore_moid',</span> <span class="pre">term1,</span> <span class="pre">term2,</span> <span class="pre">key1=value1,</span> <span class="pre">key2=value2)</span></code></p></li>
+<li><p>Lookup plugins are run on the ansible controller and are used to lookup information from an external resource. See <a class="reference external" href="https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins">https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins</a></p></li>
+<li><p>This collection’s plugins allow you to quickly gather VMWare resource identifiers and either store or use them, instead of requiring multiple modules and tasks to do the same thing. See the examples section for a comparison.</p></li>
</ul>
</div>
</section>
<section id="examples">
<h2><a class="toc-backref" href="#id6" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
-<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1"># lookup sample</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set connection info</span>
-<span class="w"> </span><span class="nt">ansible.builtin.set_fact</span><span class="p">:</span>
+<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="c1">#</span>
+<span class="c1">#</span>
+<span class="c1"># The examples below assume you have a datacenter named 'my_dc' and a datastore named 'my_datastore'.</span>
+<span class="c1"># Replace these values as needed for your environment.</span>
+<span class="c1">#</span>
+<span class="c1">#</span>
+
+<span class="c1">#</span>
+<span class="c1"># Authentication / Connection Arguments</span>
+<span class="c1">#</span>
+<span class="c1"># You can explicitly set the connection arguments in each lookup. This may be clearer for some use cases</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Pass In Connection Arguments Explicitly</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">>-</span>
+<span class="w"> </span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datastore_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/datastore/my_datastore'</span><span class="o">,</span>
+ <span class="nv">vcenter_hostname</span><span class="o">=</span><span class="s2">"vcenter.test"</span><span class="o">,</span>
+ <span class="nv">vcenter_username</span><span class="o">=</span><span class="s2">"administrator@vsphere.local"</span><span class="o">,</span>
+ <span class="nv">vcenter_password</span><span class="o">=</span><span class="s2">"1234"</span><span class="o">)</span> <span class="cp">}}</span>
+
+<span class="c1"># Alternatively, you can add the connection arguments to a dictionary variable, and then pass that variable to the</span>
+<span class="c1"># lookup plugins. This makes the individual lookup plugin calls simpler</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Example Playbook</span>
+<span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">all</span>
+<span class="w"> </span><span class="nt">vars</span><span class="p">:</span>
<span class="w"> </span><span class="nt">connection_args</span><span class="p">:</span>
-<span class="w"> </span><span class="nt">vcenter_hostname</span><span class="p">:</span><span class="w"> </span><span class="s">"vcenter.test"</span>
-<span class="w"> </span><span class="nt">vcenter_username</span><span class="p">:</span><span class="w"> </span><span class="s">"administrator@vsphere.local"</span>
-<span class="w"> </span><span class="nt">vcenter_password</span><span class="p">:</span><span class="w"> </span><span class="s">"1234"</span>
+<span class="w"> </span><span class="nt">vcenter_hostname</span><span class="p">:</span><span class="w"> </span><span class="s">"vcenter.test"</span>
+<span class="w"> </span><span class="nt">vcenter_username</span><span class="p">:</span><span class="w"> </span><span class="s">"administrator@vsphere.local"</span>
+<span class="w"> </span><span class="nt">vcenter_password</span><span class="p">:</span><span class="w"> </span><span class="s">"1234"</span>
+<span class="w"> </span><span class="nt">tasks</span><span class="p">:</span>
+<span class="w"> </span><span class="c1"># Add more tasks or lookups as needed, referencing the same connection_args variable</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Lookup MoID of the object</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datastore_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/datastore/my_datastore'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datastore_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/host/my_cluster/esxi1.test/ro_datastore'</span><span class="o">,</span> <span class="o">**</span><span class="nv">connection_args</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1"># Finally, you can also leverage the environment variables associated with each connection arg, and avoid passing</span>
+<span class="c1"># extra args to the lookup plugins</span>
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Use a lookup plugin with VMWARE_* environment variables set</span>
+<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">msg</span><span class="p">:</span><span class="w"> </span><span class="s">"</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datastore_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/datastore/my_datastore'</span><span class="o">)</span> <span class="cp">}}</span><span class="s">"</span>
-<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lookup MoID of the object inside the path</span>
-<span class="w"> </span><span class="nt">ansible.builtin.debug</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">msg="</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">'vmware.vmware_rest.datastore_moid'</span><span class="o">,</span> <span class="s1">'/my_dc/datastore/'</span><span class="o">)</span> <span class="cp">}}</span><span class="l l-Scalar l-Scalar-Plain">"</span>
+<span class="c1">#</span>
+<span class="c1"># Datastore Search Path Examples</span>
+<span class="c1">#</span>
+<span class="c1"># Datastores are located under the 'datastore' folder in a datacenter.</span>
+<span class="c1" |
98c0d0c
to
a0ff710
Compare
Build succeeded. ✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 10m 57s |
@alinabuzachis or @felixfontein I dont understand this new documentation build step, can one of you assist with debugging steps or let me know what the error is? |
@mikemorency the errors indicate that there are quite a few bad references in the collection's docs. There are already quite some errors in the BASE build step (which don't make the build fail, since the
It looks like the docuemtantion of the
These errors often indicate that someone used single backticks instead of double backticks.
The above reference a Also, the workflow for |
I didn't check, either. But I agree that it looks like the main branch itself is broken: #508 |
thank you for the explanation! Those all seem unrelated to this change, so im going to go ahead and fix them on a different pr |
a0ff710
to
3c69266
Compare
Build succeeded (gate pipeline). ✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 10m 05s |
618a19d
into
ansible-collections:main
SUMMARY The lookup plugin documentation needs to be updated. Its missing useful examples, inconsistent, and can be vague. These changes should address those issues. ISSUE TYPE Docs Pull Request COMPONENT NAME all lookup plugins (plugins/lookup/*) Reviewed-by: Brian Coca Reviewed-by: mikemorency Reviewed-by: Alina Buzachis (cherry picked from commit 618a19d)
SUMMARY The lookup plugin documentation needs to be updated. Its missing useful examples, inconsistent, and can be vague. These changes should address those issues. ISSUE TYPE Docs Pull Request COMPONENT NAME all lookup plugins (plugins/lookup/*) Reviewed-by: Brian Coca Reviewed-by: mikemorency Reviewed-by: Alina Buzachis
SUMMARY
The lookup plugin documentation needs to be updated. Its missing useful examples, inconsistent, and can be vague. These changes should address those issues.
ISSUE TYPE
COMPONENT NAME
all lookup plugins (plugins/lookup/*)