Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
samba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
infra
ansible-shared
samba
Commits
6b28bd80
Commit
6b28bd80
authored
6 months ago
by
Thomas Schneider
Browse files
Options
Downloads
Patches
Plain Diff
nfs-client: Use systemd’s automount feature instead of autofs
parent
afec468c
No related branches found
No related tags found
1 merge request
!13
nfs-client: Use systemd’s automount feature instead of autofs
Pipeline
#7048
passed
6 months ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nfs-client/tasks/main.yml
+47
-113
47 additions, 113 deletions
nfs-client/tasks/main.yml
with
47 additions
and
113 deletions
nfs-client/tasks/main.yml
+
47
−
113
View file @
6b28bd80
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
apt
:
apt
:
name
:
name
:
-
nfs-common
-
nfs-common
-
libgssrpc4
-
autofs
state
:
present
state
:
present
tags
:
tags
:
-
nfs-client
-
nfs-client
...
@@ -37,7 +35,6 @@
...
@@ -37,7 +35,6 @@
mode
:
'
0644'
mode
:
'
0644'
notify
:
notify
:
-
restart nfs-client
-
restart nfs-client
-
restart autofs
tags
:
tags
:
-
nfs-client
-
nfs-client
...
@@ -45,34 +42,8 @@
...
@@ -45,34 +42,8 @@
modprobe
:
modprobe
:
name
:
nfs
name
:
nfs
state
:
present
state
:
present
tags
:
params
:
nfs4_disable_idmapping=N
-
nfs-client
persistent
:
present
-
name
:
ensure nfs module is loaded after a reboot
copy
:
content
:
"
nfs"
dest
:
/etc/modules-load.d/nfs.conf
tags
:
-
nfs-client
-
name
:
ensure we use the idmapper
copy
:
content
:
"
N"
dest
:
/sys/module/nfs/parameters/nfs4_disable_idmapping
unsafe_writes
:
true
notify
:
-
restart nfs-client
-
restart autofs
tags
:
-
nfs-client
-
name
:
ensure we use the idmapper after a reboot
copy
:
src
:
modprobe-nfs.conf
dest
:
/etc/modprobe.d/nfs.conf
owner
:
root
group
:
root
mode
:
'
0644'
tags
:
tags
:
-
nfs-client
-
nfs-client
...
@@ -91,79 +62,37 @@
...
@@ -91,79 +62,37 @@
tags
:
tags
:
-
nfs-client
-
nfs-client
-
name
:
Configure automount
-
name
:
Disable and stop autofs
when
:
automount
systemd
:
block
:
-
name
:
ensure there is a base directory for automount
file
:
state
:
directory
path
:
/net
owner
:
root
group
:
root
mode
:
'
0755'
notify
:
-
restart autofs
tags
:
-
nfs-client
-
name
:
ensure automounter is configured
copy
:
src
:
auto.master
dest
:
/etc/auto.master
owner
:
root
group
:
root
mode
:
'
0644'
notify
:
-
restart autofs
tags
:
-
nfs-client
-
name
:
ensure mounts from central storage are available
template
:
src
:
auto.nfs.j2
dest
:
/etc/auto.nfs
owner
:
root
group
:
root
mode
:
'
0644'
notify
:
-
restart autofs
tags
:
-
nfs-client
-
name
:
ensure automounter is enabled
service
:
name
:
autofs
name
:
autofs
state
:
started
state
:
stopped
enabled
:
true
enabled
:
false
ignore_errors
:
true
tags
:
tags
:
-
nfs-client
-
nfs-client
-
name
:
ensure linking of netdirs
-
name
:
Remove old autofs directory
file
:
file
:
src
:
"
/net/{{
item.netdir
}}"
path
:
/net
dest
:
"
/{{
item.dest
}}"
state
:
absent
state
:
link
force
:
true
with_items
:
"
{{
nfs_shares
}}"
tags
:
tags
:
-
nfs-client
-
nfs-client
-
name
:
Configure fstab nfs mounts
-
name
:
Ensure /home is a directory
when
:
not automount
file
:
block
:
path
:
/home
-
name
:
Disable automounter
state
:
directory
service
:
owner
:
root
name
:
autofs
group
:
root
state
:
stopped
mode
:
'
0755'
enabled
:
false
tags
:
tags
:
-
nfs-client
-
nfs-client
-
name
:
Ensure mountpoints are directories
-
name
:
Ensure mountpoints are directories
file
:
file
:
path
:
"
/
{{
item.dest
}}"
path
:
"
{{
item.dest
}}"
state
:
directory
state
:
directory
with_items
:
"
{{
nfs_shares
}}"
loop
:
"
{{
nfs_shares
}}"
tags
:
tags
:
-
nfs-client
-
nfs-client
...
@@ -171,10 +100,15 @@
...
@@ -171,10 +100,15 @@
mount
:
mount
:
fstype
:
"
nfs"
fstype
:
"
nfs"
src
:
"
{{
item.src
}}"
src
:
"
{{
item.src
}}"
path
:
"
/
{{
item.dest
}}"
path
:
"
{{
item.dest
}}"
opts
:
"
{{
item.options
}}"
opts
:
"
{{
item.options
}}{{
maybe_automount
}}"
state
:
mounted
state
:
mounted
with_items
:
"
{{
nfs_shares
}}"
loop
:
"
{{
nfs_shares
}}"
vars
:
maybe_automount
:
>-
{% if automount -%}
,x-systemd.automount
{%- endif %}
tags
:
tags
:
-
nfs-client
-
nfs-client
...
...
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