From 0947948d6b70c0f40fbb9fe0c3a7511b5aefc67c Mon Sep 17 00:00:00 2001 From: lwm Date: Thu, 20 Sep 2018 21:42:45 +0200 Subject: [PATCH] Use dashes not underscores for linode labels. (#44719) 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 #30059). Closes https://github.com/ansible/ansible/issues/30059. --- lib/ansible/modules/cloud/linode/linode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/linode/linode.py b/lib/ansible/modules/cloud/linode/linode.py index 848693cf508..59773bee8c4 100644 --- a/lib/ansible/modules/cloud/linode/linode.py +++ b/lib/ansible/modules/cloud/linode/linode.py @@ -29,7 +29,7 @@ options: 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: @@ -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