Giter VIP home page Giter VIP logo

Comments (17)

damacus avatar damacus commented on May 30, 2024

👍 we should see a few more of these come through as J Keiser puts in more RFCs and merges his changes to master.
We probably don't need to fix this right away.

from autofs.

hansnqyr avatar hansnqyr commented on May 30, 2024

this is an upstream issue in the line cookbook https://github.com/someara/line-cookbook

from autofs.

hansnqyr avatar hansnqyr commented on May 30, 2024

although I'm guessing that's an example and autofs has it's own warnings that we need to clean up

from autofs.

damacus avatar damacus commented on May 30, 2024

OK so resource has now been deprecated in favour of compat_resource

from autofs.

 avatar commented on May 30, 2024

Looks like I filed an issue as duplicate of this.
Also see you have a branch to fix this.
Hows the effort coming along? Something I can help with?

Thanks

Ajay

from autofs.

hansnqyr avatar hansnqyr commented on May 30, 2024

Hi Ajay,
This cookbook was originally built against the resource cookbook. In newer versions of chef this functionality was incorporated into chef core (as 'custom resources') and the resource cookbook was deprecated as a result.

It's been a while since I worked on the code here, but I think have 2 options:

  • use compat_resource cookbook
  • migrate to custom resources

If you want to help, a PR based on either of those 2 would be awesome!

from autofs.

 avatar commented on May 30, 2024

I think using compat_resource would be most economical.
Working on this at https://github.com/agautam-hs/chef-autofs
Will submit PR as soon as I get around to testing. (Hopefully soon)

Thanks

from autofs.

richardlock avatar richardlock commented on May 30, 2024

Thanks Ajay. Our newer resources we've been writing as custom resources, but we haven't updated this one yet. Thanks for helping with this. Let us know if you have any issues.

from autofs.

 avatar commented on May 30, 2024
The whole point of a "compat" library is to serve as a drop in replacement for an older implementation to work with new versions of the system. Looks like compat_resource does not follow this convention! Whats the point of naming something "compat" if we are going to have to update code to use it anyway! ... sigh ...

I was hoping compat_resource would be a drop in replacement for resource. This is not the case.
Unfortunately, my chef knowledge is not advanced enough to migrate this cookbook to the new way of doing custom resources.

Abandoning my effort / branch. Good luck with the migration.

Apologies

from autofs.

hansnqyr avatar hansnqyr commented on May 30, 2024

Hey Ajay, absolutely no need to apologise - I really appreciate you took the time to look at this.

from autofs.

jbsmith86 avatar jbsmith86 commented on May 30, 2024

I've forked the repo and made an attempt to rewrite the code based on the "custom resources" in Chef 12.5 and generally using this doc https://docs.chef.io/custom_resources.html for reference. One of the major things you have to do is move things out of the "libraries" folder and make a file for each customer resource in a new "resources" folder. In this case I made a file for each resource (automaster_entry, map_entry, and nfs). There are also a few problems with this approach.

  1. The "Path" type doesn't seem to be an option for a property anymore, I had to replace it with String to get things to work.
  2. Certain conventions don't seem to work, specifically having two arguments like is currently available for automaster_entry. The docs provide a "name_property: true" option you can set that will allow you do it but can only be 1 argument and that argument is required to be there. To illustrate this point this code won't work with this approach (unless we find a workaround):
automaster_entry '/smb', '/etc/auto.smb' do
  options '--timeout 600'
end

Instead it may have to be something like this (or do away with the in line argument entirely):

automaster_entry '/smb' do
  map '/etc/auto.smb'
  options '--timeout 600'
end

I've gotten to the point with the code that in a few hours I have something that seems to write the automaster entry correctly, however nothing seems to mount. I also am not quite sure how the tests are run I'd really like to get some help from someone on this if possible. You can look at what I've done so far in my fork: https://github.com/jbsmith86/chef-autofs

P.S. I'm also not quite sure how the nfs resource works in the current code. Is it calling map_entry with some changed properties? It may be why my code isn't working.

from autofs.

damacus avatar damacus commented on May 30, 2024

@jbsmith86 I can take a look at that today.

Thanks!

On Tue, 30 Aug 2016, 03:47 Joel Smith, [email protected] wrote:

I've forked the repo and made an attempt to rewrite the code based on the
"custom resources" in Chef 12.5 and generally using this doc
https://docs.chef.io/custom_resources.html for reference. One of the
major things you have to do is move things out of the "libraries" folder
and make a file for each customer resource in a new "resources" folder. In
this case I made a file for each resource (auto_masterentry, map_entry, and
nfs). There are also a few problems with this approach.

The "Path" type doesn't seem to be an option for a property anymore, I
had to replace it with String to get things to work.
2.

Certain conventions don't seem to work, specifically having two
arguments like is currently available for auto_masterentry. The docs
provide a "name_property: true" option you can set that will allow you do
it but can only be 1 argument and that argument is required to be there. To
illustrate this point this code won't work with this approach
(unless we find a workaround):

automaster_entry '/smb', '/etc/auto.smb' do
options '--timeout 600'
end

Instead it may have to be something like this (or do away with the in line
argement entirely):

automaster_entry '/smb' do
map '/etc/auto.smb'
options '--timeout 600'
end

I've gotten to the point with the code that in a few hours I have
something that seems to write the automaster entry correctly, however
nothing seems to mount. I also am not quite sure how the tests are run I'd
really like to get some help from someone on this if possible. You can look
at what I've done so far in my fork:
https://github.com/jbsmith86/chef-autofs


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#15 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACfUnrrO4c_5xAXdr_Xq_Aq-J9z2s91ks5qk5nJgaJpZM4FPu31
.

from autofs.

jbsmith86 avatar jbsmith86 commented on May 30, 2024

I think that if we aren't allowed the two arguments (or can't find a suitable workaround) we should try to get opscode to put it in. I have a number of cookbooks in my work environment that are dependent on autofs and rewriting them all would not be easy.

from autofs.

damacus avatar damacus commented on May 30, 2024

I had another crack at it today.

Getting some chef resource cloning issues. So I've posted on the chef
slack.

Right now it's only the NFS recipes that don't work (which are just a less
generic auto master mount).

I'll push it tonight. But with the current vagrant bug in 1.8.5 you'll only
be able to do kitchen test against something like the Amazon driver

On Tue, 30 Aug 2016, 18:38 Joel Smith, [email protected] wrote:

I think that if we aren't allowed the two arguments (or can't find a
suitable workaround) we should try to get opscode to put it in. I have a
number of cookbooks in my work environment that are dependent on autofs and
rewriting them all would not be easy.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#15 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACfUpqMCaw4R7pCCY-3j8wIxW4gav25ks5qlGqrgaJpZM4FPu31
.

from autofs.

jbsmith86 avatar jbsmith86 commented on May 30, 2024

It looks like they have some notes on other custom resource approaches here: https://docs.chef.io/custom_resources_notes.html

May take another crack at it when I get time

from autofs.

richardlock avatar richardlock commented on May 30, 2024

This should be fixed in 2.0.0, now using custom resources.

from autofs.

lock avatar lock commented on May 30, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from autofs.

Related Issues (17)

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.