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

[WIP] Puppet apply provisioner #291

Conversation

ChrisLundquist
Copy link
Contributor

After looking at #83 and #197

I wanted to take a stab at a lower impact / more contained provisioner. After writing a shell provisioner it seemed like it could be done.

Currently this only sets up puppet 2.7 on ubuntu. It seems like moving to an omnibus installer would fix that up.

This works with hiera, but expects a hiera.yaml file somewhere in the directory tree. I wasn't sure if moving that to a template would be better.

The provisioner stanza in my .kitchen.yml looks like this

provisioner:
  name: puppet_apply
  manifests_path: /absolute/path/to/puppet/manifests
  modules_path: /absolute/path/to/puppet/modules
  hiera_data_path: /absolute/path/to/puppet/puppet/hieradata

manifests_path and modules_path first look in the currently directory tree, but I'm testing this on another code base so it is a little wonky. Note, you can't seem to use ~/path/puppet. If you do, nothing gets copied.

/cc @fnichol @jfryman
Do either of you know a good way to omnibus install puppet to fix this up?
What are your thought?
Are there use cases that I have overlooked?
What can we cleanup to make it more idiomatic?

@ericsakowski
Copy link

@ChrisLundquist I cloned this, swapped in a shell script I use to install PE 3.1.1 as opposed to the calls to apt, and was able to get it working. Two issues:

  1. To make it to work on CentOS I had to remove the sudo for 'puppet apply' (sudo -E doesn't work on Cent).
  2. Because of Net::SCP and OpenSSH scp -r not liking to scp into target directories that don't exist, I had to add a mkdir:
    def init_command
    "mkdir -p #{config[:root_path]}"
    end
    (which I stole from chef_base.rb)

...Not having that mkdir resulted in my modules getting copied into /tmp/kitchen/ntp, /tmp/kitchen/stdlib on the first run. On the second run, (kitchen converge default-centos-6-64 would fail the first run and work the second run) they would get to /tmp/kitchen/modules/ntp. It seemed net::scp was creating one dir in the path. I looked into patching net::scp or openssh but essentially gave up when I saw the OpenSSH team's FAQ saying they will not add anything to scp.

Anyway thanks for the PR and I hope this gets some traction!

@ChrisLundquist
Copy link
Contributor Author

@ericsakowski can you gist the shell script you used to bootstrap it on centos? I was thinking if we cover ubuntu and centos bootstrapping we're doing alright.

Adding that mkdir command seems safe enough.

P.S. I'm really happy to hear that this helped you!

@ericsakowski
Copy link

Since the script is for enterprise I should probably make sure I'm not
violating any licenses. I'll look into that. It won't do free puppet but
that's got some repos so shouldn't be too hard to script....if I get some
free time I can look into that as well.

On Wed, Jan 8, 2014 at 6:39 PM, Chris Lundquist notifications@github.comwrote:

@ericsakowski https://github.com/ericsakowski can you gist the shell
script you used to bootstrap it on centos? I was thinking if we cover
ubuntu and centos bootstrapping we're doing alright.

Adding that mkdir command seems safe enough.


Reply to this email directly or view it on GitHubhttps://github.com//pull/291#issuecomment-31888536
.

Eric Sakowski

@ericsakowski
Copy link

@neillturner neillturner mentioned this pull request Mar 21, 2014
@cheeseplus cheeseplus modified the milestones: 2.0, Accepted Major Jan 14, 2016
@cheeseplus
Copy link

Is this needed anymore with https://github.com/neillturner/kitchen-puppet ?

@cheeseplus cheeseplus removed this from the Accepted Major milestone Jan 14, 2016
@ChrisLundquist
Copy link
Contributor Author

two years is a long time.

@cheeseplus
Copy link

Totally, we've got some new maintainers so we're trying to clean house as part of the process. Apologies that it took so long for us to get back to you.

@ChrisLundquist
Copy link
Contributor Author

❤️ I might have done some of what I needed in neillturner/kitchen-puppet#1
Looks like it has become more popular since then.

BrentOnRails pushed a commit to BrentOnRails/test-kitchen that referenced this pull request Jul 17, 2017
@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants