Initial commit.

This commit is contained in:
Jeff Geerling 2014-06-07 11:05:13 -05:00
commit 7239a515e5
6 changed files with 116 additions and 0 deletions

35
.travis.yml Normal file
View File

@ -0,0 +1,35 @@
---
language: python
python: "2.7"
env:
- SITE=test.yml
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y curl
install:
# Install Ansible.
- pip install ansible==1.5.0
# Add ansible.cfg to pick up roles path.
- "printf '[defaults]\nroles_path = ../' > ansible.cfg"
script:
# Check the role/playbook's syntax.
- "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"
# 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=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Make sure Ansible is installed (yes, this is contrived, since Ansible was
# already installed via pip earlier...).
- "which ansible"

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Ansible Role: Ansible
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-ansible.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-ansible)
An Ansible Role that installs Ansible on RHEL/CentOS and Debian/Ubuntu.
## Requirements
If using on a RedHat/CentOS-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy).
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
TODO
## Dependencies
None.
## Example Playbook
- hosts: servers
roles:
- { role: geerlingguy.ansible }
## License
MIT / BSD
## Author Information
This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).

24
meta/main.yml Normal file
View File

@ -0,0 +1,24 @@
---
dependencies: []
galaxy_info:
author: geerlingguy
description: Ansible for RedHat/CentOS/Debian/Ubuntu.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 1.4
platforms:
- name: EL
versions:
- 6
- name: Debian
versions:
- all
- name: Ubuntu
versions:
- all
categories:
- system
- packaging
- development
- cloud

18
tasks/main.yml Normal file
View File

@ -0,0 +1,18 @@
---
# RedHat installation.
- name: Install Ansible (RedHat).
yum: pkg=ansible state=installed enablerepo=epel
when: ansible_os_family == 'RedHat'
# Debian installation.
- name: Add rquillo repository (Debian).
apt_repository: repo='ppa:rquillo/ansible'
when: ansible_os_family == 'Debian'
- name: Update apt cache (Debian).
apt: update_cache=yes cache_valid_time=86400
when: ansible_os_family == 'Debian'
- name: Install Ansible (Debian).
apt: pkg=ansible state=installed
when: ansible_os_family == 'Debian'

1
tests/inventory Normal file
View File

@ -0,0 +1 @@
localhost

5
tests/test.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-apache