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

    natemccurdy

    10/06/2022, 11:39 PM
    trace_enable
    is a parameter of the
    apache
    class: https://forge.puppet.com/modules/puppetlabs/apache/reference#trace_enable To specify a parameter when declaring a class, you can’t use the
    include
    function. You need to declare the class using the “resource-like” syntax. For example:
    Copy code
    class { 'apache':
      trace_enable => "off",
    }
  • w

    William Myers

    10/07/2022, 12:01 AM
    The require function is used for setting dependencies it appears? E.G. a specific package has to be installed before attempting to configure it.
  • n

    natemccurdy

    10/07/2022, 12:03 AM
    Using
    require <some_class>
    will automatically setup dependencies between the resources in
    <some_class>
    and the resources where
    <some_class>
    was declared so that
    <some_class>
    is enforced before the resources in the place where it was declared.
  • n

    natemccurdy

    10/07/2022, 12:04 AM
    It also includes
    <some_class>
    . So it’s a declaration and the auto-setup of relationships.
  • w

    William Myers

    10/07/2022, 12:05 AM
    Gotcha,, so it i had a class called apache_config and made it a requirement, it'd make sure to process apache_config first as well as load that class.
  • n

    natemccurdy

    10/07/2022, 12:05 AM
    yup
  • n

    natemccurdy

    10/07/2022, 12:06 AM
    More relevant reading: https://puppet.com/docs/puppet/7/lang_relationships.html
  • w

    William Myers

    10/07/2022, 12:32 AM
    Welp, declaring the class apache ended up with it overriding the virtualhosts and defaulting the config of the phpipam server, so that diddn't exactly work the way I intended. I'm assuming that I have two options? - Either define Hiera data for that server within the puppet class itself to fully define the intended configuration or write a puppet module that either lays down a static config file or injects/replaces line entries in an existing configuration file?
  • w

    William Myers

    10/07/2022, 12:32 AM
    Thank god for vm snapshots
  • w

    William Myers

    10/07/2022, 12:33 AM
    Welp, declaring the class apache ended up with it overriding the virtualhosts and defaulting the config of the phpipam server, so that diddn't exactly work the way I intended. I'm assuming that I have two options? - Either define Hiera data for that server within the puppet class itself to fully define the intended configuration or write a puppet module that either lays down a static config file or injects/replaces line entries in an existing configuration file?
  • s

    smortex

    10/07/2022, 12:34 AM
    Maybe check the
    purge_*
    parameters of the apache class. Generally a bad idea but when transitioning from managed by hand to managed by Puppet this can help 😉
  • s

    smortex

    10/07/2022, 12:35 AM
    Maybe check the
    purge_*
    parameters of the apache class. Generally a bad idea but when transitionning from manager by hand to managed by Puppet this can help 😉
  • s

    smortex

    10/07/2022, 12:35 AM
    e.g. https://github.com/puppetlabs/puppetlabs-apache/blob/main/REFERENCE.md#purge_configs
  • w

    William Myers

    10/07/2022, 12:37 AM
    Will this frequently cause weird issues if there is a blend of managed and unmanaged configuration items? I know that Terraform hates that.
    dead yes 1
  • s

    smortex

    10/07/2022, 12:37 AM
    Maybe check the
    purge_*
    parameters of the apache class. Generally a bad idea but when transitioning from managed by hand to managed by Puppet this can help 😉
  • w

    William Myers

    10/07/2022, 12:37 AM
    And won't properly manage things or apply new configurations if it's not something it initially provisioned.
  • w

    William Myers

    10/07/2022, 12:38 AM
    I don't have a production goal in mind, just mucking around and familiarizing myself with puppet at the moment.
  • s

    smortex

    10/07/2022, 12:39 AM
    I rarely used it, but when connecting a legacy server for managing it I have first classified the node to have our common apache config (so with
    purge_vhost_dir
    set to false). And then replaced the Vhosts 1 by 1. And then re-enabled purging.
  • s

    smortex

    10/07/2022, 12:40 AM
    I rarely used it, but when connecting a legacy server for managing it I have first classified the node to have our common apache config (so with
    purge_vhost_dir
    set to false). And then replaced the Vhosts 1 by 1. And then re-enabled purging.
  • w

    William Myers

    10/07/2022, 12:40 AM
    Thank you, I'll tinker with it some more tommorow.
  • s

    smortex

    10/07/2022, 12:41 AM
    by "replaced" I mean "integrated the vhost in the puppet config"
  • w

    William Myers

    10/07/2022, 12:41 AM
    I think that will be my eventual goal,
  • w

    William Myers

    10/07/2022, 12:42 AM
    would best practice be to add the config for each host to modules/apache directly and then use hiera for host/app specific configuration items?
  • w

    William Myers

    10/07/2022, 12:42 AM
    Opposed to trying to inject apache configuration data into an app-specific module?
  • w

    William Myers

    10/07/2022, 12:43 AM
    such as a module named phpipap that installs the server?
  • n

    natemccurdy

    10/07/2022, 12:45 AM
    would best practice be to add the config for each host to modules/apache directly
    No. You must not modify the apache module itself. Consider that off limits, and treat it like an upstream library that you’re using…. not modifying. You’d add Vhost configurations to a different, app-specific module that declares
    apache::vhost
    resources as needed.
  • z

    zipkid

    10/07/2022, 7:12 AM
    We use Foreman only to switch puppet_environment & look at puppetrun logs. Is there any alternative that is a bit lighter on resources?
  • b

    bastelfreak

    10/07/2022, 7:15 AM
    puppetboard?
  • f

    fe80

    10/07/2022, 7:17 AM
    choria/mcollective for switch environment ?
  • d

    Dr Bunsen Honeydew

    10/07/2022, 7:17 AM
    See the
    choria-mcollective
    module at https://forge.puppet.com/choria/mcollective?src=slack&amp;channel=puppet
1...188189190...428Latest