From 856e8d704e42859a87806ff4d8c6a9313dcc1ede Mon Sep 17 00:00:00 2001 From: Dan Bohea Date: Wed, 25 May 2016 09:17:43 +0100 Subject: [PATCH 1/3] Setting configure_local_drush_aliases to false now behaves as expected. - Fixes #662 --- provisioning/tasks/drush-aliases.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index 86a5145f3..a9d85a62a 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -33,6 +33,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no + when: configure_local_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -41,3 +42,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" + when: configure_local_drush_aliases From 37cf5eac595d3d54c6b76ae33fe8af6771fdd57c Mon Sep 17 00:00:00 2001 From: Dan Bohea Date: Sat, 4 Jun 2016 14:27:05 +0100 Subject: [PATCH 2/3] configure_local_drush_aliases renamed to configure_drush_aliases - Addresses #662 - Includes shim as this is a breaking change --- docs/extras/drush.md | 2 +- example.config.yml | 2 +- provisioning/tasks/drush-aliases.yml | 16 +++++++++++----- provisioning/templates/dashboard.html.j2 | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/extras/drush.md b/docs/extras/drush.md index 9aabd7cb7..6f3368428 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,7 +35,7 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_drush_aliases` variable in `config.yml` to `false`. ## Using sql-sync diff --git a/example.config.yml b/example.config.yml index 9e5255fa1..45cef2244 100644 --- a/example.config.yml +++ b/example.config.yml @@ -71,7 +71,7 @@ drupalvm_cron_jobs: [] # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. -configure_local_drush_aliases: true +configure_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index a9d85a62a..3021f9180 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,11 +1,17 @@ --- +# TODO: Deprecate legacy variable & remove shim in next major release. +- name: Shim for legacy configure_local_drush_aliases variable. + set_fact: + configure_drush_aliases: "{{ configure_local_drush_aliases }}" + when: configure_local_drush_aliases is defined and configure_drush_aliases is undefined + - name: Check if local Drush configuration folder exists. stat: path: ~/.drush register: local_drush_config_folder delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Create Drush configuration folder if it doesn't exist. file: @@ -13,7 +19,7 @@ state: directory delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false) + when: configure_drush_aliases and (local_drush_config_folder.stat.exists == false) # Note that this doesn't work for Windows, since Ansible's running in the VM. - name: Configure host machine drush aliases. @@ -22,7 +28,7 @@ dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for vagrant user inside VM. file: 'path="~/.drush" state=directory' @@ -33,7 +39,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -42,4 +48,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - when: configure_local_drush_aliases + when: configure_drush_aliases diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 194895896..1f4dafb60 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -41,7 +41,7 @@ {{ servername }} {{ docroot }} - {% if configure_local_drush_aliases %} + {% if configure_drush_aliases %} drush @{{ vagrant_machine_name }}.{{ servername }} {% endif %} @@ -90,7 +90,7 @@ Hostname Document Root - {% if configure_local_drush_aliases -%} + {% if configure_drush_aliases -%} Drush alias* {%- endif %} From 00360526670a068509bbffdd615c20425c0dd33a Mon Sep 17 00:00:00 2001 From: Dan Bohea Date: Sat, 4 Jun 2016 14:27:05 +0100 Subject: [PATCH 3/3] configure_local_drush_aliases renamed to configure_drush_aliases - Addresses #662 - Includes shim as this is a breaking change --- default.config.yml | 2 +- docs/extras/drush.md | 2 +- provisioning/tasks/drush-aliases.yml | 16 +++++++++++----- provisioning/templates/dashboard.html.j2 | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/default.config.yml b/default.config.yml index 6f433612e..4b2e46e05 100644 --- a/default.config.yml +++ b/default.config.yml @@ -71,7 +71,7 @@ drupalvm_cron_jobs: [] # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. -configure_local_drush_aliases: true +configure_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. diff --git a/docs/extras/drush.md b/docs/extras/drush.md index de68518a9..c0b6ab96c 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,7 +35,7 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_drush_aliases` variable in `config.yml` to `false`. ## Using sql-sync diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index a9d85a62a..3021f9180 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,11 +1,17 @@ --- +# TODO: Deprecate legacy variable & remove shim in next major release. +- name: Shim for legacy configure_local_drush_aliases variable. + set_fact: + configure_drush_aliases: "{{ configure_local_drush_aliases }}" + when: configure_local_drush_aliases is defined and configure_drush_aliases is undefined + - name: Check if local Drush configuration folder exists. stat: path: ~/.drush register: local_drush_config_folder delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Create Drush configuration folder if it doesn't exist. file: @@ -13,7 +19,7 @@ state: directory delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false) + when: configure_drush_aliases and (local_drush_config_folder.stat.exists == false) # Note that this doesn't work for Windows, since Ansible's running in the VM. - name: Configure host machine drush aliases. @@ -22,7 +28,7 @@ dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for vagrant user inside VM. file: 'path="~/.drush" state=directory' @@ -33,7 +39,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -42,4 +48,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - when: configure_local_drush_aliases + when: configure_drush_aliases diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 237ffab74..db8e0894a 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -41,7 +41,7 @@ {{ servername }} {{ docroot }} - {% if configure_local_drush_aliases %} + {% if configure_drush_aliases %} drush @{{ vagrant_machine_name }}.{{ servername }} {% endif %} @@ -90,7 +90,7 @@ Hostname Document Root - {% if configure_local_drush_aliases -%} + {% if configure_drush_aliases -%} Drush alias* {%- endif %}