Git Product home page Git Product logo

Comments (3)

raphink avatar raphink commented on July 23, 2024

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.

leoarnold avatar leoarnold commented on July 23, 2024

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 the recored with module = "pam_env.so"?

from augeas.

raphink avatar raphink commented on July 23, 2024
  • 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 the record with module = "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)

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.