From 78235a052dd7ae25b5dc029361b4b3f01ed322d2 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Wed, 29 Aug 2018 15:47:06 -0400 Subject: [PATCH 1/3] Support spaces in project folder name --- provisioning/box/drutopiavm.rb | 2 +- provisioning/box/pre-tasks/00-name_by_path.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/provisioning/box/drutopiavm.rb b/provisioning/box/drutopiavm.rb index d9423d3..a12e94b 100644 --- a/provisioning/box/drutopiavm.rb +++ b/provisioning/box/drutopiavm.rb @@ -1,6 +1,6 @@ def set_overrides_per_project(config) # Acquire a hostname from the project root - project_dir_name = File.basename(ENV['DRUPALVM_PROJECT_ROOT']).gsub("_", "-") + project_dir_name = File.basename(ENV['DRUPALVM_PROJECT_ROOT']).gsub("_", "-").gsub(" ", "-") host_name = "#{project_dir_name}.test" # Override all vconfig values with the new names diff --git a/provisioning/box/pre-tasks/00-name_by_path.yml b/provisioning/box/pre-tasks/00-name_by_path.yml index b1b8cb1..628031a 100644 --- a/provisioning/box/pre-tasks/00-name_by_path.yml +++ b/provisioning/box/pre-tasks/00-name_by_path.yml @@ -7,9 +7,9 @@ delegate_to: localhost become: false -- name: remove underscores from folder name +- name: remove spaces and underscores from folder name set_fact: - proj_root_safe: "{{ proj_root.stdout|basename|replace('_','-') }}" + proj_root_safe: "{{ proj_root.stdout|basename|replace('_','-')|replace(' ','-') }}" # These values are NOT honored by Vagrant, but are still necessary for DrupalVM # See also provisioning/box/config From 999af488890cc471df8ff7b1a42c25acab6503b1 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Wed, 29 Aug 2018 15:47:20 -0400 Subject: [PATCH 2/3] Ensure all setting files and folder are writable --- provisioning/box/post-tasks/10-drupal.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/provisioning/box/post-tasks/10-drupal.yml b/provisioning/box/post-tasks/10-drupal.yml index c3625a7..20dea6c 100644 --- a/provisioning/box/post-tasks/10-drupal.yml +++ b/provisioning/box/post-tasks/10-drupal.yml @@ -1,27 +1,31 @@ --- -- name: determine status of settings location - stat: - path: "{{ drupal_core_path }}/sites/default" - register: stat_result +- name: determine status of settings directory and files + find: + paths: "{{ drupal_core_path }}/sites/default/" + recurse: no + register: find_result -- name: ensure settings location is writable +- name: ensure settings directory is writable file: path: "{{ drupal_core_path }}/sites/default" mode: 0775 state: directory owner: vagrant group: vagrant - when: stat_result.stat.exists == true and stat_result.stat.writeable == false + when: find_result.failed == false become: yes -- name: ensure settings file is still writable +- name: ensure setting files are writable file: - path: "{{ drupal_core_path }}/sites/default/settings.php" + path: "{{ setting_file.path }}" mode: 0664 state: file owner: vagrant group: vagrant - when: stat_result.stat.exists == true and stat_result.stat.writeable == false + when: find_result.failed == false + loop: "{{ find_result.files }}" + loop_control: + loop_var: setting_file become: yes - name: Run composer install. From b35d15fa2663bf44e3b2a61852388536d5f584ae Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Mon, 3 Sep 2018 12:42:01 -0400 Subject: [PATCH 3/3] Remove group assignment from settings locations --- provisioning/box/post-tasks/10-drupal.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/provisioning/box/post-tasks/10-drupal.yml b/provisioning/box/post-tasks/10-drupal.yml index 20dea6c..a934b1d 100644 --- a/provisioning/box/post-tasks/10-drupal.yml +++ b/provisioning/box/post-tasks/10-drupal.yml @@ -10,8 +10,6 @@ path: "{{ drupal_core_path }}/sites/default" mode: 0775 state: directory - owner: vagrant - group: vagrant when: find_result.failed == false become: yes @@ -20,8 +18,6 @@ path: "{{ setting_file.path }}" mode: 0664 state: file - owner: vagrant - group: vagrant when: find_result.failed == false loop: "{{ find_result.files }}" loop_control: