Skip to content

Commit

Permalink
fix(ansible/git_lfs): fix git lfs installation steps (#3029)
Browse files Browse the repository at this point in the history
* fix(ansible): fix installation step of git-lfs role

Signed-off-by: yukke42 <[email protected]>

* docs: update readme

Signed-off-by: yukke42 <[email protected]>

* Update ansible/roles/git_lfs/README.md

Co-authored-by: M. Fatih Cırıt <[email protected]>

* fix: change steps to pass CI

Signed-off-by: yukke42 <[email protected]>

Signed-off-by: yukke42 <[email protected]>
Co-authored-by: M. Fatih Cırıt <[email protected]>
Co-authored-by: Kenji Miyake <[email protected]>
  • Loading branch information
3 people authored Nov 18, 2022
1 parent f0014fd commit bec22cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions ansible/roles/git_lfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ None.
## Manual Installation

```bash
sudo apt install git-lfs
git lfs install
```
29 changes: 14 additions & 15 deletions ansible/roles/git_lfs/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# https://github.com/git-lfs/git-lfs/wiki/Installation#debian-and-ubuntu
- name: Download script
ansible.builtin.get_url:
url: https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh
dest: /tmp/script.sh
mode: 0764

- name: Setup
become: true
environment:
os: "{{ ansible_distribution }}"
dist: "{{ ansible_distribution_release }}"
ansible.builtin.script: /tmp/script.sh

- name: Install Git LFS
become: true
ansible.builtin.apt:
name:
- git-lfs
name: git-lfs
state: latest
update_cache: true

# ref: https://github.com/ansible/ansible-lint/issues/1780
- name: Check if git lfs is installed # https://github.com/git-lfs/git-lfs/issues/901
git_config:
list_all: true
scope: global
register: git_global_config

- name: Setup Git LFS
command: git lfs install
when: "'filter.lfs.required' not in git_global_config.config_values"

0 comments on commit bec22cb

Please sign in to comment.