Skip to content

Commit

Permalink
Merge pull request #1 from pedrocarmona/add-version-variable
Browse files Browse the repository at this point in the history
Add version variable
  • Loading branch information
pedrocarmona committed Jan 20, 2016
2 parents 56aa3c5 + 06c5f29 commit 63c26c8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 33 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ script:
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"

# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local"

# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
| grep -q 'changed=1.*failed=0'
ansible-playbook -i tests/inventory tests/$SITE --connection=local
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- >
git lfs version | awk -F' ' '{print $1}' | awk -F'/' '{print $2}'
| grep -q '1.1.0'
&& (echo 'version test: pass' && exit 0)
|| (echo 'version test: fail' && exit 1)
# Make sure git is installed and at the correct version.
- which git-lfs
- git lfs env
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ Sponsored by [BidMath](http://bidmath.com/)
```
## Usage notes
Added the git_lfs_install_vars variable to defaults, in order to provide the ability to not download files in LFS when you clone the repo. Currently is faster to clone a repo and then use git lfs pull, because git lfs pull has better implementation on download:
```yaml

- hosts: servers
roles:
- { role: pedrocarmona.github-git-lfs }
tasks:
- git: >
repo=git://foosball.example.org/path/to/repo.git
dest=repodir/
- command: git lfs pull
args:
chdir: repodir/
```
## License
MIT / BSD
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
git_lfs_install_vars: --skip-smudge
git_lfs_version: 1.1.0
4 changes: 2 additions & 2 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
- name: Ensure github git-lfs is installed (Debian)
apt:
name=git-lfs
state=latest
name=git-lfs={{ git_lfs_version }}
state=present
update_cache=yes
4 changes: 0 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@

- include: debian.yml
when: ansible_os_family == 'Debian'

- name: Git lfs install
sudo: false
command: git lfs install {{ git_lfs_install_vars }}
4 changes: 2 additions & 2 deletions tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- name: Ensure github git-lfs is installed (RedHat)
yum:
name=git-lfs
state=latest
name=git-lfs-{{ git_lfs_version }}
state=present
update_cache=yes
enablerepo=github_git-lfs
5 changes: 4 additions & 1 deletion tests/test-install-package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
- hosts: localhost
remote_user: root
sudo: true
vars:
user: deploy
group: deploy
roles:
- github-git-lfs

0 comments on commit 63c26c8

Please sign in to comment.