<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alextricity25/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alextricity25">@alextricity25</a> on 2016-04-08T15:37:25Z</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">os_router</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.1.0
  config file = /root/setup-infra/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.0.1.0
  config file = /root/setup-infra/ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">No changes made to ansible.cfg</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">I'm running Ubuntu 14.04, but this module is not platform-specific I don't think.</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">os_router can't take in a port ID as an internal interface, only a subnet. See:<br>
<a href="https://github.com/ansible/ansible-modules-core/blob/devel/cloud/openstack/os_router.py#L321">https://github.com/ansible/ansible-modules-core/blob/devel/cloud/openstack/os_router.py#L321</a></p>
<p dir="auto">The neutron CLI allows you to specify a port ID as an interface, and therefore allow you to specify an arbitrary IP for that interface. It would be nice if the Ansible os_router module would allow you to do that.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">This added feature would allow you to do something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Create port for my_net
  os_port:
    state: present
    name: &quot;my_net_port&quot;
    network: &quot;my_net&quot;
    fixed_ips:
      - ip_address: &quot;192.168.100.50&quot;
  register: my_net_port_results

- name: Create my router
  os_router:
    name: my_router
    state: present
    network: &quot;ext-net&quot;
    interfaces: 
      - port: &quot;{{ my_net_port_results.id }}&quot;
      - &quot;some_other_priv_subnet&quot;"><pre class="notranslate"><code class="notranslate">- name: Create port for my_net
  os_port:
    state: present
    name: "my_net_port"
    network: "my_net"
    fixed_ips:
      - ip_address: "192.168.100.50"
  register: my_net_port_results

- name: Create my router
  os_router:
    name: my_router
    state: present
    network: "ext-net"
    interfaces: 
      - port: "{{ my_net_port_results.id }}"
      - "some_other_priv_subnet"
</code></pre></div>
<p dir="auto">This would allow the user to specify either a subnet or a port for a router internal interface.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">The router would have two interfaces with the example playbook shown above. It would have the default gateway of "some_other_priv_subnet", and it would have the ip assigned to "my_net_port".<br>
This would allow subnets to be attached to multiple routers, which currently isn't do-able through the os_router module.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">TBD</p>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="146962583" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/3390" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/3390/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/3390">ansible/ansible-modules-core#3390</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">ansible-galaxy</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">Future</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Local roles may depend on galaxy roles defined in <code class="notranslate">meta/main.yml</code>. <code class="notranslate">ansible-galaxy install -r</code> does not support this file format, although the value of the <code class="notranslate">dependencies</code> key appears to match that in a <code class="notranslate">requirements.yml</code> file</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat meta/main.yml

galaxy_info:
  author: ome-devel@lists.openmicroscopy.org.uk
dependencies:
- role: openmicroscopy.basedeps"><pre class="notranslate"><code class="notranslate">$ cat meta/main.yml

galaxy_info:
  author: ome-devel@lists.openmicroscopy.org.uk
dependencies:
- role: openmicroscopy.basedeps
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible-galaxy install -r meta/main.yml`

- downloading role 'dependencies', owned by 
 [WARNING]: - dependencies was NOT installed successfully: Role has no field
named u'owner'

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list."><pre class="notranslate"><code class="notranslate">$ ansible-galaxy install -r meta/main.yml`

- downloading role 'dependencies', owned by 
 [WARNING]: - dependencies was NOT installed successfully: Role has no field
named u'owner'

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
</code></pre></div>
<p dir="auto">Proposed behaviour: Install all roles listed in the <code class="notranslate">dependencies</code> section of <code class="notranslate">meta/main.yml</code>, in this case <code class="notranslate">openmicroscopy.basedeps</code></p>
<h5 dir="auto">BACKGROUND</h5>
<ul dir="auto">
<li><a href="https://github.com/metacloud/molecule/pull/717#issuecomment-273455237" data-hovercard-type="pull_request" data-hovercard-url="/ansible-community/molecule/pull/717/hovercard">Galaxy dependencies file can be the role meta file</a><br>
This is the original motivation for this feature suggestion. When using <a href="https://github.com/metacloud/molecule">molecule</a> for testing Ansible roles dependencies need to be in a requirements file. If this is a deliberate design decision it would be useful if the docs could be updated with an official description of the <code class="notranslate">meta/main.yml</code> file.</li>
<li><a href="https://github.com/ansible/ansible/issues/12927" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/12927/hovercard">Add ability to automatically download roles when running play</a><br>
This is a closely related feature request.</li>
</ul>