Skip to content
Snippets Groups Projects
Commit 45f16f82 authored by jurgenhaas's avatar jurgenhaas
Browse files

Improve roles drupal and drush

parent aff5f99c
No related branches found
No related tags found
No related merge requests found
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 }}'
......
......@@ -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
......
......@@ -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
......@@ -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
......@@ -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]
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment