[chef] Re: Re: Need to copy a file after installation to another place


Chronological Thread 
  • From: Russell Bateman < >
  • To:
  • Subject: [chef] Re: Re: Need to copy a file after installation to another place
  • Date: Wed, 04 Sep 2013 12:11:20 -0600

Thanks for responding. I'm unclear on this. I'm copying a file from one place on the client node to another place on the client node. Which of these two places is "remote"?

On 9/4/2013 12:08 PM, Daniel DeLeo wrote:
" type="cite">

On Wednesday, September 4, 2013 at 11:06 AM, Russell Bateman wrote:

I'm creating a node in a MongoDB replica set that furnishes a) an arbiter, b) a configsvr and c) a sharding router. Unfortunately, as the binary that implements the arbiter and the configsvr are one and the same (mongod) and it cannot be multiply loaded, the customary action is to make a copy of it. This sort of thing is only done on testing instances (not in production).

So, one recipe installs MongoDB via the Debian package. mongod is on the path /usr/bin/mongod and I want to make a copy of it on the path /data/mongodb/bin/mongd. My configsvr.rb recipe ends with this:

# Copy /usr/bin/mongod to /data/mongodb/bin/mongod because a separate copy
# must exist in order for the configuration server's mongod instance not
# to conflict with the arbiter's instance. This copy will be referenced by
# /etc/init/mongodb-configsvr.conf.
file "/data/mongodb/bin/mongod" do
  action :create
  owner "mongodb"
  group "mongodb"
  mode 00755
  content IO.read( "/usr/bin/mongod" )
end

Sadly, this only creates a zero-length file.

I'm guessing this will be a Chef anti-pattern and I do want to hear the cat-calls, but I'd also like a solution.

Profuse thanks for reading this.

Best,

Russ
In Chef 11.6 you can use a `file:///` URL for a remote file to copy it from a local source.

-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§