Skip to content

Commit

Permalink
Merge pull request #11 from idealista/develop
Browse files Browse the repository at this point in the history
v2.0.0 to master
  • Loading branch information
José Noguera authored Sep 11, 2018
2 parents a5e1b72 + b8c5678 commit 526e83a
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 48 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ tests/__pycache__
.molecule
.cache
.vagrant
tests/roles
tests/roles
.pytest_cache
15 changes: 13 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
---
language: python
python: "2.7.12"
python: "2.7.13"
group: deprecated-2017Q4

sudo: required
group: deprecated-2017Q4

env:
- ansible_version: 2.4.0.0
- ansible_version: 2.4.1.0
- ansible_version: 2.4.2.0
- ansible_version: 2.4.3.0
- ansible_version: 2.5.0.0

services:
- docker

install:
- pip install ansible==2.4.1.0
- pip install ansible==${ansible_version}
- pip install molecule==1.25.0
- pip install ansible-lint==3.4.20
- pip install testinfra==1.7.1
- pip install docker
script:
- molecule test --driver docker
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch

## [Unreleased](https://github.com/idealista/prom2teams-role/tree/develop)

## [2.0.0](https://github.com/idealista/prom2teams-role/tree/2.0.0)
[Full Changelog](https://github.com/idealista/prom2teams-role/compare/1.3.0...2.0.0)
### Added
- *[#9](https://github.com/idealista/prom2teams-role/issues/9) Ability of providing templates via playbook* @jnogol
### Changed
- *Update prom2teams version to 2.2.0* @jnogol
- *Update `.travis.yml` to test Ansible 2.4.x and 2.5.0.0* @jnogol
- *Ansible minimum version 2.4.0.0* @jnogol

## [1.3.0](https://github.com/idealista/prom2teams-role/tree/1.3.0)
[Full Changelog](https://github.com/idealista/prom2teams-role/compare/1.2.0...1.3.0)
### Changed
Expand All @@ -17,7 +26,6 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
### Changed
- *Update prom2teams version* @jnogol


## [1.0.0](https://github.com/idealista/prom2teams-role/tree/1.0.0)
### Added
- *First release*
46 changes: 14 additions & 32 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,17 @@ END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work

To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.


Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

/**
* Copyright Idealista S.A.U.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Copyright 2018 Idealista S.A.U.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# prom2teams Ansible role

This ansible role installs prom2teams in a debian environment.
This Ansible role installs prom2teams in a Debian environment.

- [Getting Started](#getting-started)
- [Prerequisities](#prerequisities)
Expand Down Expand Up @@ -43,6 +43,8 @@ or using [Ansible Galaxy](https://galaxy.ansible.com/idealista/prom2teams-role/)

```
- src: idealista.prom2teams-role
version: 1.0.0
name: prom2teams
```

Install the role with ansible-galaxy command:
Expand Down Expand Up @@ -78,7 +80,7 @@ prom2teams_webhook_urls:
molecule test --platform=Debian9
```

See molecule.yml to check possible testing platforms.
See `molecule.yml` to check possible testing platforms.

## Built With

Expand All @@ -98,9 +100,9 @@ See also the list of [contributors](https://github.com/idealista/prom2teams-role

## License

![Apache 2.0 Licence](https://img.shields.io/hexpm/l/plug.svg)
![Apache 2.0 License](https://img.shields.io/hexpm/l/plug.svg)

This project is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license - see the [LICENSE.txt](LICENSE.txt) file for details.
This project is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license - see the [LICENSE](LICENSE) file for details.

## Contributing

Expand Down
14 changes: 11 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---

## General
prom2teams_version: 2.0.0
prom2teams_version: 2.2.0
prom2teams_required_libs:
- python3
- python3-pip
Expand All @@ -14,7 +13,7 @@ prom2teams_group: prom2teams
prom2teams_service_state: started
prom2teams_service_enabled: True

# Files & Paths
## Prom2teams Files & Paths
prom2teams_config_folder: /etc/prom2teams
prom2teams_config_service_file: "{{ prom2teams_config_folder }}/uwsgi.ini"
prom2teams_config_file: "{{ prom2teams_config_folder }}/prom2teams.ini"
Expand All @@ -26,12 +25,21 @@ prom2teams_logs_absolute_path: "{{ prom2teams_logs_folder }}/prom2teams.log"

prom2teams_pid_file: /var/run/prom2teams/prom2teams.pid

## Files & Templates paths
prom2teams_wsgi_app_file_path: "wsgi.py"
prom2teams_ini_template_path: "prom2teams.ini.j2"
prom2teams_config_uwsgi_template_path: "uwsgi.ini.j2"
prom2teams_config_environment_template_path: "prom2teams.j2"
prom2teams_service_template_path: "prom2teams.service.j2"
# There is another one in the Logrotate section

## prom2teams configuration
prom2teams_socket: file # file | http
prom2teams_host: 0.0.0.0
prom2teams_port: 8089
prom2teams_name: "{{ ansible_hostname }}"
#prom2teams_template_path: # Define if needed
#prom2teams_groupalertsby: # Define if used

## UWSGI
prom2teams_uwsgi_processes: 5
Expand Down
8 changes: 4 additions & 4 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: prom2teams | Copy prom2teams ini configuration
template:
src: "prom2teams.ini.j2"
src: "{{ prom2teams_ini_template_path }}"
dest: "{{ prom2teams_config_folder }}/prom2teams.ini"
mode: 0640
owner: "{{ prom2teams_user }}"
Expand All @@ -21,7 +21,7 @@

- name: prom2teams | Copy prom2teams env configuration
template:
src: "prom2teams.j2"
src: "{{ prom2teams_config_environment_template_path }}"
dest: "{{ prom2teams_config_folder }}/prom2teams"
mode: 0640
owner: "{{ prom2teams_user }}"
Expand All @@ -30,7 +30,7 @@

- name: prom2teams | Copy prom2teams uwsgi configuration
template:
src: "uwsgi.ini.j2"
src: "{{ prom2teams_config_uwsgi_template_path }}"
dest: "{{ prom2teams_config_folder }}/uwsgi.ini"
mode: 0640
owner: "{{ prom2teams_user }}"
Expand All @@ -39,7 +39,7 @@

- name: prom2teams | Copy wsgi.py app runnable
copy:
src: wsgi.py
src: "{{ prom2teams_wsgi_app_file_path }}"
dest: "{{ prom2teams_uwsgi_runnable_path }}"
owner: "{{ prom2teams_user }}"
group: "{{ prom2teams_group }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

- name: prom2teams | Copy Daemon script
template:
src: "prom2teams.service.j2"
src: "{{ prom2teams_service_template_path }}"
dest: /lib/systemd/system/prom2teams.service
mode: 0644
notify: restart prom2teams
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
- name: prom2teams | Install
import_tasks: install.yml
tags:
- prom2teams_install
- install

- name: prom2teams | Config
import_tasks: config.yml
tags:
- prom2teams_config
- config

- name: prom2teams | Service
import_tasks: service.yml
tags:
- prom2teams_service
- service
5 changes: 5 additions & 0 deletions templates/prom2teams.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ Path: {{ prom2teams_logs_absolute_path }}
[Template]
Path: {{ prom2teams_template_path }} # default: app resources template
{% endif %}

{% if prom2teams_groupalertsby is defined %}
[Group Alerts]
Field: {{ prom2teams_groupalertsby }}
{% endif %}
2 changes: 2 additions & 0 deletions tests/group_vars/prom2teams/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ prom2teams_host: "{{ ansible_eth0.ipv4.address }}"
# Use this one for testing purposes
#prom2teams_host: "{{ ansible_eth1.ipv4.address }}"
prom2teams_port: 8001

prom2teams_groupalertsby: name

0 comments on commit 526e83a

Please sign in to comment.