https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • v

    vchepkov

    10/14/2022, 2:42 PM
    k, postfix 🙂
  • c

    Corporate Gadfly

    10/14/2022, 3:35 PM
    Today, I got to use a new feature of onceover. When looking at the output of
    pdk bundle exec onceover show puppetfile
    , saw the following:
    Copy code
    +-------------------------------------+-----------------+----------------+--------------+-------------+-----------------------------+
    | Full Name                           | Current Version | Latest Version | Out of Date? | Endorsement | Superseded by               |
    +-------------------------------------+-----------------+----------------+--------------+-------------+-----------------------------+
    | herculesteam-augeasproviders_core   | 3.1.0           | 3.1.0          | No           | approved    | puppet-augeasproviders_core |
    which led me to trying out the replacement puppet/augeasproviders_core.
  • c

    Corporate Gadfly

    10/14/2022, 3:35 PM
    Today, I got to use a new feature of onceover. When looking at the output of
    pdk bundle exec onceover show puppetfile
    , saw the following:
    Copy code
    +-------------------------------------+-----------------+----------------+--------------+-------------+-----------------------------+
    | Full Name                           | Current Version | Latest Version | Out of Date? | Endorsement | Superseded by               |
    +-------------------------------------+-----------------+----------------+--------------+-------------+-----------------------------+
    | herculesteam-augeasproviders_core   | 3.1.0           | 3.1.0          | No           | approved    | puppet-augeasproviders_core |
    which led me to trying out the replacement
    puppet/augeasproviders_core
    .
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:18 PM
    Hello team, how we can use value of one variable as variable name for another? like "${${variable}}"
  • v

    vchepkov

    10/14/2022, 4:22 PM
    well, your example doesn't need second one 🙂
  • v

    vchepkov

    10/14/2022, 4:23 PM
    getvar
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:23 PM
    you mean it supposed to work ?)
  • v

    vchepkov

    10/14/2022, 4:24 PM
    Never mind, getvar is the answer, I think
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:24 PM
    I need to use it inside command
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:25 PM
    command => "echo ${${variable}}"
  • v

    vchepkov

    10/14/2022, 4:25 PM
    I use it like this, for exampe
    Copy code
    $mac_addr = upcase(getvar("macaddress_${interface}"))
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:30 PM
    thanks, worked perfectly
    👍 1
  • a

    Allahshukur Ahmadzada

    10/14/2022, 4:46 PM
    message has been deleted
  • s

    Slackbot

    10/14/2022, 5:49 PM
    This message was deleted.
    s
    b
    • 3
    • 2
  • b

    Brian Schonecker

    10/14/2022, 5:49 PM
    Good 13:43 EST. I'm using the Apache puppet module (v7 for now) and I'm trying to implement a vendor requirement for:
    <LocationMatch ^/sci/bi/(.*)$>
    RequestHeader set X-BI-PATH /sci/bi/v1
    ProxyPass <balancer://mycluster/bi/$1>
    ProxyPassReverseCookieDomain "." "<http://sci2021.usva0017.oraclevcn.com|sci2021.usva0017.oraclevcn.com>"
    </LocationMatch>
    The only template in the apache module that references LocationMatch is ./templates/vhost/_security.erb. It appears that the only valid LocationMatch arguments that the apache module supports are SecRuleEngine, SecRuleRemoveById, SecRule, SecAction, SecRuleRemoveByMsg, SecRuleRemoveByTag and SecRequestBodyLimit as shown here. The vhosts define has a "custom_fragment" that can be defined. Is custom_fragment my go-to solution for what I'm trying to accomplish?
  • b

    Brian Schonecker

    10/14/2022, 5:54 PM
    Good 13:43 EST. I'm using the Apache puppet module (v7 for now) and I'm trying to implement a vendor requirement for:
    <LocationMatch ^/sci/bi/(.*)$>
    RequestHeader set X-BI-PATH /sci/bi/v1
    ProxyPass <balancer://mycluster/bi/$1>
    ProxyPassReverseCookieDomain "." "<http://example.usva0017.oraclevcn.com|example.usva0017.oraclevcn.com>"
    </LocationMatch>
    The only template in the apache module that references LocationMatch is ./templates/vhost/_security.erb. It appears that the only valid LocationMatch arguments that the apache module supports are SecRuleEngine, SecRuleRemoveById, SecRule, SecAction, SecRuleRemoveByMsg, SecRuleRemoveByTag and SecRequestBodyLimit as shown here. The vhosts define has a "custom_fragment" that can be defined. Is custom_fragment my go-to solution for what I'm trying to accomplish?
  • a

    Anton Kayukov

    10/14/2022, 6:26 PM
    Just found out that this manifest works on Puppet7 and fails on Puppet5 :(
    Copy code
    file { '/tmp/public-result':
      source => '<http://localhost:8080/public>'
    }
    
    file { '/tmp/private-result':
      source => '<http://abc:123@localhost:8080/private>'
    }
    Was it a bug in Puppet5? P.S.: I know Puppet5 is not supported anymore.
  • l

    Lumiere

    10/14/2022, 6:31 PM
    pretty sure they fixed auth in sources somewhere in puppet 6
  • l

    Lumiere

    10/14/2022, 6:31 PM
    but I don't know what bug it is off the top of my head
  • a

    Anton Kayukov

    10/14/2022, 6:41 PM
    Thanks. I hoped I can do something before we upgrade to 7 entirely.
  • a

    Anton Kayukov

    10/14/2022, 7:16 PM
    Oh wait… I have exec
  • s

    ssaini

    10/14/2022, 8:01 PM
    Hi, In hirea the following hierarchy is setup
    Copy code
    version: 5
    
    defaults:
      datadir: "/etc/puppetlabs/code/environments/%{environment}"
    
    :hierarchy:
      - name: "Normal data lookups"
        data_hash: yaml_data # standard yaml backend
        paths:
          - "modules/%{::hg_module}/hieradata/nodes/%{::trusted.certname}.yaml"
          - "modules/%{::hg_module}/hieradata/pools/%{::pool}.yaml"
          - "modules/%{::hg_module}/hieradata/locations/%{::location}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}/%{::hg_level_2}/%{::hg_level_3}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}/%{::hg_level_2}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}.yaml"
          - "modules/%{::hg_module}/hieradata/os/%{facts.os.name}-%{facts.os.release.major}.yaml"
          - "modules/%{::hg_module}/hieradata/os/%{facts.os.family}.yaml"
          - "hieradata/locations/%{::location}.yaml"
          - "hieradata/os/%{facts.os.name}-%{facts.os.release.major}.yaml"
          - "hieradata/os/%{facts.os.family}.yaml"
          - "hieradata/global.yaml"
    I have a use case to deploy several hosts using a particular module because 100% of the code base has been written, but in this particular module the locations defines what NFS to mounts (different for each location), and the use case I have cannot mount those NFS because they’re not accessible. Thus puppet keeps trying to mount but errors because access denied. Is it possible to somehow apply a logic either at nodes level “to ignore the locations data lookup” or should I approach this in the different way. Ultimately, I am trying to avoid duplicating the module just so the NFS is not defined?
  • s

    ssaini

    10/14/2022, 8:08 PM
    Hi, In hirea the following hierarchy is setup
    Copy code
    version: 5
    
    defaults:
      datadir: "/etc/puppetlabs/code/environments/%{environment}"
    
    :hierarchy:
      - name: "Normal data lookups"
        data_hash: yaml_data # standard yaml backend
        paths:
          - "modules/%{::hg_module}/hieradata/nodes/%{::trusted.certname}.yaml"
          - "modules/%{::hg_module}/hieradata/pools/%{::pool}.yaml"
          - "modules/%{::hg_module}/hieradata/locations/%{::location}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}/%{::hg_level_2}/%{::hg_level_3}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}/%{::hg_level_2}.yaml"
          - "modules/%{::hg_module}/hieradata/hostgroups/%{::hg_level_1}.yaml"
          - "modules/%{::hg_module}/hieradata/os/%{facts.os.name}-%{facts.os.release.major}.yaml"
          - "modules/%{::hg_module}/hieradata/os/%{facts.os.family}.yaml"
          - "hieradata/locations/%{::location}.yaml"
          - "hieradata/os/%{facts.os.name}-%{facts.os.release.major}.yaml"
          - "hieradata/os/%{facts.os.family}.yaml"
          - "hieradata/global.yaml"
    I have a use case to deploy several hosts using a particular module because 100% of the code base has been written, but in this particular module the locations defines what NFS to mounts (different for each location), and the use case I have cannot mount those NFS because they’re not accessible. Thus puppet keeps trying to mount but errors because access denied. Is it possible to somehow apply a logic either at nodes level “to ignore the locations data lookup” or should I approach this in the different way. Ultimately, I am trying to avoid duplicating the module just so the NFS is not defined?
  • h

    helindbe

    10/14/2022, 8:12 PM
    There is no conditional logic available in heira.yaml (if that is what you are asking). And there is no way to direct the search hiera does through the given hierarchy in any way. The only form of conditional logic you get is the effect you get from the interpolation of facts into paths, thereby selecting the data files that will be read.
  • s

    ssaini

    10/14/2022, 8:17 PM
    Hi, thank your for a reply. I think I understand - I understand heira.yaml doesn't do conditional logic. Is there a way to overide the lookups defined in heira.yaml somwhere else like at nodes level?
  • v

    vchepkov

    10/14/2022, 8:18 PM
    yes, define value in node level hierarchy
  • v

    vchepkov

    10/14/2022, 8:20 PM
    by the way, there is no need to have module level lookups in hiera 5, that belongs to the module itself
  • v

    vchepkov

    10/14/2022, 8:21 PM
    Your paths should start from here
    Copy code
    locations/%{facts.location}.yaml
  • v

    vchepkov

    10/14/2022, 8:24 PM
    Your paths should start from here
    Copy code
    locations/%{facts.location}.yaml
  • h

    helindbe

    10/14/2022, 8:32 PM
    I was about to say the same about having the environment level hiera.yaml reference files inside of modules. That is really bad and modules should have their own hiera.yaml that directs the search in that module only. Also, data files for “hiera in modules” cannot have higher precedence than in the environment hiera.yaml (for very good reasons), and they can only use keys for that module’s namespace. Sorry, but it looks like you have to do some redesign of the entire structure…
1...200201202...428Latest