mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
packet_device - add tags parameter (#418)
This commit is contained in:
parent
5cfb9b2807
commit
317532f8bd
2 changed files with 13 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- packet_device - add ``tags`` parameter on device creation (https://github.com/ansible-collections/community.general/pull/418)
|
|
@ -46,6 +46,13 @@ options:
|
||||||
description:
|
description:
|
||||||
- List of device IDs on which to operate.
|
- List of device IDs on which to operate.
|
||||||
|
|
||||||
|
tags:
|
||||||
|
description:
|
||||||
|
- List of device tags.
|
||||||
|
- Currently implemented only for device creation.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
facility:
|
facility:
|
||||||
description:
|
description:
|
||||||
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
|
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
|
||||||
|
@ -137,6 +144,7 @@ EXAMPLES = '''
|
||||||
- packet_device:
|
- packet_device:
|
||||||
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
|
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
|
||||||
hostnames: myserver
|
hostnames: myserver
|
||||||
|
tags: ci-xyz
|
||||||
operating_system: ubuntu_16_04
|
operating_system: ubuntu_16_04
|
||||||
plan: baremetal_0
|
plan: baremetal_0
|
||||||
facility: sjc1
|
facility: sjc1
|
||||||
|
@ -432,6 +440,7 @@ def create_single_device(module, packet_conn, hostname):
|
||||||
% param)
|
% param)
|
||||||
project_id = module.params.get('project_id')
|
project_id = module.params.get('project_id')
|
||||||
plan = module.params.get('plan')
|
plan = module.params.get('plan')
|
||||||
|
tags = module.params.get('tags')
|
||||||
user_data = module.params.get('user_data')
|
user_data = module.params.get('user_data')
|
||||||
facility = module.params.get('facility')
|
facility = module.params.get('facility')
|
||||||
operating_system = module.params.get('operating_system')
|
operating_system = module.params.get('operating_system')
|
||||||
|
@ -446,6 +455,7 @@ def create_single_device(module, packet_conn, hostname):
|
||||||
device = packet_conn.create_device(
|
device = packet_conn.create_device(
|
||||||
project_id=project_id,
|
project_id=project_id,
|
||||||
hostname=hostname,
|
hostname=hostname,
|
||||||
|
tags=tags,
|
||||||
plan=plan,
|
plan=plan,
|
||||||
facility=facility,
|
facility=facility,
|
||||||
operating_system=operating_system,
|
operating_system=operating_system,
|
||||||
|
@ -594,6 +604,7 @@ def main():
|
||||||
facility=dict(),
|
facility=dict(),
|
||||||
features=dict(type='dict'),
|
features=dict(type='dict'),
|
||||||
hostnames=dict(type='list', aliases=['name']),
|
hostnames=dict(type='list', aliases=['name']),
|
||||||
|
tags=dict(type='list', elements='str'),
|
||||||
locked=dict(type='bool', default=False, aliases=['lock']),
|
locked=dict(type='bool', default=False, aliases=['lock']),
|
||||||
operating_system=dict(),
|
operating_system=dict(),
|
||||||
plan=dict(),
|
plan=dict(),
|
||||||
|
|
Loading…
Reference in a new issue