Skip to content

git.latest seems to be doing something wrong #23845

Closed
@froztbyte

Description

So I don't quite understand where this is going wrong yet, but I'll provide all the details I have. I have the following state:

ensure we have a rancid user:
  user.present:
    - name: rancid
    - group: rancid

install rancid dependencies:
  pkg.installed:
    - pkgs:
      - git
      - perl5
      - expect
      - tcl
      - diffutils
      - cvs
      - tcl

create the rancid checkout directory:
  file.directory:
    - name: /srv/rancid-git
    - owner: rancid
    - group: rancid
    - require:
      - user: rancid

fetch dotwaffle rancid-git:
  git.latest:
    - name: https://github.com/dotwaffle/rancid-git.git
    - target: /srv/rancid-git
    - rev: 06dc499279db3346607dee07f4fc8f56c979f013
    - user: rancid
    - require:
      - pkg: install rancid dependencies
      - user: rancid

Running it as-is results in the following:

          ID: fetch dotwaffle rancid-git
    Function: git.latest
        Name: https://github.com/dotwaffle/rancid-git.git
      Result: False
     Comment: Command "git clone https://github.com/dotwaffle/rancid-git.git '/srv/rancid-git' " failed. Stderr: "fatal: I don't handle protocol '/home/rancid/https'"
     Started: 11:03:56.555587
    Duration: 21.176 ms
     Changes:

However, when I run this manually as follows, it does appear to work.

root@rancid:/srv# su -c "git clone https://github.com/dotwaffle/rancid-git.git '/srv/rancid-git'" rancid
Cloning into '/srv/rancid-git'...
remote: Counting objects: 3544, done.
remote: Total 3544 (delta 0), reused 0 (delta 0), pack-reused 3544
Receiving objects: 100% (3544/3544), 3.08 MiB | 714 KiB/s, done.
Resolving deltas: 100% (2485/2485), done.
root@rancid:/srv# (cd rancid-git; git log | head -n 1)
commit 06dc499279db3346607dee07f4fc8f56c979f013

I'd guess that maybe the actual command that's run is different from the command that's indicated (which is the only way I could see the protocol changing), but I'm not sure why yet.

Metadata

Assignees

No one assigned

    Labels

    DuplicateDuplicate of another issue or PR - will be closed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions