|
2 | 2 | # Template playbook for a local Drupal9 codebase. |
3 | 3 | - hosts: {{ project_name }}-web |
4 | 4 | vars: |
5 | | - - project_name: {{ project_name }} |
6 | | - - project_type: drupal8 |
7 | | - - webroot: web |
8 | | - - build_type: local |
9 | | - - _env_type: dev |
| 5 | + project_name: {{ project_name }} |
| 6 | + project_type: drupal8 |
| 7 | + webroot: web |
| 8 | + build_type: local |
| 9 | + _env_type: dev |
10 | 10 | {% raw %} |
11 | | - - _domain_name: www.{{ project_name }}.local |
| 11 | + _domain_name: www.{{ project_name }}.local |
12 | 12 | # Path to your project root. This must match the "volume" set in the docker compose template. |
13 | | - - deploy_path: /home/ce-dev/deploy/live.local |
| 13 | + deploy_path: /home/ce-dev/deploy/live.local |
14 | 14 | # This actually does not take any backup, but is needed to populate settings.php. |
15 | | - - mysql_backup: |
16 | | - handling: none |
17 | | - credentials_handling: static |
| 15 | + mysql_backup: |
| 16 | + handling: none |
| 17 | + credentials_handling: static |
18 | 18 | # A list of Drupal sites (for multisites). |
19 | | - - drupal: |
20 | | - sites: |
21 | | - - folder: "default" |
22 | | - public_files: "sites/default/files" |
23 | | - install_command: "-y si localgov" |
24 | | - # Toggle config import on/off. Disabled for initial passes. |
25 | | - config_import_command: "" |
26 | | - # config_import_command: "cim" |
27 | | - config_sync_directory: "config/sync" |
28 | | - sanitize_command: "sql-sanitize" |
29 | | - # Remove after initial pass, to avoid reinstalling Drupal. |
30 | | - force_install: true |
31 | | - base_url: "https://{{ _domain_name }}" |
| 19 | + drupal: |
| 20 | + sites: |
| 21 | + - folder: "default" |
| 22 | + public_files: "sites/default/files" |
| 23 | + install_command: "-y si localgov" |
| 24 | + # Toggle config import on/off. Disabled for initial passes. |
| 25 | + config_import_command: "" |
| 26 | + # config_import_command: "cim" |
| 27 | + config_sync_directory: "config/sync" |
| 28 | + sanitize_command: "sql-sanitize" |
| 29 | + # Remove after initial pass, to avoid reinstalling Drupal. |
| 30 | + force_install: true |
| 31 | + base_url: "https://{{ _domain_name }}" |
32 | 32 | # Composer command to run. |
33 | | - - composer: |
34 | | - command: install |
35 | | - no_dev: false |
36 | | - working_dir: "{{ deploy_path }}" |
37 | | - apcu_autoloader: false |
| 33 | + composer: |
| 34 | + command: install |
| 35 | + no_dev: false |
| 36 | + working_dir: "{{ deploy_path }}" |
| 37 | + apcu_autoloader: false |
| 38 | + drush: |
| 39 | + use_vendor: true |
| 40 | + drush_bin: "{{ deploy_path }}/vendor/drush/drush/drush" |
38 | 41 | pre_tasks: |
39 | 42 | # You can safely remove these steps once you have a working composer.json. |
40 | 43 | - name: Download composer file. |
41 | 44 | ansible.builtin.get_url: |
42 | | - url: https://raw.githubusercontent.com/drupal/recommended-project/9.1.x/composer.json |
| 45 | + url: https://raw.githubusercontent.com/drupal/recommended-project/10.3.x/composer.json |
43 | 46 | dest: "{{ deploy_path }}/composer.json" |
44 | 47 | force: false |
45 | 48 | - name: Adding composer/installers plugin to composer config. |
|
70 | 73 | - name: Install drush. |
71 | 74 | community.general.composer: |
72 | 75 | command: require |
73 | | - arguments: drush/drush:10.* |
| 76 | + arguments: drush/drush:12.* |
74 | 77 | working_dir: "{{ deploy_path }}" |
75 | 78 | - name: Install localgov. |
76 | 79 | community.general.composer: |
77 | 80 | command: require |
78 | 81 | arguments: localgovdrupal/localgov |
79 | 82 | working_dir: "{{ deploy_path }}" |
| 83 | + post_tasks: |
| 84 | + - name: "Symlink global Drush" |
| 85 | + ansible.builtin.file: |
| 86 | + src: "{{ drush_bin }}" |
| 87 | + dest: "/usr/local/bin/drush" |
| 88 | + state: link |
| 89 | + become: yes |
80 | 90 | roles: |
81 | 91 | - _init # Sets some variables the deploy scripts rely on. |
82 | 92 | - composer # Composer install step. |
|
0 commit comments