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

allow subnet names to be used in os_port instead of subnet ids only #21522

Closed
dev00 opened this issue Feb 16, 2017 · 12 comments
Closed

allow subnet names to be used in os_port instead of subnet ids only #21522

dev00 opened this issue Feb 16, 2017 · 12 comments
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bot_closed cloud collection Related to Ansible Collections work feature This issue/PR relates to a feature request. module This issue/PR relates to a module. openstack support:community This issue/PR relates to code supported by the Ansible community.

Comments

@dev00
Copy link

dev00 commented Feb 16, 2017

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

os_port

ANSIBLE VERSION
ansible 2.2.1.0
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

Right now we can only create instances which will be attached to a specific network. Openstack will then place the instance in the first subnet.
However, when having multiple subnets, you may want to choose in which subnet the instance should be placed.
This can at the moment only be done by creating an openstack port with os_port. os_port will accept only subnet-ids at the moment, which are a little bit messy (because you need to get the id first from the name etc.).
However, the openstack-client already supports creating a port in a subnet and allows the subnet to be chosen by name.

It would be great to take out some restrictions from the os_port module and allow a subnet name or subnet id (this is btw. the default behavior for the network-parameter already) to be supplied instead of allowing an id only.

STEPS TO REPRODUCE
- name: create the port in the needed subnet                                                                                                                                    
  os_port:                                                                                                                                                                      
    state: present                                                                                                                                                              
    fixed_ips:                                                                                                                                                                  
      - subnet: foo                                                                                                                                                          
    network: "first-nw" 
    security_groups: "some_security_group" 
    name: a_port 
EXPECTED RESULTS

That the port would be created.

ACTUAL RESULTS

The step fails and asks for an ID.

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error creating port for network $network_id: Invalid input for fixed_ips. Reason: 'foo' is not a valid UUID.\nNeutron server returns request_ids: ['$neutron_id']"}
@ansibot
Copy link
Contributor

ansibot commented Feb 16, 2017

@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 cloud feature_idea module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. openstack labels Feb 16, 2017
@ansibot ansibot assigned emonty and rcarrillocruz and unassigned emonty Feb 16, 2017
@jctanner jctanner removed the needs_triage Needs a first human triage before being processed. label Feb 17, 2017
@Thingee
Copy link
Contributor

Thingee commented Feb 28, 2017

These just get passed onto the neutron API which supports ip_address and subnet_id. I'm asking on #openstack-neutron irc free node if this can be supported in addition.

@dev00
Copy link
Author

dev00 commented Feb 28, 2017

Maybe we can take a look at the openstack client how it's handled there? I suppose that an additional step where we get all the subnets and filter by name would be a little bit overkill and shift the responsibility too much torwards the module in Ansible, right?

@Thingee
Copy link
Contributor

Thingee commented Mar 1, 2017

@dev00 We pretty much do the name filtering everywhere else in shade. The response I got on #openstack-neutron was to create a new API extension, which makes me very sad.

@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 19, 2017

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansibot
Copy link
Contributor

ansibot commented May 13, 2018

cc @omgjlk
click here for bot help

@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Sep 19, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 5, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 13, 2018

cc @mnaser
click here for bot help

@mnaser
Copy link
Contributor

mnaser commented Oct 13, 2018

This is currently possible with OpenStack, as the OpenStack API supports getting a subnet ID only and it will grab the first available IP then.

https://developer.openstack.org/api-ref/network/v2/#create-port
fixed_ips (Optional): "If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port."

@mnaser
Copy link
Contributor

mnaser commented Oct 13, 2018

needs_contributor

@ansibot ansibot added the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Oct 13, 2018
@ansibot
Copy link
Contributor

ansibot commented Nov 2, 2018

@ansibot
Copy link
Contributor

ansibot commented Apr 7, 2019

cc @gtema
click here for bot help

@ansibot ansibot added the collection Related to Ansible Collections work label Apr 29, 2020
@ansibot ansibot added collection:openstack.cloud needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@ansibot ansibot removed collection:openstack.cloud needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Jul 16, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 25, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this as completed Aug 25, 2020
@ansible ansible locked and limited conversation to collaborators Sep 22, 2020
@sivel sivel removed the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bot_closed cloud collection Related to Ansible Collections work feature This issue/PR relates to a feature request. module This issue/PR relates to a module. openstack support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

8 participants