mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
New module: manage 1&1 public ip (cloud/oneandone/oneandone_public_ip) (#35079)
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider. * Updated OneAndOneResources class and argument specs for monitoring policy and load balancer. * Addressed ansible-test sanity pep8 and validate-modules errors. * Added oneandone_public_ip cloud module for oneandone cloud provider. Removed extra modules to adhere to one module per PR.
This commit is contained in:
parent
248c1e8b9f
commit
3381ff3ac9
2 changed files with 355 additions and 0 deletions
|
@ -192,6 +192,18 @@ def get_vpn(oneandone_conn, vpn, full_object=False):
|
|||
return _vpn['id']
|
||||
|
||||
|
||||
def get_public_ip(oneandone_conn, public_ip, full_object=False):
|
||||
"""
|
||||
Validates that the public ip exists by ID or a name.
|
||||
Returns the public ip if one was found.
|
||||
"""
|
||||
for _public_ip in oneandone_conn.list_public_ips(per_page=1000):
|
||||
if public_ip in (_public_ip['id'], _public_ip['ip']):
|
||||
if full_object:
|
||||
return _public_ip
|
||||
return _public_ip['id']
|
||||
|
||||
|
||||
def wait_for_resource_creation_completion(oneandone_conn,
|
||||
resource_type,
|
||||
resource_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue