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

    VoxBot

    06/10/2022, 8:49 AM
    it's still part of the hash so I don't know why it thinks it's a string
  • b

    bastelfreak

    06/10/2022, 8:51 AM
    because the value you provide is a string
  • b

    bastelfreak

    06/10/2022, 8:51 AM
    Host $host
    and
    X-Real-IP $remote_addr
    are strings
  • b

    bastelfreak

    06/10/2022, 8:51 AM
    I didn't check the code, but it sounds like those need to be arrays
  • v

    VoxBot

    06/10/2022, 8:58 AM
    apologies, I don't tunderstand they are part of a 'hash' parameter, I ddin't think they would get evaluated like that as part of hash
  • b

    bastelfreak

    06/10/2022, 9:01 AM
    so you set this https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L231
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    so you set this https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L231
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    so you set this https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L231
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    which goes to https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L251
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    which goes to https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L251
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    which goes to https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/resource/server.pp#L334
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    which goes to https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/resource/server.pp#L334
  • b

    bastelfreak

    06/10/2022, 9:02 AM
    which is an array of strings
  • b

    bastelfreak

    06/10/2022, 9:03 AM
    Copy code
    nginx::nginx_servers:
      '<http://air.nonet.co.uk|air.nonet.co.uk>':
        proxy: '<https://stats.localnet.net>'
        proxy_set_header: ['Host $host']
        proxy_set_header: ['X-Real-IP $remote_addr']
  • b

    bastelfreak

    06/10/2022, 9:03 AM
    Copy code
    nginx::nginx_servers:
      '<http://air.nonet.co.uk|air.nonet.co.uk>':
        proxy: '<https://stats.localnet.net>'
        proxy_set_header: ['Host $host']
        proxy_set_header: ['X-Real-IP $remote_addr']
  • v

    VoxBot

    06/10/2022, 9:03 AM
    ahhhhhh
  • b

    bastelfreak

    06/10/2022, 9:04 AM
    and there are default values too: https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L150-L157
  • v

    VoxBot

    06/10/2022, 9:04 AM
    I get it, I think I see how that maps to the example you've put
  • b

    bastelfreak

    06/10/2022, 9:04 AM
    and there are default values too: https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L150-L157
  • b

    bastelfreak

    06/10/2022, 9:04 AM
    and there are default values too: https://github.com/voxpupuli/puppet-nginx/blob/5a95845240ba2feef119c15b27564b383c3ec53c/manifests/init.pp#L150-L157
  • v

    VoxBot

    06/10/2022, 9:07 AM
    let me digest that, I still have a few gaps but that's a great start to help my understand, thank you
  • v

    VoxBot

    06/10/2022, 9:20 AM
    in the two examples you've differentiated with the : after proxy_set why would they differ like that
  • v

    VoxBot

    06/10/2022, 9:21 AM
    surly the : is either neede or not
  • v

    VoxBot

    06/10/2022, 9:21 AM
    (or was it a typo)
  • b

    bastelfreak

    06/10/2022, 9:30 AM
    in hiera it's required. you have a hash
    nginx::nginx_servers
    where the values are strings and the keys hashes. the only value is
    <http://air.nonet.co.uk|air.nonet.co.uk>
    with the hash being the three options you provided. the first option in that hash,
    proxy
    , has a string has value, the other to keys,
    proxy_set_header
    and
    proxy_set_header
    (which I just notice is a duplicate) both contain arrays as values.
  • b

    bastelfreak

    06/10/2022, 9:31 AM
    so actually it should be:
    Copy code
    nginx::nginx_servers:
      '<http://air.nonet.co.uk|air.nonet.co.uk>':
        proxy: '<https://stats.localnet.net>'
        proxy_set_header: ['Host $host', 'X-Real-IP $remote_addr']
  • v

    VoxBot

    06/10/2022, 9:32 AM
    ok, so I don't need to set it twice, I just need to pass in the two params and class will loop through when generating the config
  • v

    VoxBot

    06/10/2022, 9:32 AM
    I'd missed that too
  • b

    bastelfreak

    06/10/2022, 9:32 AM
    yep
  • v

    VoxBot

    06/10/2022, 9:32 AM
    I'd totally missed that, so thank you that's saved me pain
1...656667...648Latest