Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird interaction with hiera? #194

Closed
ABrehm264 opened this issue Feb 9, 2018 · 1 comment
Closed

weird interaction with hiera? #194

ABrehm264 opened this issue Feb 9, 2018 · 1 comment

Comments

@ABrehm264
Copy link

ABrehm264 commented Feb 9, 2018

Howdy,

I think i'm holding this wrong, but I'm not exactly sure how, so I was hoping you could help me.

I'm trying to use hiera in order to store both encrypted and unencrypted data, but I'm getting this error:
Going to invoke puppet apply with:

         sudo -E /opt/puppetlabs/bin/puppet apply /tmp/kitchen/manifests/test/modules/test/manifests/test_cloud_jenkins_deploy.pp --modulepath=/tmp/kitchen/modules --fileserverconfig=/tmp/kitchen/fileserver.conf     --hiera_config=/tmp/kitchen/hiera.global.yaml --detailed-exitcodes      ; RC=$?; [ $RC -eq 2 ] && exit 0; exit $RC

   Notice: /File[/tmp/kitchen/hiera.global.yaml]: Not removing directory; use 'force' to override
   Notice: /File[/tmp/kitchen/hiera.global.yaml]: Not removing directory; use 'force' to override
   Error: Could not set 'file' on ensure: Is a directory @ rb_sysopen - /tmp/kitchen/hiera.global.yaml
   Error: Could not set 'file' on ensure: Is a directory @ rb_sysopen - /tmp/kitchen/hiera.global.yaml
   Wrapped exception:
   Is a directory @ rb_sysopen - /tmp/kitchen/hiera.global.yaml
   Error: /File[/tmp/kitchen/hiera.global.yaml]/ensure: change from 'directory' to 'file' failed: Could not set 'file' on ensure: Is a directory @ rb_sysopen - /tmp/kitchen/hiera.global.yaml
   Error: Could not prepare for execution: Got 1 failure(s) while initializing: File[/tmp/kitchen/hiera.global.yaml]: change from 'directory' to 'file' failed: Could not set 'file' on ensure: Is a directory @ rb_sysopen - /tmp/kitchen/hiera.global.yaml

I log onto the box and it is indeed a directory, which I would expect the code wasn't expecting:
image

My config looks like this:

---
driver:
  name: vagrant
  network:
  - ["forwarded_port", {guest: 8080, host: 8080, auto_correct: true}]

provisioner:
  name: puppet_apply
  manifests_path:  ./
  modules_path: ./

  hiera_data_path: ./hieradata
  hiera_config_path: ./
  hiera_eyaml: true
  hiera_eyaml_key_path: ./keys
  hiera_deep_merge: true

  require_puppet_repo: true
  require_chef_for_busser: false
  #puppet_debug: true
  #puppet_verbose: true
  install_custom_facts: true
  ignored_paths_from_root: []
  puppet_detailed_exitcodes: true
  puppet_whitelist_exit_code: 2
  #retry_on_exit_code:
  #  - 0
  #  - 4
  #  - 6
  #max_retries: 1

platforms:
  - name: puppetlabs/centos-7.2-64-nocm
    driver_plugin: vagrant

verifier:
  name: inspec

suites:
  - name: jenkins_deployer
    provisioner:
      manifest: test/modules/test/manifests/test_cloud_jenkins_deploy.pp

and my repository looks like this:
image

I've checked over the examples that are posted and searched github for more, but as of yet, I haven't been able to find anything that looked like they were using eyaml in their hieradata like I am; therefore I'm at a loss for what to do next, and was hoping you could help me.

Thanks,
Alex

@neillturner
Copy link
Owner

neillturner commented Sep 18, 2018

I tested with a hiera.gobal.yaml file and it worked ok.
make sure that sudo is not set to false in the .kitcen.yml file

sudo: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants