Add regexp to drop spaces from hostnames in prompts, for add_host.
Signed-off-by: James Antill <james@and.org>
This commit is contained in:
parent
aa5691d1b5
commit
f74cd17a23
2 changed files with 4 additions and 2 deletions
|
@ -40,7 +40,8 @@
|
|||
with_items: "{{ vmlist.list_vms }}"
|
||||
|
||||
- name: add the vmhost to target group
|
||||
local_action: add_host hostname={{ target }} groupname=target
|
||||
# Use a simple regexp to ignore spaces people might accidentally paste.
|
||||
local_action: add_host hostname={{ target | regex_search('[-a-z0-9.]+') }} groupname=target
|
||||
|
||||
# Call out to another playbook. Disable any proxies that may live here
|
||||
- name: update proxy dns if needed
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
with_items: '{{vmlist.list_vms}}'
|
||||
|
||||
- name: Add the vmhost to target group
|
||||
local_action: add_host hostname={{ target }} groupname=target
|
||||
# Use a simple regexp to ignore spaces people might accidentally paste.
|
||||
local_action: add_host hostname={{ target | regex_search('[-a-z0-9.]+') }} groupname=target
|
||||
|
||||
# Call out to another playbook. Disable any proxies that may live here
|
||||
# - include_playbook: update-proxy-dns.yml status=disable proxies=myvms_new:&proxies
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue