Skip to content

Commit

Permalink
Add anisble-galaxy configuration with timezone setup in common
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh Kumar committed Jul 18, 2015
1 parent fa385d9 commit 2ee38e3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
19 changes: 14 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
---
language: python
python: "2.7"

before_install:
# Make sure everything's up to date.
- sudo apt-get update -qq
sudo: true

install:
# Install Ansible.
- pip install ansible
- sudo pip install ansible
- sudo ansible-galaxy install -r requirements.yml

script:
# Check the role/playbook's syntax.
- ansible-playbook -i hosts playbook.yml --syntax-check

# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i hosts playbook.yml --connection=local --sudo -vvvv"

# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Make sure you have [vagrant] and virtualbox installed, then run:

```shell
sudo pip install ansible
sudo ansible-galaxy install -r requirements.yml
vagrant up
```

Expand All @@ -26,6 +27,11 @@ Login to the new machine with:
vagrant ssh
```

### Further Reading

1. https://docs.ansible.com/galaxy.html


[vagrant]: https://www.vagrantup.com/downloads.html

## Contributing
Expand Down
1 change: 0 additions & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- hosts: all
sudo: true
gather_facts: false

roles:
- common
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://docs.ansible.com/galaxy.html#advanced-control-over-role-requirements-files

# https://github.com/yatesr/ansible-timezone
- src: yatesr.timezone
3 changes: 3 additions & 0 deletions roles/common/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- { role: yatesr.timezone, timezone: Asia/Kolkata }
2 changes: 1 addition & 1 deletion roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
# roles/common/tasks/main.yml
- name: set system locale
- name: Set system locale
command: update-locale LC_ALL={{ lc_all }} LANG={{ lang }} LC_CTYPE={{ lc_ctype }} LC_COLLATE={{ lc_collate }}

0 comments on commit 2ee38e3

Please sign in to comment.