Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
drupal
Commits
188ed74c
Commit
188ed74c
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Add support for files root not being outside Drupal root, mainly required for D7 sites
parent
e2cdeace
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/files.yml
+5
-2
5 additions, 2 deletions
tasks/files.yml
tasks/files_mount.yml
+1
-1
1 addition, 1 deletion
tasks/files_mount.yml
tasks/install.yml
+25
-14
25 additions, 14 deletions
tasks/install.yml
with
31 additions
and
17 deletions
tasks/files.yml
+
5
−
2
View file @
188ed74c
...
...
@@ -5,7 +5,7 @@
-
name
:
Set facts
set_fact
:
dir
:
'
{{
web
Root
}}/
files/
{{
drupal_domain.0.shortname|default("default")
}}/{{
drupal_domain.1
}}'
dir
:
'
{{
files
Root
}}/{{
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
}}'
...
...
@@ -20,15 +20,17 @@
group
:
'
{{
apacheUser
}}'
mode
:
0755
ignore_errors
:
yes
when
:
drupal.files_outside_root|default(true)
-
name
:
Check the status of the File Directory
stat
:
path
:
'
{{
dest
}}'
register
:
directory
when
:
drupal.files_outside_root|default(true)
-
name
:
Move existing File Directory
shell
:
rm -rf {{ dir }} && mv {{ dest }} {{ dir }}
when
:
directory.stat.exists and directory.stat.isdir
when
:
drupal.files_outside_root|default(true) and
directory.stat.exists and directory.stat.isdir
-
name
:
Link Site Directory to File Directory
file
:
...
...
@@ -38,6 +40,7 @@
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
0755
when
:
drupal.files_outside_root|default(true)
-
name
:
Ensure .htaccess
template
:
...
...
This diff is collapsed.
Click to expand it.
tasks/files_mount.yml
+
1
−
1
View file @
188ed74c
...
...
@@ -14,7 +14,7 @@
-
name
:
Link webroot to mounted directory
file
:
src
:
'
{{
drupal_domain.0.mountpoint
}}/{{
drupal.id
}}/{{
drupal_domain.0.shortname|default("default")
}}'
dest
:
'
{{
web
Root
}}/
files/
{{
drupal_domain.0.shortname|default("default")
}}'
dest
:
'
{{
files
Root
}}/{{
drupal_domain.0.shortname|default("default")
}}'
state
:
link
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
...
...
This diff is collapsed.
Click to expand it.
tasks/install.yml
+
25
−
14
View file @
188ed74c
...
...
@@ -26,6 +26,17 @@
relativeRoot
:
'
{{
drupal.relativeRoot|default(drupal_links_relative_root)
}}'
drupalRoot
:
'
{{
webRoot
}}{{
drupal.root|default("")
}}'
docRoot
:
'
{{
webRoot
}}{{
drupal.docroot|default(drupal.root|default(""))
}}'
-
name
:
Set files facts
set_fact
:
configRoot
:
'
{{
webRoot
}}/config'
filesRoot
:
'
{{
webRoot
}}/files'
settingsRoot
:
'
{{
webRoot
}}/settings'
-
name
:
Set files facts when files not outside root
set_fact
:
configRoot
:
'
{{
drupalRoot
}}/sites'
filesRoot
:
'
{{
drupalRoot
}}/sites'
settingsRoot
:
'
{{
drupalRoot
}}/sites'
when
:
not drupal.files_outside_root|default(true)
tags
:
-
always
...
...
@@ -143,7 +154,7 @@
-
name
:
Ensure Files Directory
file
:
path
:
'
{{
web
Root
}}
/files
'
path
:
'
{{
files
Root
}}'
state
:
directory
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
...
...
@@ -180,7 +191,7 @@
-
name
:
Create the settings.php files
template
:
src
:
'
{{
drupal.template_dir|default("")
}}{{
drupal.version|default("d7")
}}_settings.php.jinja2'
dest
:
'
{{
webRoot
}}/
settings/{{
item.shortname|default("default")
}}/settings.php'
dest
:
'
{{
settings
Root
}}
/{{
item.shortname|default("default")
}}/settings.php'
backup
:
yes
with_items
:
'
{{
drupal.domains
}}'
tags
:
...
...
@@ -190,7 +201,7 @@
-
name
:
Add deploy info to settings.local.php files
lineinfile
:
path
:
'
{{
webRoot
}}/
settings/{{
item.0.shortname|default("default")
}}/settings.local.php'
path
:
'
{{
settings
Root
}}
/{{
item.0.shortname|default("default")
}}/settings.local.php'
create
:
yes
regex
:
'
{{
item.1.regex
}}'
line
:
'
{{
item.1.line
}}'
...
...
@@ -219,14 +230,14 @@
state
:
link
force
:
yes
with_items
:
'
{{
drupal.domains
}}'
when
:
item.install|default(true)
when
:
drupal.files_outside_root|default(true) and
item.install|default(true)
-
block
:
-
name
:
Create the drush.yml files
template
:
src
:
drush-9.yml.jinja2
dest
:
'
{{
webRoot
}}/
settings/{{
item.shortname|default("default")
}}/drush.yml'
dest
:
'
{{
settings
Root
}}
/{{
item.shortname|default("default")
}}/drush.yml'
with_items
:
'
{{
drupal.domains
}}'
when
:
item.install|default(true)
...
...
@@ -237,7 +248,7 @@
state
:
link
force
:
yes
with_items
:
'
{{
drupal.domains
}}'
when
:
item.install|default(true)
when
:
drupal.files_outside_root|default(true) and
item.install|default(true)
tags
:
-
deploy
...
...
@@ -259,9 +270,9 @@
follow
:
no
with_items
:
-
'
{{
docRoot
}}'
-
'
{{
web
Root
}}
/config
'
-
'
{{
web
Root
}}
/files
'
-
'
{{
webRoot
}}/
settings'
-
'
{{
config
Root
}}'
-
'
{{
files
Root
}}'
-
'
{{
settings
Root
}}
'
tags
:
-
deploy
-
SetPermissions
...
...
@@ -275,8 +286,8 @@
recurse
:
yes
follow
:
no
with_items
:
-
'
{{
web
Root
}}
/config
'
-
'
{{
web
Root
}}
/files
'
-
'
{{
config
Root
}}'
-
'
{{
files
Root
}}'
tags
:
-
deploy
-
SetPermissions
...
...
@@ -315,14 +326,14 @@
when
:
item.0.install|default(true)
-
name
:
Set Extended Default Permissions
command
:
'
setfacl
-dRm
u:{{
apacheUser
}}:rwX,g:{{
apacheUser
}}:rwX,o::rX
{{
web
Root
}}
/files
'
command
:
'
setfacl
-dRm
u:{{
apacheUser
}}:rwX,g:{{
apacheUser
}}:rwX,o::rX
{{
files
Root
}}'
tags
:
-
deploy
-
SetPermissions
when
:
drupal.install_extra_dirs|default(true)
-
name
:
Set Extended Permissions
command
:
'
setfacl
-Rm
u:{{
apacheUser
}}:rwX,g:{{
apacheUser
}}:rwX,o::rX
{{
web
Root
}}
/files
'
command
:
'
setfacl
-Rm
u:{{
apacheUser
}}:rwX,g:{{
apacheUser
}}:rwX,o::rX
{{
files
Root
}}'
tags
:
-
deploy
-
SetPermissions
...
...
@@ -330,7 +341,7 @@
-
name
:
Make htaccess read-only
file
:
path
:
'
{{
web
Root
}}/
files/
{{
drupal_domain.0.shortname|default("default")
}}/{{
drupal_domain.1
}}/.htaccess'
path
:
'
{{
files
Root
}}/{{
drupal_domain.0.shortname|default("default")
}}/{{
drupal_domain.1
}}/.htaccess'
mode
:
0444
with_nested
:
-
'
{{
drupal.domains
}}'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment