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
2beeefa3
Commit
2beeefa3
authored
7 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Improve handling of mountpoints
parent
9d2c1682
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+3
-0
3 additions, 0 deletions
defaults/main.yml
tasks/files.yml
+8
-23
8 additions, 23 deletions
tasks/files.yml
tasks/install.yml
+13
-0
13 additions, 0 deletions
tasks/install.yml
tasks/mountpoints.yml
+52
-0
52 additions, 0 deletions
tasks/mountpoints.yml
with
76 additions
and
23 deletions
defaults/main.yml
+
3
−
0
View file @
2beeefa3
...
...
@@ -28,3 +28,6 @@ drupal_post_deploy_tasks:
letsencrypt_pause_services
:
-
'
apache2'
fstype_convert
:
btrfs
:
'
btrfs-convert
--no-progress
{{
item.src
}}'
This diff is collapsed.
Click to expand it.
tasks/files.yml
+
8
−
23
View file @
2beeefa3
...
...
@@ -6,29 +6,14 @@
src='{{ relativeRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}'
dest='{{ drupalRoot }}/sites/{{ drupal_domain.0.shortname|default("default") }}/{{ drupal_domain.1 }}'
-
block
:
-
name
:
"
Ensure
mounted
and
webroot
file
directory"
file
:
dest='{{ item }}'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='755'
with_items
:
-
'
{{
drupal_domain.0.mountpoint
}}'
-
'
{{
webRoot
}}/files'
ignore_errors
:
yes
-
name
:
"
Link
webroot
to
mounted
directory"
file
:
src='{{ drupal_domain.0.mountpoint }}/{{ drupal_domain.0.shortname|default("default") }}'
dest='{{ webRoot }}/files/{{ drupal_domain.0.shortname|default("default") }}'
state='link'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='755'
-
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'
when
:
drupal_domain.0.mountpoint is defined
-
name
:
"
Ensure
File
Directories"
...
...
This diff is collapsed.
Click to expand it.
tasks/install.yml
+
13
−
0
View file @
2beeefa3
...
...
@@ -117,6 +117,19 @@
with_items
:
'
{{
drupal.domains
}}'
when
:
item.install|default(true)
-
name
:
"
Ensure
Files
Directory"
file
:
path='{{ webRoot }}/files'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='775'
when
:
drupal.install_extra_dirs|default(true)
-
include_tasks
:
mountpoints.yml
with_items
:
'
{{
drupal.mountpoints|default[]
}}'
when
:
drupal.install_extra_dirs|default(true)
-
include_tasks
:
files.yml
with_nested
:
-
'
{{
drupal.domains
}}'
...
...
This diff is collapsed.
Click to expand it.
tasks/mountpoints.yml
0 → 100644
+
52
−
0
View file @
2beeefa3
---
# file: roles/drupal/tasks/mountpoints.yml
-
name
:
"
Check
File
System
Type"
shell
:
'
lsblk
--noheadings
--fs
--output
FSTYPE
{{
item.src
}}'
register
:
fstype
-
name
:
"
Convert
File
System
Type"
shell
:
'
{{
fstype_convert[item.fstype]
}}'
when
:
item.fstype != fstype
-
name
:
"
Ensure
directory
for
mountpoint"
file
:
dest
:
'
{{
item.path
}}'
state
:
'
directory'
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
'
755'
-
name
:
"
Ensure
directory
for
mountpoint
in
jail"
file
:
dest
:
'
{{
jailroot
}}/{{
drupal.jail.name
}}{{
item.path
}}'
state
:
'
directory'
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
'
755'
when
:
drupal.jail is defined
-
name
:
"
Mount
the
item"
mount
:
path
:
'
{{
item.path
}}'
src
:
'
{{
item.src
}}'
fstype
:
'
{{
item.fstype
}}'
opts
:
'
{{
item.opts|default(omit)
}}'
state
:
'
mounted'
-
name
:
"
Mount
the
item
in
jail"
mount
:
path
:
'
{{
jailroot
}}/{{
drupal.jail.name
}}{{
item.path
}}'
src
:
'
{{
item.src
}}'
fstype
:
'
{{
item.fstype
}}'
opts
:
'
{{
item.opts|default(omit)
}}'
state
:
'
mounted'
when
:
drupal.jail is defined
-
name
:
"
Ensure
file
directory
in
mountpoint"
file
:
dest
:
'
{{
item.path
}}/{{
drupal.id
}}'
state
:
'
directory'
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
'
755'
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