Created
June 10, 2016 15:08
-
-
Save johnny5th/b3ea91a8d29aa1ae533e9b628859b14d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Check if site is already installed. | |
command: > | |
{{ drush_path }} status bootstrap | |
chdir={{ drupal_core_path }} | |
register: drupal_site_installed | |
failed_when: "drupal_site_installed.stdout is undefined" | |
changed_when: false | |
become: no | |
- name: Import Drupal site with Git. | |
git: | |
repo: "{{ drupal_import_git_url }}" | |
dest: "/tmp/gittemp" | |
when: "'Successful' not in drupal_site_installed.stdout" | |
become: no | |
- name: Copy imported site into Drupal dir | |
command: > | |
cp -a /tmp/gittemp/. {{ drupal_core_path }}/ | |
when: "'Successful' not in drupal_site_installed.stdout" | |
become: no | |
- name: Delete temporary git file | |
file: | |
path: "/tmp/gittemp/" | |
state: absent | |
force: yes | |
when: "'Successful' not in drupal_site_installed.stdout" | |
become: no | |
- name: Copy settings.php template file. | |
template: | |
src: ../templates/settings.php.j2 | |
dest: "{{ drupal_core_path }}/sites/default/settings.php" | |
mode: 0644 | |
when: "'Successful' not in drupal_site_installed.stdout" | |
become: no | |
- name: Import git sql with drush. | |
command: > | |
{{ drush_path }} sql-cli < {{ drupal_core_path }}/{{ drupal_import_git_path }} | |
args: | |
chdir: "{{ drupal_core_path }}" | |
when: "'Successful' not in drupal_site_installed.stdout and {{ drupal_import_git_sql }} == true" | |
- name: Create Drupal Symlink | |
file: | |
src: /var/www/drupal | |
dest: /drupal | |
when: "'Successful' not in drupal_site_installed.stdout" | |
notify: restart webserver | |
become: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment