example42 / psick

Puppet Systems Infrastructure Construction Kit: The control-repo
http://www.example42.com
Apache License 2.0
655 stars 184 forks source link

Remote setup fails #93

Closed bryankennedy closed 7 years ago

bryankennedy commented 7 years ago

I wonder if I'm missing a step in the remote node setup process.

I've created a copy of the control-repo on my local dev machine. I then use the Fabric scripts to install Puppet on a remote machine (Ubuntu 16.04) with:

fab puppet.install -H example.com

This successfully installs puppet. However, when I then try to setup the repo on the remote node, with:

fab puppet.remote_setup -H example.com

I get an error:

Installing external modules via r10k

ERROR    -> No such file or directory @ rb_sysopen - /var/Puppetfile

I believe that that's because there is no Puppetfile at /etc/puppetlabs/code/environments/production

I thought maybe I needed to run deploy_controlrepo first. However when I try:

fab puppet.deploy_controlrepo -H

I get this error:

fatal: destination path '/etc/puppetlabs/code/environments/production' already exists and is not an empty directory.

Essentially the install process seems to be creating a production environment, that the scripts don't seem to expect. Obviously I could manually address all of this, I just wanted to see if I'm missing an intended step. Should the fab scripts be able to deal with this? Thanks for any guidance.

alvagante commented 7 years ago

Yes, there's probably an error in the way these script interact in different conditions. Will have to double check and fix this.

bryankennedy commented 7 years ago

OK, great. Just making sure I wasn't missing an obvious step on my part. There's a lot of great structure here. I really appreciate you open sourcing it.

alvagante commented 7 years ago

I've fixed some issues with remote setup, this procedure should work (tested on clean centos 7 ami):

fab puppet.install -H centos@34.251.252.125
fab puppet.deploy_controlrepo -H centos@34.251.252.125
fab puppet.apply -H centos@34.251.252.125

Note that this procedure clones the repo from github, it doesn't sync on the remote node the local control repo. TO do that you have to run, instead of puppet.deploy_controlrepo, :

fab puppet.sync_and_apply -H centos@34.251.252.125