Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sftp
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
sftp
Commits
b7d70825
Commit
b7d70825
authored
6 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Implement support for mounted endpoint for each SFTP group
parent
dee6fe7d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
defaults/main.yml
+0
-1
0 additions, 1 deletion
defaults/main.yml
tasks/main.yml
+6
-2
6 additions, 2 deletions
tasks/main.yml
tasks/mount.yml
+13
-33
13 additions, 33 deletions
tasks/mount.yml
with
19 additions
and
36 deletions
defaults/main.yml
+
0
−
1
View file @
b7d70825
...
...
@@ -4,4 +4,3 @@ sftp_groups:
path
:
'
data'
user
:
[]
sftp_user
:
[]
sftp_devpath
:
false
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
6
−
2
View file @
b7d70825
...
...
@@ -29,6 +29,7 @@
state
:
'
directory'
mode
:
'
770'
with_items
:
'
{{
sftp_groups
}}'
when
:
'
sftp_groups[item].mountpath
is
not
defined'
-
name
:
"
Create
Users"
user
:
...
...
@@ -49,7 +50,10 @@
loop_var
:
group
with_items
:
'
{{
sftp_groups
}}'
-
import_tasks
:
mount.yml
when
:
sftp_devpath
-
include_tasks
:
'
mount.yml'
loop_control
:
loop_var
:
group
with_items
:
'
{{
sftp_groups
}}'
when
:
'
sftp_groups[group].mountpath
is
defined'
when
:
'
"sftp"
not
in
excluded_roles'
This diff is collapsed.
Click to expand it.
tasks/mount.yml
+
13
−
33
View file @
b7d70825
---
# file: roles/sftp/tasks/mount.yml
-
name
:
"
SFTP
|
Create
Mount
Point"
mount
:
fstype=none
opts=bind
name=/var/sftp/data/dev
src={{ sftp_devpath }}
state=mounted
-
name
:
"
SFTP
|
Set
ownership"
file
:
path="{{ sftp_devpath }}"
owner="root"
group="sftp"
recurse=yes
follow=no
-
name
:
"
SFTP
|
Set
permissions"
-
name
:
"
Ensure
Mount
Path"
file
:
path="{{ sftp_devpath }}"
mode=g+w
recurse=yes
follow=no
dest
:
'
{{
sftp_groups[group].mountpath
}}'
owner
:
'
{{
group
}}'
group
:
'
{{
group
}}'
state
:
'
directory'
mode
:
'
775'
-
name
:
"
SFTP
|
Collect
SVN
Directories"
command
:
find {{ sftp_devpath }} -type d -name .svn
register
:
svnpaths
-
name
:
"
SFTP
|
Set
ownership
on
SVN
Directories"
file
:
path="{{ item }}"
owner="root"
group="root"
recurse=yes
follow=no
with_items
:
'
{{
svnpaths.stdout_lines
}}'
-
name
:
"
Create
Mount
Point"
mount
:
fstype
:
'
none'
opts
:
'
bind'
name
:
'
{{
sftp_basepath
}}/{{
sftp_groups[group].path
}}'
src
:
'
{{
sftp_groups[group].mountpath
}}'
state
:
'
mounted'
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