rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
693 stars 209 forks source link

r10k deletes the contents of /etc/puppet/environments if the sources:local:remote address is invalid #260

Closed Resisty closed 9 years ago

Resisty commented 9 years ago

I was testing out r10k, having heard good things, and attempted to deploy a new test environment, 'bobi':

# /usr/local/bin/r10k deploy environment bobi -p
Faraday: you may want to install system_timer for reliable timeouts
[R10K::TaskRunner - ERROR] Task #<R10K::Task::Deployment::DeployEnvironments:0x7f9306332250> failed while running: Couldn't update git cache for https://github.com/Resisty/r10k_environment: "fatal: could not read Username for 'https://github.com': No such device or address"
# vim /etc/r10k.yaml 
# /usr/local/bin/r10k deploy environment bobi -p
Faraday: you may want to install system_timer for reliable timeouts

Error while running: #<Errno::ENOENT: No such file or directory - getcwd>
# pwd
pwd: couldn't find directory entry in `..' with matching i-node
# cd ..
# pwd
pwd: couldn't find directory entry in `..' with matching i-node
# cd ..
# pwd
pwd: couldn't find directory entry in `..' with matching i-node
# cd ..
# pwd 
pwd: couldn't find directory entry in `..' with matching i-node
# cd ..
# pwd
/etc/puppet/environments
# ls -al
total 8
drwxr-xr-x  2 puppet puppet 4096 Oct  8 09:17 .
drwxr-xr-x 12 puppet puppet 4096 Oct  6 12:37 ..

As you can see, everything under /etc/puppet/environments was removed. Previously there was a production and several test environments.

Fortunately, I have a backup of /etc/puppet/environments/production, but this is a pretty egregious error.

carlossg commented 9 years ago

wrong repo?

Resisty commented 9 years ago

/facepalm