diff --git a/defaults/main.yml b/defaults/main.yml index a30c8f431b967da884196282bea8e1d737ce8155..a168cbe2691b27ae44f7488e51efce30734879ca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,7 @@ drupal_default_settings: [] drupal_install_drupal: true +drupal_configure_drupal: true +drupal_update_drupal: true drupal_contrib_subdir: '' drupal_settings: - root: '{{ apache_server_default_root }}' diff --git a/tasks/drupal.yml b/tasks/drupal.yml index 9cfb45daffa1547435f60260e560d9bd99f12da9..5add091facca00f491526cf544b0ebfb11e0ebbb 100644 --- a/tasks/drupal.yml +++ b/tasks/drupal.yml @@ -68,7 +68,7 @@ - name: "Drupal | Create the settings.php files" template: - src={{ item.0.version }}_settings.php + src={{ item.0.template_dir|default('') }}{{ item.0.version }}_settings.php dest=/var/www/{{ item.0.root }}/sites/{{ item.1.shortname }}/settings.php owner=www-data group=www-data diff --git a/tasks/install.yml b/tasks/install.yml index 82c47198538400b8256dd80286b988f584ab538f..a157d316f132ef22965f98fbf9421f7c4bd1b202 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -27,7 +27,7 @@ with_items: drupal_settings when: item.root in drupal_missing_repos.stdout_lines -- name: "Drupal | Install and update Drupal trees from SVN" +- name: "Drupal | SVN | Install and update Drupal trees from SVN" subversion: repo={{ item.src.url }} dest=/var/www/{{ item.src.target }} @@ -39,7 +39,7 @@ - "Apache | Change ownership for web server files" - "Apache | Change mode for web server files" -- name: "Drupal | Copy Drush Make files to the server" +- name: "Drupal | Drush | Copy Drush Make files to the server" copy: src={{ inventory_dir }}/files/drush/{{ item.src.makefile }}.make dest=/var/www/drush/{{ item.src.makefile }}.make @@ -49,7 +49,7 @@ with_items: drupal_settings when: item.src.mode == 'drush' -- name: "Drupal | Install and update Drupal trees from Drush Make" +- name: "Drupal | Drush | Install and update Drupal trees from Drush Make" shell: drush make --force-complete '/var/www/drush/{{ item.src.makefile }}.make' . chdir='/var/www/{{ item.root }}' sudo: no with_items: drupal_settings @@ -58,5 +58,21 @@ - "Apache | Change ownership for web server files" - "Apache | Change mode for web server files" +- name: "Drupal | GitScript | Clone repository" + git: + accept_hostkey: "yes" + repo: "{{ item.src.git.repository }}" + dest: "{{ item.src.git.target }}" + force: "yes" + version: "{{ item.src.git.branch|default(omit) }}" + sudo: false + with_items: drupal_settings + when: item.root in drupal_missing_repos.stdout_lines and item.src.mode == 'gitscript' + +- name: "Drupal | GitScript | Run script" + shell: "{{ item.src.git.target }}/{{ item.src.script }}" + with_items: drupal_settings + when: item.root in drupal_missing_repos.stdout_lines and item.src.mode == 'gitscript' + - name: 'Drupal | Change mode for web server root directory' command: chmod 755 /var/www diff --git a/tasks/main.yml b/tasks/main.yml index e3ae28ed77fecba81e51b576cc3e41d99bb77786..84b728b30103a9d40a1501970b7abd1739a5fbde 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,8 +7,8 @@ - name: "Drupal | Configure Drupal" include: drupal.yml - when: drupal_install_drupal + when: drupal_configure_drupal - name: "Drupal | Update Drupal" include: update.yml - when: drupal_install_drupal + when: drupal_update_drupal diff --git a/templates/sites.php b/templates/sites.php index e9634bdbf0d809c589b982eae0610daddecd1a0f..d9d1f656fc265a7dcc4bbecdf1046a5b2b995e44 100644 --- a/templates/sites.php +++ b/templates/sites.php @@ -7,4 +7,13 @@ $sites = array( '{{ alias }}' => '{{ drupaldomain.shortname }}', {% endfor %} {% endfor %} +{% if item.0.sites_extra_domain is defined %} +{% for drupaldomain in item.0.sites_extra_domain %} + '{{ drupaldomain.domain }}' => '{{ drupaldomain.shortname }}', +{% for alias in drupaldomain.aliases %} + '{{ alias }}' => '{{ drupaldomain.shortname }}', +{% endfor %} +{% endfor %} +{% endif %} +//[NEXT] );