Skip to content

Commit b3ce460

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

File tree

17 files changed

+214
-0
lines changed

17 files changed

+214
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*/__pycache__
2+
.vscode

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 -r requirements.txt
17+
18+
script:
19+
- molecule test
20+
21+
notifications:
22+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

.yamllint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
ignore: |
3+
**/lib/
4+
rules:
5+
line-length: disable

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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# postgres
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/postgres.svg)](https://github.com/codeyourinfra/postgres/releases/latest) [![Build status](https://travis-ci.org/codeyourinfra/postgres.svg?branch=master)](https://travis-ci.org/codeyourinfra/postgres) [![Ansible Role](https://img.shields.io/ansible/role/29234.svg)](https://galaxy.ansible.com/codeyourinfra/postgres) [![Ansible Role downloads](https://img.shields.io/ansible/role/d/29234.svg)](https://galaxy.ansible.com/codeyourinfra/postgres)
4+
5+
Ansible role to install [PostreSQL](https://www.postgresql.org).
6+
7+
## Example Playbook
8+
9+
```yml
10+
---
11+
- hosts: servers
12+
roles:
13+
- codeyourinfra.postgres
14+
```
15+
16+
The role requires the *ansible_distribution_release* variable, obtained through the [gathering facts phase](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#information-discovered-from-systems-facts). So please don't turn off facts.
17+
18+
## Build process
19+
20+
The build process is performed in [Travis CI](https://travis-ci.org/codeyourinfra/postgres). During the build, the role is tested by using [Molecule](https://molecule.readthedocs.io).
21+
22+
## Test yourself
23+
24+
Inside your [Python virtual environment](https://docs.python.org/3/tutorial/venv.html), run:
25+
26+
`pip install -r requirements.txt`
27+
28+
And then:
29+
30+
`molecule test`
31+
32+
## Author Information
33+
34+
[@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=../

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
postgres_version: 9.6

meta/main.yml

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

molecule/default/Dockerfile.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Molecule managed
2+
3+
{% if item.registry is defined %}
4+
FROM {{ item.registry.url }}/{{ item.image }}
5+
{% else %}
6+
FROM {{ item.image }}
7+
{% endif %}
8+
9+
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
10+
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \
11+
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
12+
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
13+
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
14+
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

molecule/default/INSTALL.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*******
2+
Docker driver installation guide
3+
*******
4+
5+
Requirements
6+
============
7+
8+
* General molecule dependencies (see https://molecule.readthedocs.io/en/latest/installation.html)
9+
* Docker Engine
10+
* docker-py
11+
* docker
12+
13+
Install
14+
=======
15+
16+
$ sudo pip install docker-py

0 commit comments

Comments
 (0)