From 11aa71e82718683b7008a6254fbd2a170b143a27 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 23 Aug 2018 14:10:17 -0400 Subject: [PATCH] Correct underscore replacement --- provisioning/pre-tasks/00-name_by_path.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/provisioning/pre-tasks/00-name_by_path.yml b/provisioning/pre-tasks/00-name_by_path.yml index d7ad056..d44b13a 100644 --- a/provisioning/pre-tasks/00-name_by_path.yml +++ b/provisioning/pre-tasks/00-name_by_path.yml @@ -7,9 +7,13 @@ delegate_to: localhost become: false +- name: remove underscores from folder name + set_fact: + proj_root_safe: "{{ proj_root.stdout|basename|replace('_','-') }}" + # These values are NOT honored by Vagrant, but are still necessary for DrupalVM # See also provisioning/box/config - name: set vagrant hostname according to the project folder set_fact: - vagrant_hostname: "{{ proj_root.stdout|replace("_", "-")|basename }}.local" - vagrant_machine_name: "{{ proj_root.stdout|replace("_", "-")|basename }}-coop-vm" + vagrant_hostname: "{{ proj_root_safe }}.local" + vagrant_machine_name: "{{ proj_root_safe }}-coop-vm"