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

    ssaini

    10/14/2022, 8:35 PM
    Thank your both for your inputs. I appreciate the guidance.
  • w

    William Myers

    10/14/2022, 9:42 PM
    I'm just getting started with Hiera today, could someone provide me with an example module that has some default value pairs defined in Hiera with a couple of hostname based overrides?
  • w

    William Myers

    10/14/2022, 9:44 PM
    My goal is to have a default set or values for my modules, with a few one-off overrides where needed for a single value
  • s

    Slackbot

    10/14/2022, 9:48 PM
    This message was deleted.
    b
    • 2
    • 2
  • w

    William Myers

    10/14/2022, 10:29 PM
    Are there some common practices/tools for automating the sync of a git repo/branch to a module on a puppetserver?
  • w

    William Myers

    10/14/2022, 10:34 PM
    Would that fall under the topic of CI?
  • n

    natemccurdy

    10/14/2022, 10:34 PM
    Yes. If you’re using Puppet Enterprise, you’d use Code Manager to sync your code to your Puppetservers, and some kind of webhook on your git server to trigger Code Manager. For open-source, the most common workflow uses a tool called
    r10k
    to sync your Puppet code on all your Puppetservers. You’d either setup a pull model, where you just run
    r10k
    every X minutes on each puppetserver, polling for changes to your code. Or in a push model, where you’d use some kind of webhook to trigger r10k remotely when your git repo is committed to. In both cases, Code Manager and
    r10k
    , you’re expected to use a “Control Repository” to maintain your custom Puppet code and any references to Forge modules. And each branch of your control repository gets deployed as a different Puppet environment.
  • n

    natemccurdy

    10/14/2022, 10:35 PM
    https://puppet.com/docs/pe/2019.8/managing_puppet_code.html covers most of this info, but that doc has a strong lean towards the Puppet Enterprise side of things. However, the concepts apply to both open-source and enterprise.
  • w

    William Myers

    10/14/2022, 10:35 PM
    Thank you! manually running git pull on each module doesn't scale well.
  • w

    William Myers

    10/14/2022, 10:36 PM
    what is the usual devops process. Develop module on a VM or container and test locally > acceptance test > promote to test branch> test> promote to prod branch?
  • w

    William Myers

    10/14/2022, 10:36 PM
    what is the usual devops process. Develop module on a VM or container and test locally > acceptance test > promote to test branch> test> promote to prod branch?
  • w

    William Myers

    10/14/2022, 10:37 PM
    or just having a canary/alpha environment on the puppetmaster?
  • n

    natemccurdy

    10/14/2022, 10:39 PM
    The simplest, and the one I normally recommend starting with, is a trunk-based git workflow where
    production
    is the main branch (and thus the main Puppet environment). People branch off of
    production
    to test some new feature or fix a bug, push their branch to the git server, which then causes Code Manager/r10k to deploy that feature branch as an environment on the Puppetservers. The developer can then do Puppet runs against that feature-branch environment to validate their change. When they’re done testing, they merge their branch into
    production
    .
    💯 3
  • w

    William Myers

    10/14/2022, 11:40 PM
    does module level hiera data take precedence over environment/node level?
  • w

    William Myers

    10/14/2022, 11:41 PM
    I have a value in a module level common.yaml I'm trying to override via env/data/nodes/nodename.yaml however it's not picking that value up
  • w

    William Myers

    10/14/2022, 11:42 PM
    I suppose having a hiera.yaml in that environment would have actually helped, lol.. figured it out
  • n

    NotStrong

    10/15/2022, 5:38 PM
    Hello, did you find your error ?
  • n

    NotStrong

    10/16/2022, 4:08 PM
    If someone can help me :
    Copy code
    2022-10-16T18:01:15.734+02:00 ERROR [qtp390913102-60] [puppetserver] Puppet Cached catalog for testpuppetserver1 failed: Could not find terminus testpuppetserver1 for indirection catalog
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:368:in `make_terminus'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:140:in `terminus'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/store_configs.rb:6:in `initialize'
    org/jruby/RubyClass.java:881:in `new'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:370:in `make_terminus'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:140:in `terminus'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:41:in `cache'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:265:in `find_in_cache'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:215:in `find'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:120:in `do_find'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:53:in `block in call'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:52:in `call'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/server/v3.rb:17:in `block in wrap'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
    org/jruby/RubyArray.java:1865:in `each'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:69:in `block in with_request_profiling'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:65:in `with_request_profiling'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `block in process'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:92:in `respond_to_errors'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:84:in `process'
    uri:classloader:/puppetserver-lib/puppet/server/master.rb:69:in `block in handleRequest'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
    /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override'
    uri:classloader:/puppetserver-lib/puppet/server/master.rb:68:in `handleRequest'
    termini install from package (ubuntu repos)
    Copy code
    root@testpuppetserver1:/var/log/puppetlabs/puppetserver# dpkg -l |grep puppetdb-termini
    ii  puppetdb-termini               7.11.2-1focal                     all          Termini for puppetdb
    puppetdb.conf
    Copy code
    [main]
    server_urls = <https://testpuppetserver1:8081>
    puppet.conf
    Copy code
    [server]
    vardir = /opt/puppetlabs/server/data/puppetserver
    logdir = /var/log/puppetlabs/puppetserver
    rundir = /var/run/puppetlabs/puppetserver
    pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
    codedir = /etc/puppetlabs/code
    storeconfigs = true
    storeconfigs_backend = testpuppetserver1
    reports = testpuppetserver1
    dns_alt_names = testpuppetserver1
    
    [main]
    noop = true
    server = testpuppetserver1
    splay = true
    report = true
    report_server = testpuppetserver1
    ignorecache=true
    certname = testpuppetserver1
    environment = dev
  • v

    vchepkov

    10/16/2022, 5:06 PM
    Why don't you use puppet to configure puppetserver ? theforeman/puppet is a good module
  • d

    Dr Bunsen Honeydew

    10/16/2022, 5:06 PM
    See the
    theforeman-puppet
    module at https://forge.puppet.com/theforeman/puppet?src=slack&amp;channel=puppet
  • n

    NotStrong

    10/16/2022, 7:02 PM
    @vchepkov I use ansible to initialize my puppet configuration
  • n

    NotStrong

    10/16/2022, 7:04 PM
    I will try to use this modul
  • s

    Slackbot

    10/16/2022, 7:23 PM
    This message was deleted.
    v
    n
    • 3
    • 2
  • s

    smortex

    10/16/2022, 8:03 PM
    @NotStrong
    storeconfigs_backend
    and
    reports
    are lists of handlers, not servers e.g.
    puppetdb,my_custom_termini
    https://puppet.com/docs/puppet/7/configuration.html#reports
  • s

    smortex

    10/16/2022, 8:04 PM
    I guess you are configuring puppetdb, they should be set to
    puppetdb
  • n

    NotStrong

    10/16/2022, 8:12 PM
    for me it's same server, i cant change the name ?
  • v

    vchepkov

    10/16/2022, 8:17 PM
    https://github.com/vchepkov/puppet-bootstrap
  • n

    NotStrong

    10/16/2022, 8:21 PM
    i change : add puppetdb in my
    /etc/hosts
    . Edit my config puppetdb.conf like :
    Copy code
    [main]
    server_urls = <https://puppetdb:8081>
    Change my puppet.conf like :
    Copy code
    storeconfigs = true
    storeconfigs_backend = puppetdb, testpuppetserver1
    reports = puppetdb, testpuppetserver1
  • n

    NotStrong

    10/16/2022, 8:22 PM
    i change : add puppetdb in my
    /etc/hosts
    . Edit my config puppetdb.conf like :
    Copy code
    [main]
    server_urls = <https://puppetdb:8081>
    Change my puppet.conf like :
    Copy code
    storeconfigs = true
    storeconfigs_backend = puppetdb, testpuppetserver1
    reports = puppetdb, testpuppetserver1
  • n

    NotStrong

    10/16/2022, 8:23 PM
    Strange, if i change "storeconfigs = true" to "storeconfigs = false" i have same error.
1...201202203...428Latest