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

    Alex Fisher

    10/25/2022, 12:44 PM
    you're trying to lookup data from another module's hiera?
  • b

    bastelfreak

    10/25/2022, 12:45 PM
    The other way around. I'm in a module that has hiera data for puppet code in another module
  • a

    Alex Fisher

    10/25/2022, 12:45 PM
    Don't think that's valid.
  • b

    bastelfreak

    10/25/2022, 12:45 PM
    ha!
  • b

    bastelfreak

    10/25/2022, 12:46 PM
    "../modules/pg_hba_conf/data/nodes/%{trusted.certname}.yaml"
    so I've that in my environment hiera.yaml
  • a

    Alex Fisher

    10/25/2022, 12:46 PM
    "You can only bind data for keys in the module’s namespace" https://puppet.com/docs/puppet/7/hiera_intro.html#hiera_config_layers-module-layer
  • b

    bastelfreak

    10/25/2022, 12:46 PM
    which enables me to move some hiera data into another repo
  • b

    bastelfreak

    10/25/2022, 12:46 PM
    so I can grant some git permissions to other people. that works fine. It just looks confusing
  • a

    Alex Fisher

    10/25/2022, 12:47 PM
    and you can't use something like codeowners instead?
  • b

    bastelfreak

    10/25/2022, 12:48 PM
    there are still some plaintext passwords in the controlrepo that not everybody should see. So there is a dedicated repo just for postgresrelated hiera where some DBAs have access
  • b

    bastelfreak

    10/25/2022, 12:49 PM
    my controlrepo contains two modules,
    site/profile
    and
    site/role
    . All Hiera data in pg_hba_conf are for profiles in the controlrepo
  • b

    bastelfreak

    10/25/2022, 12:50 PM
    now I basically do in pg_hba_conf:
    git clone gitlab/controlrepo; ln -s controlrepo/site/profile spec/fixtures/modules/
  • b

    bastelfreak

    10/25/2022, 12:50 PM
    then I don't need to fiddle with any modulepath
  • b

    bastelfreak

    10/25/2022, 12:56 PM
    won't win any beauty contest, but works fine
  • a

    Alex Fisher

    10/25/2022, 12:57 PM
    it's perhaps confusing you've called that repo a 'module' then.
  • b

    bastelfreak

    10/25/2022, 12:57 PM
    ah sorry, yes
  • b

    bastelfreak

    10/25/2022, 12:58 PM
    well it's listed in the Puppetfile as module, but it's not really a module
  • a

    Alex Fisher

    10/25/2022, 12:58 PM
    and in the Puppetfile, you can override
    :install_path => '.'
  • b

    bastelfreak

    10/25/2022, 12:59 PM
    yes, but not in puppetlabs_spec_helper/.fixtures.yml
  • a

    Alex Fisher

    10/25/2022, 1:00 PM
    your fixtures can use a different hiera.yaml
  • b

    bastelfreak

    10/25/2022, 1:00 PM
    I'm writing tests in the repo where the hiera data lives, pg_hba_conf. it's not about getting hiera data, it's about getting the puppet code for the hiera data
  • a

    Alex Fisher

    10/25/2022, 1:00 PM
    module_path shouldn't be relevant, as it's effectively environment hiera if it's looked up by the environments hiera.yaml config.
  • a

    Alex Fisher

    10/25/2022, 1:02 PM
    The 'module' isn't really a module, but you want to write rspec-puppet tests for it?
  • c

    Craig Gumbley

    10/25/2022, 1:02 PM
    late to the party but when I need to do something like this i use the fixtures setup because everything is auto linked
  • a

    Alex Fisher

    10/25/2022, 1:04 PM
    I wrote a custom hiera validator gem that tests to see if hiera modified in a separate repo meets validation rules. Then a Jenkins jobs runs that and autoapproves PRs that pass the validation.
  • b

    bastelfreak

    10/25/2022, 1:05 PM
    I need to test if the hiera matches the custom puppet datatype
  • b

    bastelfreak

    10/25/2022, 1:06 PM
    previously they had typos and killed all the databases 😄
  • a

    Alex Fisher

    10/25/2022, 1:06 PM
    That's the sort of thing I do.
  • b

    bastelfreak

    10/25/2022, 1:07 PM
    but with the above symlink that's working fine. in theory .fixtures.yml would work as well, but it cannot put the directory
    site/profile
    from my controlrepo into
    spec/fixtures/modules
  • s

    Slackbot

    10/25/2022, 1:11 PM
    This message was deleted.
    m
    b
    c
    • 4
    • 37
1...167168169...648Latest