Giter Club home page Giter Club logo

Comments (8)

dhollinger avatar dhollinger commented on July 17, 2024

Feature is ready and works

from autofs-puppet.

gocram avatar gocram commented on July 17, 2024

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.

dhollinger avatar dhollinger commented on July 17, 2024

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.

gocram avatar gocram commented on July 17, 2024

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.

dhollinger avatar dhollinger commented on July 17, 2024

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.

gocram avatar gocram commented on July 17, 2024

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.

dhollinger avatar dhollinger commented on July 17, 2024

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.

gocram avatar gocram commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.