Comments (8)
Feature is ready and works
from autofs-puppet.
Hi,
sorry but this does not work for me. I've configured a module like this:
include autofs
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
mapcontents => ['* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'],
options => '--timeout=120',
order => 01,
use_dir => true
}
and this is the result:
# cat /etc/auto.master
+dir:/etc/auto.master.d
# cat /etc/auto.home
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
# ls /etc/auto.master.d
I didn't find any line in the code that generate auto_name.autofs
file inside /etc/auto.master.d
. Did I forget some options in my module file ??
Thank you
from autofs-puppet.
The issue is that you're setting mapfile to '/etc/auto.home' instead of '/etc/auto.master.d/auto_home.autofs'.
The $mapfile parameter is tied directly to the absolute path of the file
I fully intend to make that process much more automated in the code, but haven't gotten around to it yet.
from autofs-puppet.
You cannot use /etc/auto.master.d
in this way; changing mapfile from /etc/auto.home
to /etc/auto.master.d/auto_home.autofs
create a file in /etc/auto.master.d
, as you told me:
$ cat /etc/auto.master.d/auto_home.autofs
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
but you cannot put the automounter maps in /etc/auto.master.d
directory, automount
does not like it:
$ automount -m
syntax error in map near [ * -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com: ]
autofs dump map information
===========================
global options: none configured
no master map entries found
/etc/auto.master.d
is only an extension of /etc/auto.master
file, you can only define which map to use:
$ cat /etc/auto.master.d/auto_home.autofs
/home /etc/auto.home
$ cat /etc/auto.home
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
$ automount -m
autofs dump map information
===========================
global options: none configured
Mount point: /home
source(s):
instance type(s): file
map: /etc/auto.home
* | -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
from autofs-puppet.
Ahh, I stand corrected. I misread the docs on that, at least what little I could find on auto.master.d, it doesn't appear that Ubuntu, Red Hat, or Arch focus on that piece much at all.
Pushed a change up to the master branch, please pull and test if you can. I will do some testing on my end as well.
(I really need to get acceptance tests added)
from autofs-puppet.
nop, it does not work..
this is my configuration (like in module's README):
include autofs
autofs::mount { 'home':
mount => '/home',
mapfile => '/etc/auto.home',
mapcontents => ['* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares'],
options => '--timeout=120',
order => 01,
use_dir => true
}
and this is the result:
$ cat /etc/auto.master
+dir:/etc/auto.master.d
$ cat /etc/auto.master.d/home.autofs
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
$ cat /etc/auto.home
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
$ automount -m
syntax error in map near [ * -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com: ]
autofs dump map information
===========================
global options: none configured
no master map entries found
in /etc/auto.master.d/home.autofs
you have only to define the map:
/home /etc/auto.home --timeout=120
from autofs-puppet.
Wow, I'm and idiot.
Changed below code block from:
file { "${map_dir}/${name}.autofs":
ensure => present,
owner => 'root',
group => 'root',
mode => $mapperms,
content => template($maptempl),
require => File[ $map_dir ],
notify => Service[ 'autofs' ],
}
to:
file { "${map_dir}/${name}.autofs":
ensure => present,
owner => 'root',
group => 'root',
mode => $mapperms,
content => $contents,
require => File[ $map_dir ],
notify => Service[ 'autofs' ],
}
Of course it'll populate the home.autofs file with the wrong contents if it's told to use the autofs.map template instead of the auto.mater format.
Try again and I'll validate what I can here.
from autofs-puppet.
Ok, it seems to work now !!! Thank you very much
$ cat /etc/auto.master.d/home.autofs
/home /etc/auto.home --timeout=120
$ cat /etc/auto.home
###############################################################
# #
# THIS FILE IS MANAGED BY PUPPET. ANY CHANGES MADE TO THIS #
# FILE WILL BE REVERTED BACK ON THE NEXT PUPPET RUN. #
# #
###############################################################
* -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
$ cat /etc/auto.master
+dir:/etc/auto.master.d
$ automount -m
autofs dump map information
===========================
global options: none configured
Mount point: /home
source(s):
instance type(s): file
map: /etc/auto.home
* | -user,rw,soft,intr,rsize=32768,wsize=32768,tcp,nfsvers=3,noacl server.example.com:/path/to/home/shares
from autofs-puppet.
Related Issues (18)
- autofs::mapOptions? HOT 10
- mount.pp - do you really need to ensure $mount directory? HOT 7
- Add /net -hosts entry HOT 1
- Add Solaris support HOT 1
- Multiple direct mounts HOT 2
- Update Documentation 1.3.0 HOT 2
- Specify a mount point and map file that is deployed only once
- no newline at the end of /etc/auto.master file, with "use_dir" parameter HOT 2
- Duplicate declaration: File[/etc/auto.master.d] with use_dir = true HOT 2
- The $ensure parameter to concat::fragment is deprecated HOT 1
- Service autofs requires package autofs? HOT 1
- Puppetlabs-stdlib version range is too restrictive HOT 7
- Refactor code with typed Parameters HOT 1
- Add puppet strings documentation HOT 1
- Doesn't support SUSE based systems HOT 1
- Update README for 2.0.0
- Add support for +auto_master HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofs-puppet.