Score:0

Puppet Vcsrepo (git) : getting error "exists and is not the desired repository."

hk flag

I am using vcsrepo with git to maintain a bunch of software on ubuntu systems. I use this bit of puppet code in a loop to keep the files up to date

      vcsrepo { "/usr/local/tools/$repo":
        ensure   => latest,
        provider => git,
        user     => 'tools',
        source   => "https://[email protected]/uoa/$repo.git";
      }

I was using latest and switched to present with no noticeable effect

I get Error: Path /usr/local/tools/common-library exists and is not the desired repository. on all my ubuntu systems except one old one still running 16.04

Vcsrepo version is 3.0.0 and puppet is at 5. Yes, I know these are old but this is out f my control My best guess is that something has changed in git.

Score:0
in flag

Yes, a CVE patch for git broke your existing config. This was released on Debian Buster in the past few days, causing breakage there on system puppet (5.5.10-4). There doesn't seem to be a patch available for vcsrepo 3.2.1, the latest with Puppet 5 support. I'm not sure why my Bullseye machines don't seem to be affected. As a workaround, this WFM:

once:

  case $::facts['os']['distro']['codename'] {
    'buster' : {
      concat { '/etc/gitconfig' :
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
      }
    }
  }

and then in my project-handling class:

  case $::facts['os']['distro']['codename'] {
    'buster' : {
      concat::fragment { "gitconfig_$project" :
        target  => '/etc/gitconfig',
        content => "[safe]\n\tdirectory = /usr/local/repos/$project\n\n",
        before  => Vcsrepo["/usr/local/repos/$project"],
      }
    }
  }

Obviously, adjusting variables for your OS/paths.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.