Playbook de Ansible para instalar Git credential manager Core
El siguiente playbook instalará Git credential manager core (GCMCore) en distribuciones basadas en Ubuntu o Debian.
install-gcmcore.yml
---
- name: Install Git and Git Credential Manager
hosts: all
become: true
vars:
gcm_version: "2.6.1"
tasks:
- name: Install Git
apt:
name: git
state: present
- name: Check if GCM is already installed
command: dpkg-query -W git-credential-manager
register: gcm_check
failed_when: false
changed_when: false
- name: Download GCM .deb package
get_url:
url: "https://github.com/git-ecosystem/git-credential-manager/releases/download/v{{ gcm_version }}/gcm-linux_amd64.{{ gcm_version }}.deb"
dest: "/tmp/gcm-linux_amd64.{{ gcm_version }}.deb"
mode: '0644'
when: gcm_check.rc != 0 or gcm_check.stdout is not search(gcm_version ~ '*')
- name: Install GCM package
apt:
deb: "/tmp/gcm-linux_amd64.{{ gcm_version }}.deb"
state: present
when: gcm_check.rc != 0 or gcm_check.stdout is not search(gcm_version ~ '*')
- name: Clean up downloaded .deb file
file:
path: "/tmp/gcm-linux_amd64.{{ gcm_version }}.deb"
state: absent
when: gcm_check.rc != 0 or gcm_check.stdout is not search(gcm_version ~ '*')Si este artículo te ha ayudado, considera invitarme a un café o hacer una donación vía PayPal para apoyar la investigación y publicación de nuevos artículos en TechOverflow