Skip to content

Commit

Permalink
packet_device - add tags parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
akiselev1 committed May 28, 2020
1 parent b5459d6 commit 26a5bcc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- packet_device - add ``tags`` parameter on device creation (https://github.com/ansible-collections/community.general/pull/418)
11 changes: 11 additions & 0 deletions plugins/modules/cloud/packet/packet_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
description:
- 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:
description:
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
Expand Down Expand Up @@ -137,6 +144,7 @@
- packet_device:
project_id: 89b497ee-5afc-420a-8fb5-56984898f4df
hostnames: myserver
tags: ci-xyz
operating_system: ubuntu_16_04
plan: baremetal_0
facility: sjc1
Expand Down Expand Up @@ -432,6 +440,7 @@ def create_single_device(module, packet_conn, hostname):
% param)
project_id = module.params.get('project_id')
plan = module.params.get('plan')
tags = module.params.get('tags')
user_data = module.params.get('user_data')
facility = module.params.get('facility')
operating_system = module.params.get('operating_system')
Expand All @@ -446,6 +455,7 @@ def create_single_device(module, packet_conn, hostname):
device = packet_conn.create_device(
project_id=project_id,
hostname=hostname,
tags=tags,
plan=plan,
facility=facility,
operating_system=operating_system,
Expand Down Expand Up @@ -594,6 +604,7 @@ def main():
facility=dict(),
features=dict(type='dict'),
hostnames=dict(type='list', aliases=['name']),
tags=dict(type='list', elements='str'),
locked=dict(type='bool', default=False, aliases=['lock']),
operating_system=dict(),
plan=dict(),
Expand Down

0 comments on commit 26a5bcc

Please sign in to comment.