diff --git a/playbooks/vhost_reboot.yml b/playbooks/vhost_reboot.yml index 40fd487935..3a4a658124 100644 --- a/playbooks/vhost_reboot.yml +++ b/playbooks/vhost_reboot.yml @@ -19,9 +19,10 @@ - name: find instances vars_prompt: - name: target - prompt: What is the target vhost + prompt: What is the target vhost (to reboot) private: false - hosts: "{{ target }}" + # Use a simple regexp to ignore spaces people might accidentally paste. + hosts: "{{ target | regex_search('[-a-z0-9.]+')}}" gather_facts: false user: root diff --git a/playbooks/vhost_update.yml b/playbooks/vhost_update.yml index f45ff59d31..d43a86773b 100644 --- a/playbooks/vhost_update.yml +++ b/playbooks/vhost_update.yml @@ -8,9 +8,10 @@ - name: Find instances vars_prompt: - name: target - prompt: What is the target vhost + prompt: What is the target vhost (to upgrade) private: false - hosts: "{{ target }}" + # Use a simple regexp to ignore spaces people might accidentally paste. + hosts: "{{ target | regex_search('[-a-z0-9.]+')}}" gather_facts: false user: root