Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit bb742e3

Browse files
committed
Merge pull request #663 from danbohea/662
Setting configure_local_drush_aliases to false now behaves as expected.
2 parents f76446f + d33cb4d commit bb742e3

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

default.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ drupalvm_cron_jobs: []
7171

7272
# Drupal VM automatically creates a drush alias file in your ~/.drush folder if
7373
# this variable is 'true'.
74-
configure_local_drush_aliases: true
74+
configure_drush_aliases: true
7575

7676
# Apache VirtualHosts. Add one for each site you are running inside the VM. For
7777
# multisite deployments, you can point multiple servernames at one documentroot.

docs/extras/drush.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $ drush @drupalvm.dev status
3535

3636
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.
3737

38-
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`.
38+
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`.
3939

4040
## Using sql-sync
4141

provisioning/tasks/drush-aliases.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
---
2+
# TODO: Deprecate legacy variable & remove shim in next major release.
3+
- name: Shim for legacy configure_local_drush_aliases variable.
4+
set_fact:
5+
configure_drush_aliases: "{{ configure_local_drush_aliases }}"
6+
when: configure_local_drush_aliases is defined and configure_drush_aliases is undefined
7+
28
- name: Check if local Drush configuration folder exists.
39
stat:
410
path: ~/.drush
511
register: local_drush_config_folder
612
delegate_to: 127.0.0.1
713
become: no
8-
when: configure_local_drush_aliases
14+
when: configure_drush_aliases
915

1016
- name: Create Drush configuration folder if it doesn't exist.
1117
file:
1218
path: ~/.drush
1319
state: directory
1420
delegate_to: 127.0.0.1
1521
become: no
16-
when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false)
22+
when: configure_drush_aliases and (local_drush_config_folder.stat.exists == false)
1723

1824
# Note that this doesn't work for Windows, since Ansible's running in the VM.
1925
- name: Configure host machine drush aliases.
@@ -22,7 +28,7 @@
2228
dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php"
2329
delegate_to: 127.0.0.1
2430
become: no
25-
when: configure_local_drush_aliases
31+
when: configure_drush_aliases
2632

2733
- name: Ensure drush directory exists for vagrant user inside VM.
2834
file: 'path="~/.drush" state=directory'
@@ -33,6 +39,7 @@
3339
src: ../templates/drupalvm-local.aliases.drushrc.php.j2
3440
dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php"
3541
become: no
42+
when: configure_drush_aliases
3643

3744
- name: Ensure drush directory exists for root user inside VM.
3845
file: 'path="~/.drush" state=directory'
@@ -41,3 +48,4 @@
4148
template:
4249
src: ../templates/drupalvm-local.aliases.drushrc.php.j2
4350
dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php"
51+
when: configure_drush_aliases

provisioning/templates/dashboard.html.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<tr>
4242
<td><a href="http://{{ servername }}">{{ servername }}</a></td>
4343
<td><code>{{ docroot }}</code></td>
44-
{% if configure_local_drush_aliases %}
44+
{% if configure_drush_aliases %}
4545
<td><code>drush @{{ vagrant_machine_name }}.{{ servername }}</code></td>
4646
{% endif %}
4747
</tr>
@@ -90,7 +90,7 @@
9090
<tr>
9191
<th>Hostname</th>
9292
<th>Document Root</th>
93-
{% if configure_local_drush_aliases -%}
93+
{% if configure_drush_aliases -%}
9494
<th>Drush alias*</th>
9595
{%- endif %}
9696
</thead>

0 commit comments

Comments
 (0)