Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditionality to config file locations in lenses #16

Open
thejoecarroll opened this issue Feb 12, 2013 · 3 comments
Open

Add conditionality to config file locations in lenses #16

thejoecarroll opened this issue Feb 12, 2013 · 3 comments

Comments

@thejoecarroll
Copy link

I'd like to see the included lens descriptions check what OS Augeas is running on and then choose the appropriate location. For example, "out of the box" Augeas will not process sshd_config on Mac OS X because it is not located at the same path as on Ubuntu. It is necesary to edit .../share/augeas/lenses/dist/sshd.aug so that the line
let xfm = transform lns (incl "/etc/ssh/sshd_config")
becomes:
let xfm = transform lns (incl "/etc/sshd_config")
I'm not really familiar with ML and only just discovered Augeas and haven't read up too much yet on the lens DSL (so pardon me if this is already possible), but it seems like adding some sort of environment variable that a lens can check along with support for conditional structures along the lines of switch/case statements in other languages would do the trick.

@raphink
Copy link
Member

raphink commented Feb 12, 2013

Unfortunately, it is not possible to check for the OS in the lens.

However, it is possible to parse both /etc/ssh/sshd_config and /etc/sshd_config if they exist. A lot of lenses parse several files. Have a look at xinetd.aug for example.

@giraldeau
Copy link
Member

It makes me think of a quote from a old unix guy that said me a software evolves until it has a ".d" directory. In fact, could it be possible to override transforms by adding files in some directory? That would increase the convenience to ship for various distributions, and still ship default lens set.

@raphink
Copy link
Member

raphink commented Feb 12, 2013

Some time ago, @lutter, @domcleal and I (I think) were talking about adding runtime parameters to lenses, to be set in /augeas. That was one of the use cases if my memory is not failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants