Changing the repository in SCM resource


#1

Hello,

I have a following question. I deployed a bunch of scripts from several
git repositories using an SCM resource to a number of workstations. Now
I need to move some of repositories. I updated the repository attribute
of my resources to point to new locations, but chef-0.9.6 seems to
ignore the changes and tries to sync using old uri.

One solution is to delete the deployed repositories and run chef-client
to deploy them afresh. I sure there must be a better way. Folks?

Thanks in advance,
Dmitry


#2

Yo,

How did you update the attributes? If you used ‘default’ then chef
will not change a node’s attribute if it’s already there:
http://wiki.opscode.com/display/chef/Attributes

–Gilles

On Wed, Sep 8, 2010 at 12:29 AM, Dmitry V’yal akamaus@gmail.com wrote:

Hello,

I have a following question. I deployed a bunch of scripts from several git
repositories using an SCM resource to a number of workstations. Now I need
to move some of repositories. I updated the repository attribute of my
resources to point to new locations, but chef-0.9.6 seems to ignore the
changes and tries to sync using old uri.

One solution is to delete the deployed repositories and run chef-client to
deploy them afresh. I sure there must be a better way. Folks?

Thanks in advance,
Dmitry


#3

On 08.09.2010 20:55, Gilles Devaux wrote:

Yo,

How did you update the attributes? If you used ‘default’ then chef
will not change a node’s attribute if it’s already there:
http://wiki.opscode.com/display/chef/Attributes

–Gilles

well, by attributes I mean atributes of the scm resource, like here:

scm tool do
destination "#{node[:tools][:prefix]}/#{tool}"
repository "#{node[:tools][:repo]}/#{tool}"
action :sync
provider "git"
end

looks like chef doesn’t make sure the git remote of a cloned repo
matches the repository attribute provided. Is it a feature?

On Wed, Sep 8, 2010 at 12:29 AM, Dmitry V’yalakamaus@gmail.com wrote:

Hello,

I have a following question. I deployed a bunch of scripts from several git
repositories using an SCM resource to a number of workstations. Now I need
to move some of repositories. I updated the repository attribute of my
resources to point to new locations, but chef-0.9.6 seems to ignore the
changes and tries to sync using old uri.

One solution is to delete the deployed repositories and run chef-client to
deploy them afresh. I sure there must be a better way. Folks?

Thanks in advance,
Dmitry


#4

On Sun, Sep 12, 2010 at 3:29 AM, Dmitry V’yal akamaus@gmail.com wrote:

On 08.09.2010 20:55, Gilles Devaux wrote:

Yo,

How did you update the attributes? If you used ‘default’ then chef
will not change a node’s attribute if it’s already there:
http://wiki.opscode.com/display/chef/Attributes

–Gilles

well, by attributes I mean atributes of the scm resource, like here:

scm tool do
destination "#{node[:tools][:prefix]}/#{tool}"
repository "#{node[:tools][:repo]}/#{tool}"
action :sync
provider "git"
end

looks like chef doesn’t make sure the git remote of a cloned repo matches
the repository attribute provided. Is it a feature?

For the git provider, there was already a bug:

http://tickets.opscode.com/browse/CHEF-955

I just cloned the bug for Subversion as
http://tickets.opscode.com/browse/CHEF-1662, but I don’t have access to edit
bug descriptions so someone with more access than me might want to edit
that…

-Paul