Skip to content

Instantly share code, notes, and snippets.

@ns408
Last active August 29, 2015 14:01
Show Gist options
  • Save ns408/97b1db4847e844484c15 to your computer and use it in GitHub Desktop.
Save ns408/97b1db4847e844484c15 to your computer and use it in GitHub Desktop.
/etc/r10k.yaml unable to use '/tmp/dir' as remote:
###Checkout a github repository with r10k layout:###
[root@itq tmp]# pwd
/tmp
[root@itq tmp]# rm -rf /tmp/puppet-r10k
[root@itq tmp]# git clone --bare https://github.com/ns408/puppet-r10k puppet-r10k
Initialized empty Git repository in /tmp/puppet-r10k/
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 34 (delta 8), reused 5 (delta 0)
Unpacking objects: 100% (34/34), done.
### Clear r10k cache ###
rm -rf /var/cache/r10k
### r10k configuration ###
[root@itq tmp]# cat /etc/r10k.yaml
---
:cachedir: /var/cache/r10k
:sources:
:local:
basedir: /etc/puppet/environments
remote: "/tmp/puppet-r10k"
### Puppetfile for production environment ###
forge "http://forge.puppetlabs.com"
mod "wordpress",
:git => "git://github.com/hunner/puppet-wordpress.git",
:ref => '0.4.0'
### Remove existing modules from production environment ###
[root@itq tmp]# rm -rf /etc/puppet/environments/production/modules/*
### Deploy the r10k production environment ###
[root@itq tmp]# r10k deploy environment production -pv
Faraday: you may want to install system_timer for reliable timeouts
[R10K::Task::Deployment::DeployEnvironments - INFO] Loading environments from all sources
[R10K::Task::Environment::Deploy - NOTICE] Deploying environment production
[R10K::Task::Puppetfile::Sync - INFO] Loading modules from Puppetfile into queue
[R10K::Task::Module::Sync - INFO] Deploying role into /etc/puppet/environments/production/modules
[R10K::Task::Deployment::PurgeEnvironments - INFO] Purging stale environments from /etc/puppet/environments
*Problem*:
I have defined the only 'wordpress' module in Puppetfile for production environment but on doing the 'production environment deployment', r10k is still deploying from the cache. The last remote: entry in r10k.yaml was pointing to a github repository which only had 'role' specified in its Puppetfile and that is what the r10k is still deploying.
@ns408
Copy link
Author

ns408 commented May 29, 2014

Damn! The following was supposed to be changed from
rm -rf /etc/puppet/environments/production/modules/*
to
rm -rf /etc/puppet/environments/production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment