<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/amenonsen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/amenonsen">@amenonsen</a> on 2016-05-07T16:06:34Z</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ec2_vpc_net</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0 (devel 56ba10365c) last updated 2016/05/05 17:12:03 (GMT +550)"><pre class="notranslate"><code class="notranslate">ansible 2.2.0 (devel 56ba10365c) last updated 2016/05/05 17:12:03 (GMT +550)
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">Default</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">ec2_vpc_net always sets "changed" when state=present, because the code calls update_vpc_tags() and sets changed if <code class="notranslate">tags is not None or name is not None</code>, regardless of whether the vpc exists or not. So if you specify name and cidr_block, the tags are always updated.</p>
<p dir="auto">cc: @defionscode</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- ec2_vpc_net:
    state: present
    name: ExampleVPC
    cidr_block: 192.0.2.0/24
  register: vpc
- fail: msg=&quot;I created a VPC&quot;
  when: vpc.changed"><pre class="notranslate"><code class="notranslate">- ec2_vpc_net:
    state: present
    name: ExampleVPC
    cidr_block: 192.0.2.0/24
  register: vpc
- fail: msg="I created a VPC"
  when: vpc.changed
</code></pre></div>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="153602255" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/3613" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/3613/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/3613">ansible/ansible-modules-core#3613</a></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">Azure Cloud Module<br>
Azure inventory script</p>
<p dir="auto">We have a discussion <a href="https://github.com/ansible/ansible/pull/23494" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible/pull/23494/hovercard">in this PR</a> about authentication and routing to the correct endpoints for the Azure modules, considering Public Azure / Gov / German / China and even Azure Stack. I wanted to open an issue about the step after: ApiVersion and profile.</p>
<p dir="auto">REST API are versioned on Azure (usually it's a date, but it's not required). There is no default ApiVersion at the REST API level, but the SDK uses the <strong>latest on public Azure</strong> transparently (but you can define it). This raises a few issues when we talk about "not public Azure":</p>
<ul dir="auto">
<li>The latest on public Azure might be not available on Gov / German / China yet (<a href="https://github.com/Azure/azure-sdk-for-python/issues/1023" data-hovercard-type="issue" data-hovercard-url="/Azure/azure-sdk-for-python/issues/1023/hovercard">example</a>)</li>
<li>There is definitely no way that Azure Stack supports the latest on Public Azure</li>
<li>ApiVersion are not always backward compatible (Storage Mgmt 2016-06-01 is breaking for instance). This means SDK code is different and not backward compatible.</li>
<li>New ApiVersion brings new options, that were not available before.</li>
</ul>
<p dir="auto">It makes support for several clouds at the same time a strategy question. This is some example of strategy, and it's not exhaustive:</p>
<ul dir="auto">
<li>
<p dir="auto">Put the apiversion in the plugin name (for instance azure_rm_deployment_2017_06_01). The set of options of this plugin is fixed, but this increases the number of modules and is not "public azure friendly". You can ensure that using this plugin will never break, whatever the new ApiVersion released.</p>
</li>
<li>
<p dir="auto">Make one plugin with conditional code "if/else apiversion". This makes parameters more complex (with test like <code class="notranslate">if api_version==xxx and new_option: raise InvalidOptionForThisApiVersion()</code>). "public azure" is automatic, but your Ansible script might break if there is a new ApiVersion released, and the plugin should have a "api_version" parameter to fix it.</p>
</li>
</ul>
<p dir="auto">A few facts to help to discuss:</p>
<ul dir="auto">
<li>SDK packages supports multiple ApiVersion. I ensure you that anytime if an ApiVersion was supported, the code is still here. So if you fix an ApiVersion, you can update safely the Python package (using semver) your ApiVersion is still there.</li>
<li>We are adding the notion of "Profile", roughly a dictionary of available ApiVersion for a given endpoint. So discussion about discovery is not the main point here I think.</li>
</ul>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nitzmahone/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nitzmahone">@nitzmahone</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/johanste/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/johanste">@johanste</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tstringer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tstringer">@tstringer</a></p>