Skip to content
Snippets Groups Projects
Commit 72a1f87c authored by jurgenhaas's avatar jurgenhaas
Browse files

Never use import_task from within an included file

parent 69bfdd61
Branches
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
with_items: '{{ drupal_domain.certs|default([]) }}' with_items: '{{ drupal_domain.certs|default([]) }}'
notify: "Apache | Restart Apache" notify: "Apache | Restart Apache"
- import_tasks: apache_auth.yml - include_tasks: apache_auth.yml
when: drupal_domain.apache_auth is defined when: drupal_domain.apache_auth is defined
tags: 'ApacheConfig' tags: 'ApacheConfig'
--- ---
# file: roles/drupal/tasks/apache_auth.yml # file: roles/drupal/tasks/apache_auth.yml
- name: "Ensure Password Directory" - block:
file:
path='{{ webRoot }}/passwords'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='755'
- name: "Setup AuthType Basic" - name: "Ensure Password Directory"
htpasswd: file:
path='{{ webRoot }}/passwords/{{ drupal_domain.apache_auth.user }}' path='{{ webRoot }}/passwords'
name='{{ drupal_domain.apache_auth.user }}' state='directory'
password='{{ drupal_domain.apache_auth.password }}' owner='{{ apacheUser }}'
owner='{{ apacheUser }}' group='{{ apacheUser }}'
group='{{ apacheUser }}' mode='755'
mode='640'
- name: "Setup AuthType Basic"
htpasswd:
path='{{ webRoot }}/passwords/{{ drupal_domain.apache_auth.user }}'
name='{{ drupal_domain.apache_auth.user }}'
password='{{ drupal_domain.apache_auth.password }}'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='640'
tags: 'ApacheConfig'
--- ---
# file: roles/drupal/tasks/deploy/d8.yml # file: roles/drupal/tasks/deploy/d8.yml
- name: "Ensure extra directories" - block:
file:
path: '{{ drupalRoot }}{{ item }}' - name: "Ensure extra directories"
state: 'directory' file:
with_items: path: '{{ drupalRoot }}{{ item }}'
- '/modules/custom' state: 'directory'
- '/modules/contrib' with_items:
- '/themes/custom' - '/modules/custom'
- '/themes/contrib' - '/modules/contrib'
- '/themes/custom'
- '/themes/contrib'
tags: 'deploy'
--- ---
# file: roles/drupal/tasks/deploy/finalize_d8.yml # file: roles/drupal/tasks/deploy/finalize_d8.yml
- name: "Check for config directory"
stat: path='{{ webRoot }}{{ drupal.configRoot|default("/config") }}'
register: directory
- block:
- name: "Ensure site specific config directory"
file:
path: '{{ webRoot }}{{ drupal.configRoot|default("/config") }}/{{ item.shortname|default("default") }}'
state: 'directory'
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
mode: '775'
with_items: '{{ drupal.domains }}'
when: item.install|default(true)
- name: "Link to site specific config directory"
file:
src: '../../..{{ drupal.configRoot|default("/config") }}/{{ item.shortname|default("default") }}'
path: '{{ drupalRoot }}/sites/{{ item.shortname|default("default") }}/files/{{ item.config|default("config") }}'
state: 'link'
force: yes
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
with_items: '{{ drupal.domains }}'
when: item.install|default(true)
when: directory.stat.exists
- block: - block:
- name: "Ensure config directories" - name: "Check for config directory"
file: stat: path='{{ webRoot }}{{ drupal.configRoot|default("/config") }}'
path: '{{ drupalRoot }}/sites/{{ item.0.shortname|default("default") }}/files/{{ item.0.config|default("config") }}/{{ drupal_config_directories[item.1] }}' register: directory
state: 'directory'
owner: '{{ apacheUser }}' - block:
group: '{{ apacheUser }}'
mode: '775' - name: "Ensure site specific config directory"
with_nested: file:
- '{{ drupal.domains }}' path: '{{ webRoot }}{{ drupal.configRoot|default("/config") }}/{{ item.shortname|default("default") }}'
- '{{ drupal_config_directories }}' state: 'directory'
when: item.0.install|default(true) owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
when: not directory.stat.exists mode: '775'
with_items: '{{ drupal.domains }}'
when: item.install|default(true)
- name: "Link to site specific config directory"
file:
src: '../../..{{ drupal.configRoot|default("/config") }}/{{ item.shortname|default("default") }}'
path: '{{ drupalRoot }}/sites/{{ item.shortname|default("default") }}/files/{{ item.config|default("config") }}'
state: 'link'
force: yes
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
with_items: '{{ drupal.domains }}'
when: item.install|default(true)
when: directory.stat.exists
- block:
- name: "Ensure config directories"
file:
path: '{{ drupalRoot }}/sites/{{ item.0.shortname|default("default") }}/files/{{ item.0.config|default("config") }}/{{ drupal_config_directories[item.1] }}'
state: 'directory'
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
mode: '775'
with_nested:
- '{{ drupal.domains }}'
- '{{ drupal_config_directories }}'
when: item.0.install|default(true)
when: not directory.stat.exists
tags: 'deploy'
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
src='{{ relativeRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}' src='{{ relativeRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}'
dest='{{ drupalRoot }}/sites/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}' dest='{{ drupalRoot }}/sites/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}'
- import_tasks: files_mount.yml - include_tasks: files_mount.yml
when: drupal_domain.0.mountpoint is defined when: drupal_domain.0.mountpoint is defined
- name: "Ensure File Directories" - name: "Ensure File Directories"
......
--- ---
# file: roles/drupal/tasks/files_mount.yml # file: roles/drupal/tasks/files_mount.yml
- name: "Ensure mounted directory" - block:
file:
path='{{ drupal_domain.0.mountpoint }}/{{ drupal.id }}/{{ drupal_domain.0.shortname|default("default") }}'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='755'
- name: "Link webroot to mounted directory" - name: "Ensure mounted directory"
file: file:
src='{{ drupal_domain.0.mountpoint }}/{{ drupal.id }}/{{ drupal_domain.0.shortname|default("default") }}' path='{{ drupal_domain.0.mountpoint }}/{{ drupal.id }}/{{ drupal_domain.0.shortname|default("default") }}'
dest='{{ webRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}' state='directory'
state='link' owner='{{ apacheUser }}'
owner='{{ apacheUser }}' group='{{ apacheUser }}'
group='{{ apacheUser }}' mode='755'
mode='755'
force='yes' - name: "Link webroot to mounted directory"
file:
src='{{ drupal_domain.0.mountpoint }}/{{ drupal.id }}/{{ drupal_domain.0.shortname|default("default") }}'
dest='{{ webRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}'
state='link'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='755'
force='yes'
tags: 'SetPermissions'
...@@ -61,14 +61,14 @@ ...@@ -61,14 +61,14 @@
- include_tasks: install/{{ installSource.mode|default("none") }}.yml - include_tasks: install/{{ installSource.mode|default("none") }}.yml
when: drupal_first_installation when: drupal_first_installation
- import_tasks: install/{{ drupal.version|default("d7") }}.yml - include_tasks: install/{{ drupal.version|default("d7") }}.yml
when: drupal_first_installation when: drupal_first_installation
- include_tasks: deploy/{{ installSource.mode|default("none") }}.yml - include_tasks: deploy/{{ installSource.mode|default("none") }}.yml
when: drupal_install_drupal when: drupal_install_drupal
tags: 'deploy' tags: 'deploy'
- import_tasks: deploy/{{ drupal.version|default("d7") }}.yml - include_tasks: deploy/{{ drupal.version|default("d7") }}.yml
when: drupal_install_drupal when: drupal_install_drupal
tags: 'deploy' tags: 'deploy'
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
tags: 'deploy' tags: 'deploy'
when: drush_version_main|default('8') == '9' when: drush_version_main|default('8') == '9'
- import_tasks: deploy/finalize_{{ drupal.version|default("d7") }}.yml - include_tasks: deploy/finalize_{{ drupal.version|default("d7") }}.yml
when: drupal_install_drupal when: drupal_install_drupal
tags: 'deploy' tags: 'deploy'
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- name: "Extended File Modes and Ownership for Repository" - name: "Extended File Modes and Ownership for Repository"
command: setfacl -dRm u:root:rwX,g:{{ drupal.src.name }}:rwX,o::rX {{ webRoot }}{{ drupal.src.git.target }} command: setfacl -dRm u:root:rwX,g:{{ drupal.src.name }}:rwX,o::rX {{ webRoot }}{{ drupal.src.git.target }}
- import_tasks: gitscript_cron.yml - include_tasks: gitscript_cron.yml
when: drupal.src.cron is defined when: drupal.src.cron is defined
tags: tags:
......
--- ---
# file: roles/drupal/tasks/users/gitscript_cron.yml # file: roles/drupal/tasks/users/gitscript_cron.yml
- name: "Create Update Script" - block:
template:
src='scripts/update/gitscript.jinja2'
dest='{{ webRoot }}/.update'
owner='root'
group='root'
mode='755'
- name: "Crontab for Update Script" - name: "Create Update Script"
cron: template:
name='Drupal Update {{ drupal.src.name }}' src='scripts/update/gitscript.jinja2'
month='{{ drupal.src.cron.month|default(omit) }}' dest='{{ webRoot }}/.update'
day='{{ drupal.src.cron.day|default(omit) }}' owner='root'
weekday='{{ drupal.src.cron.weekday|default(omit) }}' group='root'
hour='{{ drupal.src.cron.hour|default(omit) }}' mode='755'
minute='{{ drupal.src.cron.minute|default(omit) }}'
job='{{ webRoot }}/.update >>{{ webRoot }}/../log/git-update.log 2>&1' - name: "Crontab for Update Script"
user='root' cron:
disabled='{{ crons_disabled|default(false) }}' name='Drupal Update {{ drupal.src.name }}'
month='{{ drupal.src.cron.month|default(omit) }}'
day='{{ drupal.src.cron.day|default(omit) }}'
weekday='{{ drupal.src.cron.weekday|default(omit) }}'
hour='{{ drupal.src.cron.hour|default(omit) }}'
minute='{{ drupal.src.cron.minute|default(omit) }}'
job='{{ webRoot }}/.update >>{{ webRoot }}/../log/git-update.log 2>&1'
user='root'
disabled='{{ crons_disabled|default(false) }}'
tags:
- 'SetPermissions'
- 'cron'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment