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

    William Myers

    10/10/2022, 9:10 PM
    Is there a way to override an include line of a class youre calling from another manifest. E.G. I want to override and drop the following statement included in the puppet forge apache module
    Copy code
    include apache::mod::autoindex
    from my class that installs apache
  • w

    William Myers

    10/10/2022, 9:10 PM
    Is there a way to override an include line of a class youre calling from another manifest. E.G. I want to override and drop the following statement from defaults_mods.pp included in the puppet forge apache module
    Copy code
    include apache::mod::autoindex
    from my class that installs apache
  • s

    Slackbot

    10/10/2022, 9:24 PM
    This message was deleted.
    b
    s
    • 3
    • 16
  • s

    ssaini

    10/10/2022, 9:24 PM
    Hi, I am trying to configure puppet_operational_dashboards for Puppet Open Source, From what I understand the toml-rb gem needs to be installed on the pupperserver, thus... 1. ...on the pupperserver I have included the influxdb::profile::toml to install the gem
    Copy code
    [root@puppet-master01 ~]# puppetserver  gem list| grep toml
    toml-rb (2.1.1)
    2. On the VM I want to configure to run puppet_operational_dashboards I have included the following...
    Copy code
    9,56          All
    class hg_puppet::ops
    {
    
      # Include common configuration
      include hg_puppet::profile::common
    
      # Install and configure puppet_operational_dashboards
      include puppet_operational_dashboards
    
    }
    ...and running puppet agent -t it asks for the gem toml-rb
    Copy code
    [root@puppet-ops ~]# puppet agent -t
    Info: Using environment 'puppet_ops'
    Info: Retrieving pluginfacts
    Info: Retrieving plugin
    Info: Retrieving locales
    Info: Loading facts
    Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- toml-rb
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run
    3. is the puppet_operational_dashboards meant to be installed on a pupperserver or a standalone host?
  • s

    ssaini

    10/10/2022, 9:36 PM
    yes, it did the module did that automatically However, I haven't configured puppet_operational_dashboards to point to any specific puppet infra hosts
    puppetserver_hosts
    puppetdb_hosts
    postgres_hosts
    I am wondering if puppet_operational_dashboards doesn't know which are puppetserver it thinks it's the puppetsever itself hence it thinks it shold have the toml-rb gem installed?
  • s

    Slackbot

    10/11/2022, 1:47 AM
    This message was deleted.
    s
    s
    l
    • 4
    • 11
  • s

    SlyPig

    10/11/2022, 1:49 AM
    also happy to be pointed at a better option for this - the intent is to send a PagerDuty alert on agent run failure
  • k

    Konstantin

    10/11/2022, 6:15 AM
    I got it, i added iptables module in the end of list. Now a have full list. Thanks
  • s

    Slackbot

    10/11/2022, 11:25 AM
    This message was deleted.
    t
    s
    • 3
    • 11
  • s

    sameer

    10/11/2022, 11:26 AM
    puppet.service - LSB: puppet agent Loaded: loaded (/etc/init.d/puppet; generated) Active: active (exited) since Tue 2022-10-11 132049 CEST; 2s ago Docs: man:systemd-sysv-generator(8) Process: 4053011 ExecStart=/etc/init.d/puppet start (code=exited, status=0/SUCCESS) but when i run puppet agent -t it says -bash: /bin/puppet: No such file or directory
  • s

    sameer

    10/11/2022, 11:30 AM
    puppet.service - LSB: puppet agent Loaded: loaded (/etc/init.d/puppet; generated) Active: active (exited) since Tue 2022-10-11 132049 CEST; 2s ago Docs: man:systemd-sysv-generator(8) Process: 4053011 ExecStart=/etc/init.d/puppet start (code=exited, status=0/SUCCESS) but when i run puppet agent -t it says -bash: /bin/puppet: No such file or directory
  • j

    jms1

    10/11/2022, 1:07 PM
    another related pattern i've adopted is for each machine to set a custom
    role
    fact which ends up feeding into
    include "role::${xxx}"
    , so the "owner" of the machine (who has no access to the puppet servers) can do something like
    echo role=xyz > /etc/facter/facts.d/role.txt
    on the machine to tell puppet what "kind" of machine it is (since role classes are supposed to be "one per machine", and then you can add additional profile classes as needed)
  • h

    helindbe

    10/11/2022, 1:13 PM
    @jms1 look at docs for tthe
    new
    function for that version: https://github.com/puppetlabs/puppet/blob/4.5.2/lib/puppet/functions/new.rb#L386 says you can
  • h

    helindbe

    10/11/2022, 1:13 PM
    @jms1 look at docs for tthe
    new
    function for that version: https://github.com/puppetlabs/puppet/blob/4.5.2/lib/puppet/functions/new.rb#L386 says you can
  • r

    rismoney

    10/11/2022, 1:26 PM
    I am trying to understand https://tickets.puppetlabs.com/browse/MODULES-10808 - And how to fix it without using puppet generate types. According to the global types theory, the first loaded version of a Ruby resource type takes priority, and then subsequent requests to compile in other environments get that first-loaded. Not sure why there would be any variation between a first loaded type and a subsequent one, if those types are static between 2 environments.
  • v

    vchepkov

    10/11/2022, 1:40 PM
    what's wrong with generate types?
  • c

    CVQuesty

    10/11/2022, 1:41 PM
    yeah, that’s like “core toolbox”
  • c

    CVQuesty

    10/11/2022, 1:43 PM
    And keep in mind…. your Ruby is vendored with Puppet, so if you have a site_ruby as well, you’ll need to use puppet’s “generate types” so it knows whre to find its own, and not some other elsewhere on the system
  • h

    helindbe

    10/11/2022, 1:43 PM
    Unfortunately 4.5.2 does not have the
    convert_to
    function, but you can write something like this:
    Copy code
    Hash({"key1"=>1, "key2"=>2}.map()|$k,$v|{ if $k == "key1" {[$k,100]} else {[$k, $v]})
    in later version, it reads better when using `convert_to`:
    Copy code
    {"key1"=>1, "key2"=>2}.map()|$k,$v|{ if $k == "key1" {[$k,100]} else {[$k, $v]}).convert_to(Hash)
  • c

    CVQuesty

    10/11/2022, 1:44 PM
    The voice of experience is saying “you’re going to have a bad time if that happens”. That day was the longest week of my career. 😄
  • h

    helindbe

    10/11/2022, 1:44 PM
    The example transforms the input hash such that the resulting hash has “key1” set to 100.
  • d

    Dr Bunsen Honeydew

    10/11/2022, 1:45 PM
    letsplay 🧑‍🏫 Bolt is about to start up in #CFD8Z9A4T
  • h

    helindbe

    10/11/2022, 1:50 PM
    message has been deleted
  • r

    rismoney

    10/11/2022, 1:51 PM
    I think the issue with the types may have been to dir permissions. will retest. puppet generate types is difficult to run on dynamic envs unless you use r10k.
  • h

    helindbe

    10/11/2022, 2:01 PM
    This works in 4.5.2: Here is your pastebin example rewritten - it maps the hash to an arrray on the form [_[name, modified_attributes_hash], …]_ and then converts that to a hash where the names are keys - like in the input.
    Copy code
    $updated = Hash($items.map |$name, $attr| {
      [$name, {
        host => regsubst( $attr['host'] , 'old-domain' , 'new-domain' ),
        port => $attr['port'] + 1000,
        note => if $attr['note'] =~ Undef { '' } else {$attr['port']},
      }]
    }
  • h

    helindbe

    10/11/2022, 2:01 PM
    This works in 4.5.2: Here is your pastebin example rewritten - it maps the hash to an arrray on the form _[[name, modified_attributes_hash], …]_ and then converts that to a hash where the names are keys - like in the input.
    Copy code
    $updated = Hash($items.map |$name, $attr| {
      [$name, {
        host => regsubst( $attr['host'] , 'old-domain' , 'new-domain' ),
        port => $attr['port'] + 1000,
        note => if $attr['note'] =~ Undef { '' } else {$attr['port']},
      }]
    }
  • c

    CVQuesty

    10/11/2022, 2:05 PM
    I feel like you’re seeing how far you can pull me in…. Ok, I’ll bite… And why wouldn’t you use r10k?
  • c

    CVQuesty

    10/11/2022, 2:06 PM
    It’s become the de-facto standard way of deploying code both in Puppet Community and Puppet Enterprise in the form of Code Manager.
  • h

    helindbe

    10/11/2022, 2:15 PM
    @rismoney it is not only the version of the resource type itself, but also all the code that it requires that can clash between different environments. The first loaded sticks for the lifetime of that ruby virtual machine. Puppet Server may toss one out and create a new virtual machine - and then the first compile after that will stick. Result is highly unpredictable…
  • s

    Slackbot

    10/11/2022, 2:19 PM
    This message was deleted.
    h
    y
    k
    • 4
    • 13
1...192193194...428Latest