Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from rgreinho/small-improvements
Browse files Browse the repository at this point in the history
Small improvements
  • Loading branch information
sbani committed Jul 21, 2015
2 parents bb3a529 + d6a956d commit b090905
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ script:
# Make sure Ansible is installed (yes, this is contrived, since Ansible was
# already installed via pip earlier...).
- "which ansible"
- "which ansible"

# Run the playbook for all users.
- 'ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo -e "liquidprompt_apply_all_users=True"'

# Ensure the liquidprompt bash file was copied system wide.
- >
[[ -f /etc/profile.d/liquidprompt.sh ]]
&& (echo 'System wide liquidprompt test: pass' && exit 0)
|| (echo 'System wide liquidprompt test: fail' && exit 1)
8 changes: 1 addition & 7 deletions tasks/all-users-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@
# Option 1: Add liquidprompt to all users

- name: Copy template
template: src=liquidprompt.bashrc.j2 dest=/etc/liquidprompt.bashrc owner=root

- name: Add source file to bashrc
lineinfile:
dest: /etc/bash.bashrc
line: "source /etc/liquidprompt.bashrc"
owner: root
template: src=liquidprompt.bashrc.j2 dest=/etc/profile.d/liquidprompt.sh owner=root
6 changes: 6 additions & 0 deletions tasks/install_packages_Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install packages for Debian
apt: name={{ item }} state=present update_cache=yes cache_valid_time=86400
when: ansible_pkg_mgr == 'apt'
with_items:
- git
6 changes: 6 additions & 0 deletions tasks/install_packages_RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install dependency packages for RedHat
yum: name={{ item }} state=present
when: ansible_pkg_mgr == 'yum'
with_items:
- git
9 changes: 8 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---
- include: install_packages_Debian.yml
sudo: yes
when: ansible_os_family == 'Debian'

- include: install_packages_RedHat.yml
sudo: yes
when: ansible_os_family == 'RedHat'

- name: Clone liquidprompt
git: "repo=https://github.com/nojhan/liquidprompt.git dest={{ liquidprompt_path }}"
Expand All @@ -7,4 +14,4 @@
when: liquidprompt_enable_all_users == true

- include: specific-users.yml
when: liquidprompt_enable_all_users == false
when: liquidprompt_enable_all_users == false

0 comments on commit b090905

Please sign in to comment.