Skip to content

Commit 6ebe9da

Browse files
author
Gustavo Muniz do Carmo
committed
first commit
0 parents  commit 6ebe9da

File tree

8 files changed

+120
-0
lines changed

8 files changed

+120
-0
lines changed

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
language: python
3+
python: "3.6"
4+
5+
sudo: required
6+
7+
services:
8+
- docker
9+
10+
addons:
11+
apt:
12+
packages:
13+
- python-pip
14+
15+
install:
16+
- pip install ansible
17+
18+
before_script:
19+
- docker run --name xenial -d codeyourinfra/python3:xenial
20+
- docker run --name bionic -d codeyourinfra/python3:bionic
21+
22+
script:
23+
- ansible-playbook tests/test.yml -i tests/inventory
24+
25+
after_script:
26+
- docker stop xenial bionic
27+
- docker rm xenial bionic
28+
29+
notifications:
30+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Esign Consulting Ltda.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ansible
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub release](https://img.shields.io/github/release/codeyourinfra/ansible.svg)]() [![Build status](https://travis-ci.org/codeyourinfra/ansible.svg?branch=master)](https://travis-ci.org/codeyourinfra/ansible)
4+
5+
Ansible role to install [Ansible](https://www.ansible.com).
6+
7+
## Example Playbook
8+
9+
```yml
10+
---
11+
- hosts: servers
12+
roles:
13+
- codeyourinfra.ansible
14+
```
15+
16+
## Build process
17+
18+
The build process is performed in [Travis CI](https://travis-ci.org/codeyourinfra/ansible). During the build, the role is tested by using [Ubuntu Docker images with Python 3](https://hub.docker.com/r/codeyourinfra/python3).
19+
20+
## Author Information
21+
22+
[@gustavomcarmo](https://github.com/gustavomcarmo) is a contributor of [Codeyourinfra](https://github.com/codeyourinfra). Get on board too! :)

ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
roles_path=../

meta/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
galaxy_info:
2+
author: Gustavo Muniz do Carmo
3+
description: Role to install Ansible
4+
company: codeyourinfra.today
5+
license: MIT
6+
7+
min_ansible_version: 1.6
8+
9+
platforms:
10+
- name: Ubuntu
11+
versions:
12+
- bionic
13+
- xenial
14+
15+
galaxy_tags:
16+
- ansible
17+
18+
dependencies: []

tasks/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: Install PIP
3+
apt:
4+
name: python3-pip
5+
- name: Install Ansible
6+
pip:
7+
name: ansible
8+
state: latest

tests/inventory

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[containers]
2+
bionic
3+
xenial
4+
5+
[containers:vars]
6+
ansible_connection=docker
7+
ansible_python_interpreter=/usr/bin/python3

tests/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- hosts: containers
3+
roles:
4+
- ansible
5+
tasks:
6+
- name: Get Ansible version
7+
shell: ansible --version
8+
register: ansible_version_result
9+
- name: Assert Ansible version
10+
assert:
11+
that: ansible_version_result.stdout_lines[0] | regex_search('^ansible [\d.]+$') != ''
12+
msg: "Failure on Ansible installation"

0 commit comments

Comments
 (0)