git-acp-ansible icon indicating copy to clipboard operation
git-acp-ansible copied to clipboard

Git backwards compatibility issue

Open peternixon opened this issue 11 months ago • 0 comments

I have the following ansible play:

- name: Add any new files to repo and push to GitLab
  delegate_to: localhost
  run_once: true
  environment:
    GIT_AUTHOR_NAME: "My Name"
    GIT_AUTHOR_EMAIL: "[email protected]"
    GIT_COMMITTER_NAME: "My Name"
    GIT_COMMITTER_EMAIL: "[email protected]"
  git_acp:
    comment: "Add new files"
    path: "/ansible-temp-files/myproject"
    url: 'https://{{gittoken}}@domain.com/myproject.git'
    add: [ "*.txt" ]
    pull: true

It throws the following error which I believe may be due to the elderly version of git installed on our Ansible Tower. Unfortunately I can't update the Tower at this time. Is it possible to update git_acp so that it is backwards compatible with git version 1.8.3.1?

{
    "rc": 129,
    "command": "/usr/bin/git -C /ansible-temp-files/myproject pull ******** main --no-edit",
    "stdout": "",
    "stderr": "Unknown option: -C\nusage: git [--version] [--help] [-c name=value]\n           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]\n           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n           <command> [<args>]\n",
    "msg": "Error in running '/usr/bin/git -C /ansible-temp-files/myproject pull ******** main --no-edit' command",
    "invocation": {
        "module_args": {
            "comment": "Add new files",
            "path": "/ansible-temp-files/myproject",
            "url": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "add": [
                "*.txt"
            ],
            "pull": true,
            "branch": "main",
            "pull_options": [
                "--no-edit"
            ],
            "push": true,
            "push_force": false,
            "executable": null,
            "ssh_params": null,
            "push_option": null
        }
    },
    "stdout_lines": [],
    "stderr_lines": [
        "Unknown option: -C",
        "usage: git [--version] [--help] [-c name=value]",
        "           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]",
        "           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]",
        "           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]",
        "           <command> [<args>]"
    ],
    "_ansible_no_log": false,
    "changed": false,
    "_ansible_delegated_vars": {
        "ansible_host": "localhost",
        "ansible_port": null,
        "ansible_user": "myuser",
        "ansible_connection": "local"
    }
}

peternixon avatar Mar 25 '24 00:03 peternixon