Chocolatey and installing GIT

579 views
Skip to first unread message

Simon-Pierre Diamond

unread,
Sep 12, 2019, 3:27:48 PM9/12/19
to ansible...@googlegroups.com
Hi guys,

I am trying to install git with chocolatey using a playbook:

- name: Install GIT
  win_chocolatey:
    name: git
    state: present

It should be really simple when I run this. It should go through and no issues.

Although this gets quite tricky. 

I get the following error when running this:

"stdout_lines": [
        "Installing the following packages:",
        "git",
        "By installing you accept licenses for the packages.",
        "",
        "git.install v2.23.0 [Approved]",
        "git.install package files install completed. Performing other installation steps.",
        "Using Git LFS",
        "Installing 64-bit git.install...",
        "WARNING: User (you) cancelled the installation.",
        "ERROR: Running [\"C:\\ProgramData\\chocolatey\\lib\\git.install\\tools\\Git-2.23.0-64-bit.exe\" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP- /LOG /COMPONENTS=\"icons,assoc,assoc_sh,ext,ext\\shellhere,ext\\guihere,gitlfs,icons\\quicklaunch\" ] was not successful. Exit code was '5'. Exit code indicates the following: User (you) cancelled the installation..",
        "git not installed. An error occurred during installation:",
        " Exception of type 'System.OutOfMemoryException' was thrown.",
        "git package files install completed. Performing other installation steps.",
        "The install of git was NOT successful.",
        "git not installed. An error occurred during installation:",
        " Exception of type 'System.OutOfMemoryException' was thrown.",
        "",
        "Chocolatey installed 0/2 packages. 2 packages failed.",
        " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).",
        "",
        "Failures",
        " - git.install (exited 5) - Error while running 'C:\\ProgramData\\chocolatey\\lib\\git.install\\tools\\chocolateyInstall.ps1'.",
        " See log for details.",
        " - git (exited 1) - git not installed. An error occurred during installation:",
        " Exception of type 'System.OutOfMemoryException' was thrown."
    ]

Then when I look at the log, I can see this on the machine:
12 15:23:06,611 3344 [DEBUG] - Received arguments: install git --fail-on-unfound --yes --no-progress --limit-output --timeout 2700

If I run this manually in Powershell:
choco install git --fail-on-unfound --yes --no-progress --limit-output --timeout 2700

It works fine and super good.

I can only assume that it is the module. Anybody can help me with this?

-Simon

Jordan Borean

unread,
Sep 12, 2019, 9:12:36 PM9/12/19
to Ansible Project
This could be a result of a few things, what I would try is;

  • Use win_command to run 'choco install git --yes --no-progress'
    • If this fails then the error probably lies within the WinRM memory limits placed on a process
    • If it doesn't fail then something might be up with the module
  • Check if you can install any other chocolatey packages can be installed
    • If not, then something is up with your Chocolatey install
  • Try running with async, this should escape the WinRM memory limits I mentioned above
  • Have a look on the server when running your win_chocolatey task and see what is taking up all the memory (powershell.exe, choco.exe, or some other exe)
Thanks

Jordan

Simon-Pierre Diamond

unread,
Sep 13, 2019, 7:57:54 AM9/13/19
to Ansible Project
You are right Jordan, I could use win_command instead.

As of now, Git is the only software I need, and wanted it in an automated way, chocolatey was the easiest until that happens...

I will look into all that stuff, thank you, that should give me enough to look at.

Thank you!

-Simon

From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Jordan Borean <jbor...@gmail.com>
Sent: September 12, 2019 9:12 PM
To: Ansible Project <ansible...@googlegroups.com>
Subject: [EXTERNAL] [ansible-project] Re: Chocolatey and installing GIT
 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a522f223-58a0-49aa-9ed6-e4c70dfaf005%40googlegroups.com.

Simon-Pierre Diamond

unread,
Sep 13, 2019, 8:52:47 AM9/13/19
to Ansible Project
Hi Jordan,

Just for your information,

I guess I did not read the documentation properly, the winrm memory fix helped to run the everything through.

Although, it does not seem to work as expected. In the log I can see "  Software installed to 'C:\\Program Files\\Git\\'"

This is when I run ansible-playbook  with verbose. 

When I go and look on the server, the files are not present. which gets me wondering.

Also if I run the uninstall manually, it looks like git was not installed.

Anyway, I will probably just run win_command instead. But I figured I should state the issue here.

-Simon



From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Simon-Pierre Diamond <SDia...@harriscomputer.com>
Sent: September 13, 2019 7:57 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: Re: [EXTERNAL] [ansible-project] Re: Chocolatey and installing GIT
 

This message has been sent on behalf of a company that is part of the Harris Operating Group of Constellation Software Inc. These companies are listed here.
If you prefer not to be contacted by Harris Operating Group please notify us.

This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.

Reply all
Reply to author
Forward
0 new messages