Giter VIP home page Giter VIP logo

Comments (6)

oranenj avatar oranenj commented on September 26, 2024

manifests have access to the $settings::vardir variable, which is the vardir option of the agent. For example on my desktop:
sudo puppet apply -e 'notice($settings::vardir)' results in Notice: Scope(Class[main]): /var/lib/puppet and without sudo in Notice: Scope(Class[main]): /home/oranenj/.puppet/cache

from puppet-selinux.

vinzent avatar vinzent commented on September 26, 2024

from puppet-selinux.

oranenj avatar oranenj commented on September 26, 2024

Ah, yes, I misread the documentation... I wonder if there's a good way to get the configured vardir value somehow via Puppet's ruby API... Puppet.settings.setting('vardir').value returns nil if called straight from ruby.

from puppet-selinux.

oranenj avatar oranenj commented on September 26, 2024

However, it seems to work when called in a fact during a puppet run:

require 'puppet'
Facter.add(:puppet_agent_vardir) do
  setcode do
    Puppet.settings['vardir']
  end
end
$ FACTERLIB=. sudo -E puppet apply -e'notice($::puppet_agent_vardir)'
Notice: Scope(Class[main]): /var/lib/puppet

from puppet-selinux.

vinzent avatar vinzent commented on September 26, 2024

I think Puppet.settings outside of a puppet run needs to call some initialization method first.

I don't think we should rely on a client provided directory. The worst case could be that somebody sets is to "/" and we're purging "/" in the end.

from puppet-selinux.

oranenj avatar oranenj commented on September 26, 2024

Well of course we shouldn't use the directory directly, but if we set it to something like $client_vardir/selinux-module-cache and validate that it's an absolute path, even in the worst case we'll just have a directory called /selinux-module-cache

from puppet-selinux.

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.