Comments (3)
You can certainly insert a record before 6
:
ins 01 before /files/etc/pam.d/sshd/6
should work perfectly fine. There's no need for numbers to follow each other in the tree, they're just numbers given by Augeas when it parses the tree in order to prevent identical labels.
from augeas.
Well, in the usual case (i.e. via puppet), you don't know the numbers.
Which commands could then do the following:
- Insert a
record
above all others? - Insert a
record
as last line in the document? - Insert a
record
right before therecored
withmodule = "pam_env.so"
?
from augeas.
- Insert a
record
above all others
ins 01 before /files/etc/pam.d/sshd/*[1]
set /files/etc/pam.d/sshd/01 "some value"
- Insert a
record
as last line in the document
set /files/etc/pam.d/sshd/01 "some value"
- Insert a
record
right before therecord
withmodule = "pam_env.so"
ins 01 before /files/etc/pam.d/sshd/*[module="pam_env.so"]
set /files/etc/pam.d/sshd/01 "some value"
Now in particular for this PAM module in Puppet, you probably want to use the pam
provider from augeasproviders which is cleanly written in Ruby and has the features you want:
pam { "Set sss entry to system-auth auth":
ensure => present,
service => 'system-auth',
type => 'auth',
control => 'sufficient',
module => 'pam_sss.so',
arguments => 'use_first_pass',
position => 'before module pam_deny.so',
}
from augeas.
Related Issues (20)
- How to add a /var/log/auth.log file to the augaes tree HOT 1
- Augeas Lense creation issue to filter log entries
- Augeas lense fails to parse Fedora 36's /etc/services file HOT 1
- sshd_config lens: Not possible to create or remove subsystem
- Parser for sosreport
- pg_hba.conf can't be parsed due to password_encryption = scram-sha-256
- Bug Report: null-pointer dereference in function fa_expand_nocase() (and so on) at src/fa.c
- Missing checking the return value of make_ref()
- fa.c:125:27: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' HOT 4
- rsyslog: modern name for the discard action ("stop") is not recognized HOT 5
- tmpfiles lens: support for caret notation
- php lens: missing loading of /etc/php-fpm.d/www.conf (remi repo)
- sshd fails to create new entry if a match block already exists at the end HOT 3
- RFE: Augeas doesn't understand "RainerScript" format used by rsyslog
- Grammar railroad diagram
- Sshd not parsing PubKeyAcceptedAlgorithms as a list HOT 4
- oss-fuzz: timeout HOT 3
- [multipath.aug] Unable to parse `enable_foreign "^$"` line
- Puppetfile lens doesn't allow inline comments
- how to encrypt password using htpasswd.lens 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 augeas.