Skip to content

Commit

Permalink
Use dashes not underscores for linode labels. (ansible#44719)
Browse files Browse the repository at this point in the history
This is because underscores are illegals in hostnames and users might
want to create the same host names are the name of the Linode machine
(as in the report in ansible#30059).

Closes ansible#30059.
  • Loading branch information
lwm authored and bcoca committed Sep 20, 2018
1 parent 4774ea7 commit 0947948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/linode/linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
name:
description:
- Name to give the instance (alphanumeric, dashes, underscore).
- To keep sanity on the Linode Web Console, name is prepended with C(LinodeID_).
- To keep sanity on the Linode Web Console, name is prepended with C(LinodeID-).
required: true
displaygroup:
description:
Expand Down Expand Up @@ -367,7 +367,7 @@ def linodeServers(module, api, state, name,
PaymentTerm=payment_term)
linode_id = res['LinodeID']
# Update linode Label to match name
api.linode_update(LinodeId=linode_id, Label='%s_%s' % (linode_id, name))
api.linode_update(LinodeId=linode_id, Label='%s-%s' % (linode_id, name))
# Update Linode with Ansible configuration options
api.linode_update(LinodeId=linode_id, LPM_DISPLAYGROUP=displaygroup, WATCHDOG=watchdog, **kwargs)
# Save server
Expand Down

0 comments on commit 0947948

Please sign in to comment.