Skip to content
Snippets Groups Projects

Ansible playbook for git v2.8.3

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Erick Hitter
    Edited
    git.yml 1.12 KiB
    ---
    - hosts: all
      become: yes
      become_user: root
      tasks:
      - name: Install Packages Needed To Compile git
        apt: pkg={{ item }} state=latest
        with_items:
          - libcurl4-openssl-dev
          - libexpat1-dev
          - gettext
          - zlib1g-dev
          - libssl-dev
          - build-essential
          - autoconf
    
      - name: Extract release
        become: no
        shell: curl -L --progress https://github.com/git/git/archive/v2.8.3.tar.gz | tar xz
        args:
          chdir: /usr/local/src/
          
      - name: Move source to canonical directory
        become: yes
        shell: rm -rf /usr/local/src/git/ && mv /usr/local/src/git-2.8.3/ /usr/local/src/git/
    
      - name: Make the buildconf
        become: no
        shell: make configure
        args:
          chdir: /usr/local/src/git
    
      - name: Configure the build
        become: no
        shell: ./configure
        args:
          chdir: /usr/local/src/git
    
      - name: Build git
        become: no
        shell: make prefix=/usr/local all
        args:
          chdir: /usr/local/src/git
    
      - name: Remove existing git
        apt: pkg=git state=absent purge=no
    
      - name: Install git
        shell: make prefix=/usr/local install
        args:
          chdir: /usr/local/src/git
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment