Compare commits
151 Commits
Author | SHA1 | Date | |
---|---|---|---|
d7ab4f5155 | |||
f03ca6d168 | |||
f417e1828d | |||
a412940e75 | |||
bda1f187c5 | |||
8adf037392 | |||
842d7c7826 | |||
77dcf468c3 | |||
5e1bbb4e0c | |||
7ac404854a | |||
88e1088d17 | |||
c8a6df17c6 | |||
17ec2c4152 | |||
8a3994cd38 | |||
fa2d5b9d8d | |||
5068645964 | |||
e06c5e24ef | |||
40ff2301fe | |||
f7ead2d3c6 | |||
5413342847 | |||
fe7df1f907 | |||
dea1634b98 | |||
b44e69ad7e | |||
|
e6d5c5a9a3 | ||
|
a0c761368d | ||
|
6c534bdf83 | ||
|
c94c86d963 | ||
|
3917b2a78b | ||
|
c6446c7e58 | ||
|
45e9ea744b | ||
|
1e99d8b02c | ||
|
f23f55643d | ||
|
4b7c659da1 | ||
|
f6f4658aef | ||
|
42900e46c4 | ||
|
436e824881 | ||
|
6522c7ef21 | ||
|
8a599c249f | ||
|
fdbc7c3908 | ||
|
1121b4534e | ||
|
16095bb031 | ||
|
8ef54f7f0d | ||
|
b33689d3b5 | ||
|
ea7487e2a9 | ||
|
2406ba62c1 | ||
|
9e1cb98351 | ||
|
dc504ad7d6 | ||
|
74b1c3483f | ||
|
b5685a90cd | ||
|
23d2def966 | ||
|
076db03bbe | ||
|
c9e2a83163 | ||
|
ff5533b940 | ||
|
9211b42147 | ||
|
4c2995e3d8 | ||
|
07f9750241 | ||
|
14ae8d9e14 | ||
|
ed6eb9ff29 | ||
|
92e30ec9ac | ||
|
f33225106e | ||
|
665d89beb0 | ||
|
4459ae1aa6 | ||
|
28fe4678d7 | ||
|
57633e39ad | ||
|
668d890ce6 | ||
|
71711119ea | ||
|
cdb741f701 | ||
|
fb3253da25 | ||
|
0211cfcd29 | ||
|
01d41dc596 | ||
|
5fd7fc7e1d | ||
|
3514236fa0 | ||
|
d9964134da | ||
|
9a971619a7 | ||
|
409e7f8bd2 | ||
|
6a760eb1dc | ||
|
684428ec80 | ||
|
3a93e6734d | ||
|
5ad5453892 | ||
|
8e1924e9e3 | ||
|
519a783810 | ||
|
5fc3bcaa2e | ||
|
dacd85ef41 | ||
|
7e8ec829c9 | ||
|
cc0eb0ce7c | ||
|
08003a20e3 | ||
|
2838871c2b | ||
|
498bb69af5 | ||
|
9e12212122 | ||
|
bf38884dcd | ||
|
2372221f93 | ||
|
a082c79f12 | ||
|
921231864f | ||
|
c7be6405e8 | ||
|
53acbaa7d7 | ||
|
055c1ed1a8 | ||
|
092a44d4d2 | ||
|
e216704e9f | ||
|
1b9b8e81a2 | ||
|
8b089d7fdc | ||
|
bd4c9ee55d | ||
|
bfb05f9f7e | ||
|
2a4c935222 | ||
|
fc1c881864 | ||
|
29fef2078c | ||
|
3cb19fc4d9 | ||
|
a3fb7e6a37 | ||
|
602f6e5953 | ||
|
34f4edf4c9 | ||
|
0b139944f6 | ||
|
41f5790f9a | ||
|
8735563651 | ||
|
f2e385868d | ||
|
52fc713404 | ||
|
747c7f30de | ||
|
e5782c903a | ||
|
3ea1b47038 | ||
|
cceaac7b86 | ||
|
21de58a20b | ||
|
376996d273 | ||
|
dfedd31efb | ||
|
0a9343b545 | ||
|
035f88cd21 | ||
|
8e687b3d68 | ||
|
a2b0a538b2 | ||
|
10813bd1f7 | ||
|
3e3e36f15b | ||
|
15f3e451a5 | ||
|
1e802edbc8 | ||
|
fe07d7b0cc | ||
|
2bd0a71e71 | ||
|
faa7d937cd | ||
|
14f4a05d3c | ||
|
f756c9c856 | ||
|
5e322d4a47 | ||
|
9b5a9fa983 | ||
|
407523e779 | ||
|
ab62958be3 | ||
|
e76415384a | ||
|
388d7e73b2 | ||
|
0968f7fea9 | ||
|
b7da27bbfc | ||
|
763bce5531 | ||
|
fdc0231cb7 | ||
|
dfa96b1ab0 | ||
|
4adab81038 | ||
|
fdf78b4e67 | ||
|
6be3640e95 | ||
|
6a0236c6d7 | ||
|
81886c8b69 | ||
|
9c658516cc |
74
.github/CODE_OF_CONDUCT.md
vendored
74
.github/CODE_OF_CONDUCT.md
vendored
@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [labs@idealista.com](mailto:labs@idealista.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
100
.github/CONTRIBUTING.md
vendored
100
.github/CONTRIBUTING.md
vendored
@ -1,100 +0,0 @@
|
||||
# Contributing to Idealista
|
||||
|
||||
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
||||
|
||||
The following is a set of guidelines for contributing to Idealista's repositories, which are hosted in the [Idealista Organization](https://github.com/idealista) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
#### Table Of Contents
|
||||
|
||||
[Code of Conduct](#code-of-conduct)
|
||||
|
||||
[How Can I Contribute?](#how-can-i-contribute)
|
||||
* [Reporting Bugs](#reporting-bugs)
|
||||
* [Suggesting Enhancements](#suggesting-enhancements)
|
||||
* [Pull Requests](#pull-requests)
|
||||
* [Changelog](#changelog)
|
||||
|
||||
[Styleguides](#styleguides)
|
||||
* [Git Commit Messages](#git-commit-messages)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project and everyone participating in it is governed by the [Idealista Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [labs@idealista.com](mailto:labs@idealista.com).
|
||||
|
||||
|
||||
## How Can I Contribute?
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
This section guides you through submitting a bug report for Idealista. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
|
||||
|
||||
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster.
|
||||
|
||||
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||
|
||||
#### Before Submitting A Bug Report
|
||||
|
||||
* **Check the last version.** Check if you can reproduce the problem in the latest version of the project.
|
||||
* **Check the FAQ of the project** for a list of common questions and problems.
|
||||
* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aidealista)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
#### How Do I Submit A (Good) Bug Report?
|
||||
|
||||
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on the project repository and provide the following information by filling in [the template](ISSUE_TEMPLATE.md).
|
||||
|
||||
Explain the problem and include additional details to help maintainers reproduce the problem:
|
||||
|
||||
* **Use a clear and descriptive title** for the issue to identify the problem.
|
||||
* **Describe the exact steps which reproduce the problem** in as many details as possible.
|
||||
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
||||
* **Explain which behavior you expected to see instead and why.**
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
This section guides you through submitting an enhancement suggestion for Idealista, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:.
|
||||
|
||||
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](ISSUE_TEMPLATE.md), including the steps that you imagine you would take if the feature you're requesting existed.
|
||||
|
||||
#### Before Submitting An Enhancement Suggestion
|
||||
|
||||
* **Check the last version.** Check if you can reproduce the problem in the latest version of the project.
|
||||
* **Check the FAQ of the project** for a list of common questions and problems.
|
||||
* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aidealista)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
#### How Do I Submit A (Good) Enhancement Suggestion?
|
||||
|
||||
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on the project repository and provide the following information by filling in [the template](ISSUE_TEMPLATE.md):
|
||||
|
||||
* **Use a clear and descriptive title** for the issue to identify the suggestion.
|
||||
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
||||
* **Provide specific examples to demonstrate the steps**.
|
||||
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
||||
* **Explain why this enhancement would be useful**.
|
||||
* **List some other text editors or applications where this enhancement exists.**
|
||||
* **Specify which version are you're using.**
|
||||
|
||||
### Pull Requests
|
||||
|
||||
* Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
|
||||
* Any pull request should have **idealista:develop** as base branch.
|
||||
|
||||
### Changelog
|
||||
|
||||
Every project has a CHANGELOG.md file. Once your code is ready to be merged please fill the issue after the **Unreleased** section as explained:
|
||||
|
||||
* For an enhancement, fill the issue after the **Added** subsection (create it if doesn't exists)
|
||||
* For a fixed bug, fill the issue after the **Fixed** subsection (create it if doesn't exists)
|
||||
* For an improvement, fill the issue after the **Changed** subsection (create it if doesn't exists)
|
||||
|
||||
Then write the issue info this way:
|
||||
|
||||
- *[#29](https://github.com/idealista/nginx-role/issues/29) Support debian stretch* @jmonterrubio
|
||||
|
||||
## Styleguides
|
||||
|
||||
### Git Commit Messages
|
||||
|
||||
* Use the present tense ("Add feature" not "Added feature")
|
||||
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
||||
* Limit the first line to 72 characters or less
|
||||
* Reference issues and pull requests liberally after the first line
|
36
.github/ISSUE_TEMPLATE.md
vendored
36
.github/ISSUE_TEMPLATE.md
vendored
@ -1,36 +0,0 @@
|
||||
<!--
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/cookiecutter-ansible-role/blob/master/.github/CODE_OF_CONDUCT.md
|
||||
|
||||
-->
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* [ ] Put an X between the brackets on this line if you have done all of the following:
|
||||
* Checked that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
* Checked that there is not already provided the described functionality
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:** [What you expect to happen]
|
||||
|
||||
**Actual behavior:** [What actually happens]
|
||||
|
||||
**Reproduces how often:** [What percentage of the time does it reproduce?]
|
||||
|
||||
### Versions
|
||||
|
||||
The version/s you notice the behavior.
|
||||
|
||||
### Additional Information
|
||||
|
||||
Any additional information, configuration or data that might be necessary to reproduce the issue.
|
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:**
|
||||
[What you expect to happen]
|
||||
|
||||
**Actual behavior:**
|
||||
[What actually happens]
|
||||
|
||||
**Reproduces how often:**
|
||||
[What percentage of the time does it reproduce?]
|
||||
|
||||
### Environment
|
||||
|
||||
- The release version/s you are using:
|
||||
- OS:
|
||||
- Others:
|
||||
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data that might be necessary to reproduce the issue.]
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
2
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
blank_issues_enabled: false
|
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Why is this needed?
|
||||
|
||||
[A clear and concise description of why do you think this is needed]
|
||||
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data.]
|
27
.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Refactor
|
||||
about: Found anything to refactor in this project?
|
||||
title: "[REFACTOR]"
|
||||
labels: clean-up
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Link/s to the specific code that needs a refactor (if applicable)
|
||||
|
||||
[Links]
|
27
.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Support Request
|
||||
about: Support request or question about this project
|
||||
title: "[SUPPORT]"
|
||||
labels: question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Additional Information
|
||||
|
||||
Any additional information, configuration or data that might be necessary to reproduce the issue.
|
26
.github/PULL_REQUEST_TEMPLATE.md
vendored
26
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,26 +0,0 @@
|
||||
### Requirements
|
||||
|
||||
* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
|
||||
* All new code requires tests to ensure against regressions
|
||||
* Remember to set **idealista:develop** as base branch;
|
||||
|
||||
### Description of the Change
|
||||
|
||||
<!--
|
||||
|
||||
We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
### Benefits
|
||||
|
||||
<!-- What benefits will be realized by the code change? -->
|
||||
|
||||
### Possible Drawbacks
|
||||
|
||||
<!-- What are the possible side-effects or negative impacts of the code change? -->
|
||||
|
||||
### Applicable Issues
|
||||
|
||||
<!-- Enter any applicable Issues here -->
|
1
.github/auto_assign.yml
vendored
1
.github/auto_assign.yml
vendored
@ -1,3 +1,4 @@
|
||||
---
|
||||
# Set to true to add reviewers to pull requests
|
||||
addReviewers: true
|
||||
|
||||
|
1
.github/stale.yml
vendored
1
.github/stale.yml
vendored
@ -1,3 +1,4 @@
|
||||
---
|
||||
issues:
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@ __pycache__
|
||||
*.iml
|
||||
.idea
|
||||
.project
|
||||
.venv
|
||||
|
||||
*.pyc
|
||||
|
||||
|
19
.travis.yml
19
.travis.yml
@ -1,16 +1,23 @@
|
||||
---
|
||||
dist: xenial
|
||||
dist: focal
|
||||
language: python
|
||||
python: "3.7"
|
||||
python: "3.10"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- pip3 install cookiecutter
|
||||
- pip install -I pipenv
|
||||
env:
|
||||
jobs:
|
||||
- MOLECULE_DISTRO=debian:stretch-slim
|
||||
- MOLECULE_DISTRO=debian:bullseye-slim
|
||||
- MOLECULE_DISTRO=debian:buster-slim
|
||||
|
||||
script:
|
||||
- ./test.sh
|
||||
- ./test.sh
|
||||
notifications:
|
||||
email:
|
||||
if: branch = master
|
||||
on_success: change
|
||||
on_failure: always
|
||||
recipients:
|
||||
- desarrollo.benders@idealista.com
|
||||
|
||||
|
71
CHANGELOG.md
71
CHANGELOG.md
@ -1,53 +1,46 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [2.1.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.2.0) (2020-11-10)
|
||||
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.1.0...2.2.0)
|
||||
### [1.1.1](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.1.0...v1.1.1) (2023-04-30)
|
||||
|
||||
### Fixed
|
||||
- *[#27](https://github.com/idealista/cookiecutter-ansible-role/issues/27) Adding Probot configuration to Ansible Role template* @dortegau
|
||||
## [1.1.0](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.3...v1.1.0) (2023-04-27)
|
||||
|
||||
### Changed
|
||||
- *[#27](https://github.com/idealista/cookiecutter-ansible-role/issues/27) Increase to 90 days the minimum days to declare a PR/Issue as `staled`* @dortegau
|
||||
- *[#32](https://github.com/idealista/cookiecutter-ansible-role/pull/32) Avoid closing automatically good first issues* @vicsufer
|
||||
|
||||
### Removed
|
||||
- *[#29](https://github.com/idealista/cookiecutter-ansible-role/issues/29) Removing redudant script in .travis.yml* @xtianae7
|
||||
### Features
|
||||
|
||||
## [2.1.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.1.0) (2020-10-19)
|
||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.0.0...2.1.0)
|
||||
* Better default configuration. ([bda1f18](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/bda1f187c5b2c02042c8d34ddde5bec5b77a13f9))
|
||||
|
||||
### Added
|
||||
- *[#20](https://github.com/idealista/cookiecutter-ansible-role/issues/20) Add basic configuration in order to enable Probot to delete automatically abandoned PRs/issues* @dortegau
|
||||
### Fixed
|
||||
- *[#23](https://github.com/idealista/cookiecutter-ansible-role/issues/23) Change references to branch master to main* @pgomezcaldito
|
||||
### [1.0.3](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.2...v1.0.3) (2023-02-16)
|
||||
|
||||
## [2.0.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.0.0) (2020-10-13)
|
||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.1...2.0.0)
|
||||
### Removed
|
||||
- *[#16](https://github.com/idealista/cookiecutter-ansible-role/issues/16) Remove debian jessie support* @pablogcaldito
|
||||
|
||||
### Added
|
||||
- *[#15](https://github.com/idealista/cookiecutter-ansible-role/issues/15) Add pipenv wrapper* @pablogcaldito
|
||||
- *Add boilerplate README.md* @vicsufer
|
||||
### Bug Fixes
|
||||
|
||||
## [1.0.1](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.1) (2020-09-17)
|
||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.0...1.0.1)
|
||||
### Removed
|
||||
- *[#9](https://github.com/idealista/cookiecutter-ansible-role/issues/9) Remove Vagrant pattern from role gitignore file* @vicsufer
|
||||
* add .venv to gitignore. ([c8a6df1](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/c8a6df17c6e8d286169a41067612ed4c0bedc687))
|
||||
* Correct closing brackets. ([88e1088](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/88e1088d178842e41ff545d23286dabcf8e675de))
|
||||
|
||||
### Added
|
||||
- *[#4](https://github.com/idealista/cookiecutter-ansible-role/issues/4) Upgrade to Goss v0.3.11* @pablogcaldito
|
||||
### [1.0.2](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.1...v1.0.2) (2023-01-12)
|
||||
|
||||
### Fixed
|
||||
- *[#11](https://github.com/idealista/cookiecutter-ansible-role/issues/11) Fix parameterization of PrivateTmp* @pablogcaldito
|
||||
- *[#7](https://github.com/idealista/cookiecutter-ansible-role/issues/7) Fix bug in in the check version task in install.yml* @pablogcaldito
|
||||
- *[#3](https://github.com/idealista/cookiecutter-ansible-role/issues/3) Fix typo in both contributing files* @pablogcaldito
|
||||
|
||||
## [1.0.0](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.0) (2020-04-28)
|
||||
### Bug Fixes
|
||||
|
||||
### Added
|
||||
- *First release* @pablogcaldito
|
||||
* More fix to README. ([fa2d5b9](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/fa2d5b9d8de10cd127797f7e1705c2e0b1ce98e0))
|
||||
|
||||
### [1.0.1](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.0...v1.0.1) (2023-01-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix main.yml. ([40ff230](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/40ff2301feb283894a71cca57a1d2679443b131b))
|
||||
* Update README ([e06c5e2](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/e06c5e24efaf43c2d2580d5dec0dc481d05b4ecc))
|
||||
|
||||
## 1.0.0 (2023-01-11)
|
||||
|
||||
### Features
|
||||
|
||||
* Refactor the template for docker-compose. ([b44e69a](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/b44e69ad7eaf1b3a0e284ac403c94c60c016a4ae))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* accolades ([dea1634](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/dea1634b98c99230166d00ab5451adad9d004ddf))
|
||||
* meta container version. ([fe7df1f](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/fe7df1f9073322a074489dcc5bfeb2397085dda7))
|
||||
|
20
README.md
20
README.md
@ -1,9 +1,7 @@
|
||||
# Cookiecutter Ansible Role
|
||||

|
||||
|
||||
[](https://travis-ci.org/idealista/cookiecutter-ansible-role)
|
||||
|
||||
|
||||
[](https://travis-ci.com/idealista/cookiecutter-ansible-role)
|
||||
|
||||
This cookiecutter generates an [ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html).
|
||||
|
||||
@ -31,7 +29,8 @@ You just need to have [pipenv](https://github.com/pypa/pipenv) installed.
|
||||
|
||||
## Usage
|
||||
|
||||
To generate your ansible role type ```printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter https://github.com/idealista/cookiecutter-ansible-role && rm Pipfile* requirements.txt```.
|
||||
To generate your ansible role type ```printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter https://github.com/idealista/cookiecutter-ansible-role && rm -rf Pipfile*
|
||||
requirements.txt && pipenv --rm && rm -rf requirements.txt```.
|
||||
|
||||
Then, introduce some parameters needed for generating it.
|
||||
|
||||
@ -46,15 +45,17 @@ github_user [idealista]:
|
||||
company [Idealista S.A.U.]:
|
||||
author []: pablogcaldito
|
||||
min_ansible_version []: 2.2
|
||||
ansible_version []: 2.8.8
|
||||
molecule_version []: 3.0.1
|
||||
python_docker_version []: 4.1.0
|
||||
ansible_lint_version []: 4.2.0
|
||||
ansible_version []: 5.2.0
|
||||
molecule_version []: 3.4.0
|
||||
python_docker_version []: 5.0.0
|
||||
molecule_docker_version []: 0.2.4
|
||||
ansible_lint_version []: 5.3.2
|
||||
yamllint_version []: 1.28.0
|
||||
license [Apache 2.0]:
|
||||
galaxy_tag_1 [example_tag1]: github_cli
|
||||
galaxy_tag_2 [example_tag2]: github
|
||||
galaxy_tag_3 [example_tag3]: cli
|
||||
Select debian_stretch_support:
|
||||
Select debian_bullseye_support:
|
||||
1 - True
|
||||
2 - False
|
||||
Choose from 1, 2 [1]:
|
||||
@ -79,6 +80,7 @@ Select has_templates:
|
||||
1 - True
|
||||
2 - False
|
||||
Choose from 1, 2 [1]:
|
||||
documentation_URL: https://cli.github.com/manual/
|
||||
```
|
||||
|
||||
It will create the following file structure:
|
||||
|
@ -1,5 +1,8 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- ./molecule
|
||||
- ./.travis.yml
|
||||
- ./.github
|
||||
parseable: true
|
||||
skip_list:
|
||||
- '204'
|
2
ansible-role-{{cookiecutter.app_name}}/.github/FUNDING.yml
vendored
Normal file
2
ansible-role-{{cookiecutter.app_name}}/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
github: {{ cookiecutter.github_user }}
|
||||
patreon: {{ cookiecutter.patreon_user }}
|
49
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
49
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:**
|
||||
[What you expect to happen]
|
||||
|
||||
**Actual behavior:**
|
||||
[What actually happens]
|
||||
|
||||
**Reproduces how often:**
|
||||
[What percentage of the time does it reproduce?]
|
||||
|
||||
### Environment
|
||||
|
||||
- The release version/s you are using:
|
||||
- OS:
|
||||
- Ansible Version:
|
||||
- Python Version:
|
||||
- Others:
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data that might be necessary to reproduce the issue.]
|
3
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
3
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
blank_issues_enabled: false
|
31
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
31
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Why is this needed?
|
||||
|
||||
[A clear and concise description of why do you think this is needed]
|
||||
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data.]
|
27
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
27
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Refactor
|
||||
about: Found anything to refactor in this project?
|
||||
title: "[REFACTOR]"
|
||||
labels: clean-up
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Link/s to the specific code that needs a refactor (if applicable)
|
||||
|
||||
[Links]
|
27
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
27
ansible-role-{{cookiecutter.app_name}}/.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Support Request
|
||||
about: Support request or question about this project
|
||||
title: "[SUPPORT]"
|
||||
labels: question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Additional Information
|
||||
|
||||
Any additional information, configuration or data that might be necessary to reproduce the issue.
|
@ -1,3 +1,4 @@
|
||||
---
|
||||
issues:
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
@ -3,9 +3,10 @@
|
||||
extends: default
|
||||
|
||||
ignore: |
|
||||
molecule/**/tests/
|
||||
.venv
|
||||
.github
|
||||
.travis.yml
|
||||
molecule/
|
||||
tests/
|
||||
|
||||
rules:
|
||||
braces:
|
||||
@ -20,20 +21,13 @@ rules:
|
||||
commas:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
comments: disable
|
||||
comments-indentation: disable
|
||||
document-start: disable
|
||||
empty-lines:
|
||||
max: 3
|
||||
level: error
|
||||
hyphens:
|
||||
level: error
|
||||
indentation: disable
|
||||
key-duplicates: enable
|
||||
line-length: disable
|
||||
new-line-at-end-of-file: disable
|
||||
new-lines:
|
||||
type: unix
|
||||
trailing-spaces: disable
|
||||
truthy: disable
|
||||
|
@ -3,16 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||
|
||||
## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/develop)
|
||||
## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/develop)
|
||||
### Changed
|
||||
### Added
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
## [X.Y.Z](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/X.Y.Z)
|
||||
### [Full Changelog](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/compare/1.0.0...X.Y.Z)
|
||||
## [X.Y.Z](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/X.Y.Z)
|
||||
### [Full Changelog](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/compare/1.0.0...X.Y.Z)
|
||||
### Changed
|
||||
*[#<issue_number>](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/<issue_number>) \<Change description\>* @\<author\>
|
||||
*[#<issue_number>](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/issues/<issue_number>) \<Change description\>* @\<author\>
|
||||
|
||||
## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0)
|
||||
## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/1.0.0)
|
||||
- Initial release
|
10
ansible-role-{{cookiecutter.app_name}}/LICENSE
Normal file
10
ansible-role-{{cookiecutter.app_name}}/LICENSE
Normal file
@ -0,0 +1,10 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © 2023 Laur IVAN
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
47
ansible-role-{{cookiecutter.app_name}}/README.md
Normal file
47
ansible-role-{{cookiecutter.app_name}}/README.md
Normal file
@ -0,0 +1,47 @@
|
||||
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
||||
|
||||
This role installs {{ cookiecutter.app_name | title }} via Docker compose.
|
||||
|
||||
## Requirements
|
||||
|
||||
None
|
||||
|
||||
## Role Variables
|
||||
|
||||
All variables are listed below (see also `defaults/main.yml`).
|
||||
|
||||
```yml
|
||||
---
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
You need a machine with docker and docker-compose installed.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
```yml
|
||||
- hosts: servers
|
||||
roles:
|
||||
- 'laurivan.{{ cookiecutter.app_name | replace('_',' ') }}'
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT](https://opensource.org/licenses/MIT) license - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||

|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2023 by [Laur Ivan](https://www.laurivan.com).
|
||||
|
||||
## Built With
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
24
ansible-role-{{cookiecutter.app_name}}/defaults/main.yml
Normal file
24
ansible-role-{{cookiecutter.app_name}}/defaults/main.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
## General
|
||||
{{ cookiecutter.app_name }}_image: {{ cookiecutter.app_name }}:latest
|
||||
|
||||
{{ cookiecutter.app_name }}_http_port: {{ cookiecutter.http_port }}
|
||||
|
||||
# {{ cookiecutter.app_name | title }} paths
|
||||
{{ cookiecutter.app_name }}_root_path: /var/local
|
||||
{{ cookiecutter.app_name }}_data_base: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/{{ cookiecutter.app_name }}"
|
||||
{{ cookiecutter.app_name }}_config_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/conf/{{ cookiecutter.app_name }}"
|
||||
|
||||
# Add other paths here to make sure they're created automatically
|
||||
#
|
||||
{{ cookiecutter.app_name }}_skeleton_paths:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path {% raw %}}}{% endraw %}"
|
||||
|
||||
# Add more templates to be copied into the config
|
||||
{{ cookiecutter.app_name }}_configuration_files:
|
||||
- "{% raw %}docker-compose.yml{% endraw %}"
|
||||
- "env.{{ cookiecutter.app_name }}.conf"
|
||||
|
||||
# Documentation
|
||||
{{ cookiecutter.app_name }}_documentation_link: "{{ cookiecutter.documentation_URL }}"
|
2
ansible-role-{{cookiecutter.app_name}}/handlers/main.yml
Normal file
2
ansible-role-{{cookiecutter.app_name}}/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# Handlers for {{ cookiecutter.app_name }}
|
24
ansible-role-{{cookiecutter.app_name}}/meta/main.yml
Normal file
24
ansible-role-{{cookiecutter.app_name}}/meta/main.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
galaxy_info:
|
||||
author: {{ cookiecutter.author }}
|
||||
namespace: {{ cookiecutter.namespace }}
|
||||
{% if cookiecutter.company != "" %} company: {{ cookiecutter.company }}{% endif %}
|
||||
role_name: {{ cookiecutter.app_name }}
|
||||
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
|
||||
min_ansible_version: "{{ cookiecutter.min_ansible_version }}"
|
||||
min_ansible_container_version: "{{ cookiecutter.min_ansible_container_version }}"
|
||||
license: {{ cookiecutter.license }}
|
||||
galaxy_tags:
|
||||
- {{ cookiecutter.galaxy_tag_1 }}
|
||||
- {{ cookiecutter.galaxy_tag_2 }}
|
||||
- {{ cookiecutter.galaxy_tag_3 }}
|
||||
platforms:{% if cookiecutter.platforms.debian_list %}
|
||||
- name: Debian
|
||||
versions:{% for ver in cookiecutter.platforms.debian_list %}
|
||||
- {{ ver }}{% endfor %}
|
||||
{% endif %}{% if cookiecutter.platforms.ubuntu_list %}
|
||||
- name: Ubuntu
|
||||
versions:{% for ver in cookiecutter.platforms.ubuntu_list %}
|
||||
- {{ ver }}{% endfor %}
|
||||
{% endif %}
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Clean up
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Load the defaults."
|
||||
ansible.builtin.include_vars:
|
||||
dir: "../../defaults"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Check if the docker-compose file exists."
|
||||
ansible.builtin.stat:
|
||||
path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/docker-compose.yml"
|
||||
register: "docker_compose_file"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Remove docker-compose."
|
||||
community.docker.docker_compose:
|
||||
project_src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/"
|
||||
build: false
|
||||
state: absent
|
||||
when: "docker_compose_file.stat.exists"
|
||||
become: false
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Remove the docker-compose file"
|
||||
ansible.builtin.file:
|
||||
path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/docker-compose.yml"
|
||||
state: "absent"
|
||||
when: "docker_compose_file.stat.exists"
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Converge"
|
||||
hosts: "{{ cookiecutter.app_name }}_group"
|
||||
roles:
|
||||
- role: "{{cookiecutter.namespace}}.{{ cookiecutter.app_name }}"
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Destroy"
|
||||
hosts: "localhost"
|
||||
connection: "local"
|
||||
gather_facts: false
|
||||
no_log: "{% raw %}{{ molecule_no_log }}{% endraw %}"
|
||||
tasks:
|
||||
# Developer must implement.
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Remove the docker image"
|
||||
community.docker.docker_container:
|
||||
name: "{{ cookiecutter.app_name }}"
|
||||
state: "absent"
|
||||
|
||||
# Mandatory configuration for Molecule to function.
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Populate instance config"
|
||||
ansible.builtin.set_fact:
|
||||
instance_conf: {}
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Dump instance config"
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
# Molecule managed
|
||||
{% raw %}{{ instance_conf | to_json | from_json | to_yaml }}{% endraw %}
|
||||
dest: "{% raw %}{{ molecule_instance_config }}{% endraw %}"
|
||||
mode: 0600
|
||||
when: "server.changed | default(false) | bool"
|
@ -1,6 +1,11 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
ignore-certs: true
|
||||
ignore-errors: true
|
||||
role-file: molecule/requirements.yml
|
||||
requirements-file: molecule/requirements.yml
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
@ -10,8 +15,9 @@ platforms:
|
||||
- name: {{ cookiecutter.app_name }}
|
||||
groups:
|
||||
- {{ cookiecutter.app_name }}_group
|
||||
image: ${MOLECULE_DISTRO:-debian:buster-slim}
|
||||
privileged: false
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
capabilities:
|
||||
- SYS_ADMIN
|
||||
tmpfs:
|
||||
@ -20,9 +26,12 @@ platforms:
|
||||
- /run/lock
|
||||
volumes:
|
||||
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
|
||||
- '/var/run/docker.sock:/tmp/docker_mounted.sock'
|
||||
command: '/lib/systemd/systemd'
|
||||
stop_signal: 'RTMIN+3'
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
||||
verifier:
|
||||
name: ansible
|
@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Setup the test machine"
|
||||
hosts: "{{ cookiecutter.app_name }}"
|
||||
tasks:
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Check if /var/run/docker.sock already exists"
|
||||
ansible.builtin.stat:
|
||||
path: "/var/run/docker.sock"
|
||||
register: "docker_sock_stat"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Create docker.sock"
|
||||
ansible.builtin.raw: touch /var/run/docker.sock
|
||||
become: true
|
||||
changed_when: false
|
||||
when: "not docker_sock_stat.stat.exists"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Move docker.sock from tmp"
|
||||
ansible.builtin.raw: >
|
||||
mount --move /tmp/docker_mounted.sock /var/run/docker.sock
|
||||
become: true
|
||||
changed_when: false
|
||||
when: "not docker_sock_stat.stat.exists"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Update apt cache."
|
||||
ansible.builtin.apt: update_cache=yes cache_valid_time=600
|
||||
when: "ansible_os_family == 'Debian'"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Install python requests"
|
||||
ansible.builtin.pip:
|
||||
name:
|
||||
- "requests"
|
||||
- "docker"
|
||||
- "docker-compose"
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Install docker"
|
||||
vars:
|
||||
docker_service_manage: false
|
||||
ansible.builtin.include_role:
|
||||
name: "geerlingguy.docker"
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
roles:
|
||||
- "geerlingguy.docker"
|
||||
collections: []
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
## TODO: Remember to adapt goss tests to your convenience
|
||||
|
||||
|
||||
## Check if ports are really exposed
|
||||
# port:
|
||||
# # Check port at IPv6
|
||||
# # https://github.com/aelsabbahy/goss/issues/177
|
||||
# tcp6:<port>:
|
||||
# listening: true
|
||||
# ip:
|
||||
# - '::'
|
@ -5,54 +5,55 @@
|
||||
|
||||
- name: Verify {{ cookiecutter.app_name | replace('_',' ') }}
|
||||
hosts:
|
||||
- {{ cookiecutter.app_name }}
|
||||
- "{{ cookiecutter.app_name }}"
|
||||
become: true
|
||||
vars:
|
||||
goss_version: v0.3.11
|
||||
goss_arch: amd64
|
||||
goss_dst: /usr/local/bin/goss
|
||||
goss_sha256sum: 7a751c102abac61fd8dff45f87f36c3732cb5158e1414ab78e6877864fc2f7a4
|
||||
goss_version: "v0.3.16"
|
||||
goss_arch: "amd64"
|
||||
goss_dst: "/usr/local/bin/goss"
|
||||
goss_sha256sum: "827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb"
|
||||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{% raw %}{{{% endraw %} goss_version {% raw %}}}{% endraw %}/goss-linux-{% raw %}{{{% endraw %} goss_arch {% raw %}}}{% endraw %}"
|
||||
goss_test_directory: /tmp
|
||||
goss_format: documentation
|
||||
goss_test_directory:" /tmp"
|
||||
goss_format: "documentation"
|
||||
|
||||
vars_files:
|
||||
- ../../defaults/main.yml
|
||||
|
||||
tasks:
|
||||
- name: Download and install Goss
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Download and install Goss"
|
||||
get_url:
|
||||
url: "{% raw %}{{{% endraw %} goss_url {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %}"
|
||||
sha256sum: "{% raw %}{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
||||
checksum: "sha256{% raw %}:{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
||||
mode: 0755
|
||||
register: download_goss
|
||||
until: download_goss is succeeded
|
||||
register: "download_goss"
|
||||
until: "download_goss is succeeded"
|
||||
retries: 3
|
||||
|
||||
- name: Copy Goss tests to remote
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Copy Goss tests to remote"
|
||||
template:
|
||||
src: "{% raw %}{{{% endraw %} item {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} goss_test_directory {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} item | basename {% raw %}}}{% endraw %}"
|
||||
with_fileglob:
|
||||
- "tests/test_*.yml"
|
||||
|
||||
- name: Register test files
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Register test files"
|
||||
shell: "ls {% raw %}{{{% endraw %} goss_test_directory {% raw %}}}{% endraw %}/test_*.yml"
|
||||
register: test_files
|
||||
register: "test_files"
|
||||
|
||||
- name: Execute Goss tests
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Execute Goss tests"
|
||||
command: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %} -g {% raw %}{{{% endraw %} item {% raw %}}}{% endraw %} validate --format {% raw %}{{{% endraw %} goss_format {% raw %}}}{% endraw %}"
|
||||
register: test_results
|
||||
register: "test_results"
|
||||
with_items: "{% raw %}{{{% endraw %} test_files.stdout_lines {% raw %}}}{% endraw %}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Display details about the Goss results
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Display details about the Goss results"
|
||||
debug:
|
||||
msg: "{% raw %}{{{% endraw %} item.stdout_lines {% raw %}}}{% endraw %}"
|
||||
with_items: "{% raw %}{{{% endraw %} test_results.results {% raw %}}}{% endraw %}"
|
||||
|
||||
- name: Fail when tests fail
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Fail when tests fail"
|
||||
fail:
|
||||
msg: "Goss failed to validate"
|
||||
when: item.rc != 0
|
||||
with_items: "{% raw %}{{{% endraw %} test_results.results {% raw %}}}{% endraw %}"
|
||||
with_items: "{% raw %}{{{% endraw %} test_results.results {% raw %}}}{% endraw %}"
|
24
ansible-role-{{cookiecutter.app_name}}/tasks/config.yml
Normal file
24
ansible-role-{{cookiecutter.app_name}}/tasks/config.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Set up directories"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{%raw%}{{{%endraw%} item }}"
|
||||
owner: "{%raw%}{{{%endraw%} ansible_effective_user_id {%raw%}}}{%endraw%}"
|
||||
group: "{%raw%}{{{%endraw%} ansible_effective_group_id {%raw%}}}{%endraw%}"
|
||||
mode: "0750"
|
||||
with_items:
|
||||
- "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_skeleton_paths {%raw%}}}{%endraw%}"
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
become: true
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Write configuration files"
|
||||
ansible.builtin.template:
|
||||
src: "{%raw%}{{{%endraw%} item {%raw%}}}{%endraw%}.j2"
|
||||
dest: "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {%raw%}}}{%endraw%}/{%raw%}{{{%endraw%} item {%raw%}}}{%endraw%}"
|
||||
mode: '0640'
|
||||
with_items:
|
||||
- "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_configuration_files {%raw%}}}{%endraw%}"
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
|
7
ansible-role-{{cookiecutter.app_name}}/tasks/install.yml
Normal file
7
ansible-role-{{cookiecutter.app_name}}/tasks/install.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} is running"
|
||||
community.docker.docker_compose:
|
||||
project_src: "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {%raw%}}}{%endraw%}"
|
||||
build: false
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
11
ansible-role-{{cookiecutter.app_name}}/tasks/main.yml
Normal file
11
ansible-role-{{cookiecutter.app_name}}/tasks/main.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Configure"
|
||||
import_tasks: config.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
|
||||
- name: "{{ cookiecutter.app_name | upper }} | Install"
|
||||
import_tasks: install.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
@ -0,0 +1,26 @@
|
||||
# {{ cookiecutter.app_name }} docker compose
|
||||
version: '3.9'
|
||||
services:
|
||||
{{ cookiecutter.app_name}}:
|
||||
image: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_image {% raw %}}}{% endraw %}"
|
||||
container_name: {{ cookiecutter.app_name }}-service
|
||||
restart: always
|
||||
env_file:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser {% raw %}}}{% endraw %}/env.{{ cookiecutter.app_name }}.conf"
|
||||
ports:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_http_port {% raw %}}}{% endraw %}"
|
||||
# Add more ports if necessary
|
||||
networks:
|
||||
- {{ cookiecutter.app_name }}-net
|
||||
# optional
|
||||
volumes:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_volume {% raw %}}}{% endraw %}"
|
||||
depends_on:
|
||||
- other
|
||||
- services
|
||||
|
||||
volumes:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_volume {% raw %}}}{% endraw %}"
|
||||
|
||||
networks:
|
||||
{{ cookiecutter.app_name }}-net: {}
|
@ -0,0 +1,2 @@
|
||||
# Add environment variables for {{ cookiecutter.app_name }} here
|
||||
# Note: This is a .ini file format
|
@ -0,0 +1,6 @@
|
||||
ansible=={{ cookiecutter.ansible_version }}
|
||||
molecule=={{ cookiecutter.molecule_version }}
|
||||
docker=={{ cookiecutter.python_docker_version }}
|
||||
molecule-docker=={{ cookiecutter.molecule_docker_version }}
|
||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
||||
yamllint=={{ cookiecutter.yamllint_version }}
|
@ -0,0 +1,3 @@
|
||||
*.yml linguist-detectable=true
|
||||
*.yaml linguist-detectable=true
|
||||
*.html linguist-detectable=false
|
@ -5,6 +5,7 @@ __pycache__
|
||||
.pytest_cache
|
||||
.molecule
|
||||
.cache
|
||||
.venv
|
||||
|
||||
*.iml
|
||||
.idea
|
@ -0,0 +1,25 @@
|
||||
---
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.9"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- pip install -I pipenv
|
||||
- pipenv sync
|
||||
env:
|
||||
jobs:
|
||||
{% if "buster" in cookiecutter.platforms.debian_list %}- MOLECULE_DISTRO=debian:buster-slim{% endif %}
|
||||
{% if "bullseye" in cookiecutter.platforms.debian_list %}- MOLECULE_DISTRO=debian:bullseye-slim{% endif %}
|
||||
script:
|
||||
- pipenv run molecule test --all
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
email:
|
||||
if: branch = main
|
||||
on_success: change
|
||||
on_failure: always
|
||||
recipients:
|
||||
- laur.ivan@gmail.com
|
@ -2,24 +2,30 @@
|
||||
"comment_0":"The role name will be the value you assign to app_name with _role appended",
|
||||
"comment_1":"Introduce in exec_name the executable file name, you can change it later in the defaults/main.yml if you don't know it",
|
||||
"app_name": "",
|
||||
"exec_name":"",
|
||||
"github_user": "idealista",
|
||||
"company": "Idealista S.A.U.",
|
||||
"author": "",
|
||||
"min_ansible_version": "",
|
||||
"ansible_version": "",
|
||||
"molecule_version": "",
|
||||
"python_docker_version": "",
|
||||
"ansible_lint_version":"",
|
||||
"license":"Apache 2.0",
|
||||
"galaxy_tag_1":"example_tag1",
|
||||
"galaxy_tag_2":"example_tag2",
|
||||
"galaxy_tag_3":"example_tag3",
|
||||
"debian_stretch_support":["True", "False"],
|
||||
"debian_buster_support":["True", "False"],
|
||||
"has_service":["True", "False"],
|
||||
"http_port": "3000",
|
||||
"github_user": "equinoxel",
|
||||
"patreon_user": "laurivan",
|
||||
"company": "",
|
||||
"author": "Laur Ivan (laur.ivan@gmail.com)",
|
||||
"namespace": "laurivan",
|
||||
"min_ansible_version": "2.4",
|
||||
"min_ansible_container_version": "2.4",
|
||||
"ansible_version": "7.2.0",
|
||||
"molecule_version": "4.0.4",
|
||||
"python_docker_version": "6.0.1",
|
||||
"molecule_docker_version": "2.1.0",
|
||||
"ansible_lint_version":"6.14.4",
|
||||
"yamllint_version": "1.30.0",
|
||||
"license":"MIT",
|
||||
"galaxy_tag_1":"tag1",
|
||||
"galaxy_tag_2":"tag2",
|
||||
"galaxy_tag_3":"tag3",
|
||||
"platforms": {
|
||||
"debian_list": ["bullseye", "buster"],
|
||||
"ubuntu_list": ["bionic", "focal", "jammy"]
|
||||
},
|
||||
"has_files":["True", "False"],
|
||||
"comment_2":"If there is service the following options will not have any effect",
|
||||
"has_handlers":["True", "False"],
|
||||
"has_templates":["True", "False"]
|
||||
"has_templates":["True", "False"],
|
||||
"documentation_URL":"https://www.laurivan.com"
|
||||
}
|
||||
|
@ -12,23 +12,21 @@ def checkInput():
|
||||
print("Error: app_name should not have _role or -role at the end, try again without it")
|
||||
print(" The name of the role will the value you introduce in app_name plus _role appended")
|
||||
sys.exit(1)
|
||||
if not moleculeVersion.startswith("3"):
|
||||
print("Error: Only supported molecule version 3.x.x, please change it and try again")
|
||||
if not (moleculeVersion.startswith("3") or moleculeVersion.startswith("4")):
|
||||
print("Error: Only supported molecule version 3.x.x or 4.x.x, please change it and try again")
|
||||
sys.exit(1)
|
||||
|
||||
def configureRole():
|
||||
# Remove or not the service
|
||||
if not {{ cookiecutter.has_service }}:
|
||||
# Delete the service and things that reference the service
|
||||
os.remove("tasks/service.yml")
|
||||
os.remove("templates/{{ cookiecutter.app_name }}.service.j2")
|
||||
shutil.rmtree("molecule/default/group_vars")
|
||||
# Remove or not the handlers folder
|
||||
if not {{ cookiecutter.has_handlers }}:
|
||||
shutil.rmtree("handlers")
|
||||
# Remove or not the templates folder
|
||||
if not {{ cookiecutter.has_templates }}:
|
||||
shutil.rmtree("templates")
|
||||
|
||||
shutil.rmtree("molecule/default/group_vars")
|
||||
# Remove or not the handlers folder
|
||||
if not {{ cookiecutter.has_handlers }}:
|
||||
shutil.rmtree("handlers")
|
||||
# Remove or not the templates folder
|
||||
if not {{ cookiecutter.has_templates }}:
|
||||
shutil.rmtree("templates")
|
||||
|
||||
# Remove or not the files folder
|
||||
if not {{ cookiecutter.has_files }}:
|
||||
shutil.rmtree("files")
|
||||
|
19
test.sh
19
test.sh
@ -3,7 +3,22 @@
|
||||
set -e
|
||||
|
||||
# Generate role
|
||||
printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" && rm Pipfile* requirements.txt
|
||||
printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input \
|
||||
app_name="github_cli" \
|
||||
exec_name="gh" \
|
||||
author="John Doe" \
|
||||
min_ansible_version="2.2" \
|
||||
ansible_version="5.2.0" \
|
||||
molecule_version="3.4.0" \
|
||||
python_docker_version="5.0.0" \
|
||||
molecule_docker_version="0.2.4" \
|
||||
ansible_lint_version="5.3.2" \
|
||||
yamllint_version="1.28.0" \
|
||||
has_files="False" \
|
||||
has_handlers="False" \
|
||||
has_templates="False" \
|
||||
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
|
||||
|
||||
(
|
||||
# Adjust the role to test
|
||||
cd github_cli_role
|
||||
@ -14,7 +29,7 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal
|
||||
# Launch molecule tests
|
||||
pipenv install -r test-requirements.txt --three
|
||||
pipenv run molecule test
|
||||
|
||||
|
||||
)
|
||||
# Cleanup
|
||||
rm -rf github_cli_role
|
||||
|
@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [labs@idealista.com](mailto:labs@idealista.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
@ -1,100 +0,0 @@
|
||||
# Contributing to Idealista
|
||||
|
||||
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
||||
|
||||
The following is a set of guidelines for contributing to Idealista's repositories, which are hosted in the [Idealista Organization](https://github.com/idealista) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
#### Table Of Contents
|
||||
|
||||
[Code of Conduct](#code-of-conduct)
|
||||
|
||||
[How Can I Contribute?](#how-can-i-contribute)
|
||||
* [Reporting Bugs](#reporting-bugs)
|
||||
* [Suggesting Enhancements](#suggesting-enhancements)
|
||||
* [Pull Requests](#pull-requests)
|
||||
* [Changelog](#changelog)
|
||||
|
||||
[Styleguides](#styleguides)
|
||||
* [Git Commit Messages](#git-commit-messages)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project and everyone participating in it is governed by the [Idealista Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [labs@idealista.com](mailto:labs@idealista.com).
|
||||
|
||||
|
||||
## How Can I Contribute?
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
This section guides you through submitting a bug report for Idealista. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
|
||||
|
||||
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster.
|
||||
|
||||
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||
|
||||
#### Before Submitting A Bug Report
|
||||
|
||||
* **Check the last version.** Check if you can reproduce the problem in the latest version of the project.
|
||||
* **Check the FAQ of the project** for a list of common questions and problems.
|
||||
* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aidealista)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
#### How Do I Submit A (Good) Bug Report?
|
||||
|
||||
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on the project repository and provide the following information by filling in [the template](ISSUE_TEMPLATE.md).
|
||||
|
||||
Explain the problem and include additional details to help maintainers reproduce the problem:
|
||||
|
||||
* **Use a clear and descriptive title** for the issue to identify the problem.
|
||||
* **Describe the exact steps which reproduce the problem** in as many details as possible.
|
||||
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
||||
* **Explain which behavior you expected to see instead and why.**
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
This section guides you through submitting an enhancement suggestion for Idealista, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:.
|
||||
|
||||
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](ISSUE_TEMPLATE.md), including the steps that you imagine you would take if the feature you're requesting existed.
|
||||
|
||||
#### Before Submitting An Enhancement Suggestion
|
||||
|
||||
* **Check the last version.** Check if you can reproduce the problem in the latest version of the project.
|
||||
* **Check the FAQ of the project** for a list of common questions and problems.
|
||||
* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aidealista)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
#### How Do I Submit A (Good) Enhancement Suggestion?
|
||||
|
||||
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on the project repository and provide the following information by filling in [the template](ISSUE_TEMPLATE.md):
|
||||
|
||||
* **Use a clear and descriptive title** for the issue to identify the suggestion.
|
||||
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
||||
* **Provide specific examples to demonstrate the steps**.
|
||||
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
||||
* **Explain why this enhancement would be useful**.
|
||||
* **List some other text editors or applications where this enhancement exists.**
|
||||
* **Specify which version are you're using.**
|
||||
|
||||
### Pull Requests
|
||||
|
||||
* Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
|
||||
* Any pull request should have **idealista:develop** as base branch.
|
||||
|
||||
### Changelog
|
||||
|
||||
Every project has a CHANGELOG.md file. Once your code is ready to be merged please fill the issue after the **Unreleased** section as explained:
|
||||
|
||||
* For an enhancement, fill the issue after the **Added** subsection (create it if doesn't exists)
|
||||
* For a fixed bug, fill the issue after the **Fixed** subsection (create it if doesn't exists)
|
||||
* For an improvement, fill the issue after the **Changed** subsection (create it if doesn't exists)
|
||||
|
||||
Then write the issue info this way:
|
||||
|
||||
- *[#29](https://github.com/idealista/nginx-role/issues/29) Support debian stretch* @jmonterrubio
|
||||
|
||||
## Styleguides
|
||||
|
||||
### Git Commit Messages
|
||||
|
||||
* Use the present tense ("Add feature" not "Added feature")
|
||||
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
||||
* Limit the first line to 72 characters or less
|
||||
* Reference issues and pull requests liberally after the first line
|
@ -1,32 +0,0 @@
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* [ ] Put an X between the brackets on this line if you have done all of the following:
|
||||
* Read [Idealista's Code of Conduct](https://github.com/idealista/{{ cookiecutter.app_name }}_role/blob/main/.github/CODE_OF_CONDUCT.md) and plan to comply with it
|
||||
* Checked that your issue isn't already filled: [issues](https://github.com/idealista/{{ cookiecutter.app_name }}_role/issues)
|
||||
* Checked that there is not already provided the described functionality
|
||||
|
||||
### Description
|
||||
<!-- Description of the issue -->
|
||||
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:**
|
||||
<!-- What you expect to happen -->
|
||||
|
||||
**Actual behavior:**
|
||||
<!-- What actually happens -->
|
||||
|
||||
**Reproduces how often:**
|
||||
<!-- What percentage of the time does it reproduce? -->
|
||||
### Versions
|
||||
<!-- The version/s you notice the behavior. -->
|
||||
|
||||
|
||||
### Additional Information
|
||||
<!-- Any additional information, configuration or data that might be necessary to reproduce the issue. -->
|
@ -1,26 +0,0 @@
|
||||
### Requirements
|
||||
|
||||
* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
|
||||
* All new code requires tests to ensure against regressions
|
||||
* Remember to set **idealista:develop** as base branch;
|
||||
|
||||
### Description of the Change
|
||||
|
||||
<!--
|
||||
|
||||
We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
### Benefits
|
||||
|
||||
<!-- What benefits will be realized by the code change? -->
|
||||
|
||||
### Possible Drawbacks
|
||||
|
||||
<!-- What are the possible side-effects or negative impacts of the code change? -->
|
||||
|
||||
### Applicable Issues
|
||||
|
||||
<!-- Enter any applicable Issues here -->
|
@ -1,67 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright {% now 'utc', '%Y' %} 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.
|
@ -1,109 +0,0 @@
|
||||
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
||||

|
||||
|
||||
[](https://travis-ci.com/idealista/{{ cookiecutter.app_name }}_role)
|
||||
[](https://galaxy.ansible.com/idealista/{{ cookiecutter.app_name }}_role)
|
||||
|
||||
|
||||
|
||||
This ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for the following Debian versions:
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}* Stretch{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}* Buster{% endif %}
|
||||
|
||||
This role has been generated using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) tool, you can generate a similar role that fits your needs using the this [cookiecutter template](https://github.com/idealista/cookiecutter-ansible-role).
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Prerequisities](#prerequisities)
|
||||
- [Installing](#installing)
|
||||
- [Usage](#usage)
|
||||
- [Testing](#testing)
|
||||
- [Built With](#built-with)
|
||||
- [Versioning](#versioning)
|
||||
- [Authors](#authors)
|
||||
- [License](#license)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
## Getting Started
|
||||
These instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install {{ cookiecutter.app_name | replace('_',' ') | title }} in a Debian system.
|
||||
|
||||
### Prerequisities
|
||||
|
||||
Ansible {{ cookiecutter.ansible_version }} version installed.
|
||||
|
||||
Molecule 3.x.x version installed.
|
||||
|
||||
For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Docker](https://www.docker.com/) as driver and [Goss] (https://github.com/aelsabbahy/goss) as verifier.
|
||||
|
||||
### Installing
|
||||
|
||||
Create or add to your roles dependency file (e.g requirements.yml):
|
||||
|
||||
```
|
||||
- src: idealista.{{ cookiecutter.app_name }}_role
|
||||
version: 1.0.0
|
||||
name: {{ cookiecutter.app_name }}_role
|
||||
```
|
||||
|
||||
Install the role with ansible-galaxy command:
|
||||
|
||||
```
|
||||
ansible-galaxy install -p roles -r requirements.yml -f
|
||||
```
|
||||
|
||||
Use in a playbook:
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: someserver
|
||||
roles:
|
||||
- role: {{ cookiecutter.app_name }}_role
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Look to the [defaults](defaults/main.yml) properties file to see the possible configuration properties, it is very likely that you will not need to override any variables.
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
### Install dependencies
|
||||
|
||||
```sh
|
||||
$ pipenv sync
|
||||
```
|
||||
|
||||
For more information read the [pipenv docs](ipenv-fork.readthedocs.io/en/latest/).
|
||||
|
||||
### Testing
|
||||
|
||||
```sh
|
||||
$ pipenv run molecule test
|
||||
```
|
||||
|
||||
## Built With
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Versioning
|
||||
|
||||
For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tags).
|
||||
|
||||
Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.
|
||||
|
||||
## Authors
|
||||
|
||||
* **Idealista** - *Work with* - [idealista](https://github.com/idealista)
|
||||
|
||||
See also the list of [contributors](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/contributors) who participated in this project.
|
||||
|
||||
## License
|
||||
|
||||

|
||||
|
||||
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
|
||||
|
||||
Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
@ -1,60 +0,0 @@
|
||||
---
|
||||
|
||||
## General
|
||||
# Version
|
||||
{{ cookiecutter.app_name }}_version: 1.0.0
|
||||
{{ cookiecutter.app_name }}_release_system: linux_amd64
|
||||
|
||||
# Package URL
|
||||
{{ cookiecutter.app_name }}_release_name: "exampleapplication_{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_version {% raw %}}}{% endraw %}_{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_system {% raw %}}}{% endraw %}"
|
||||
{{ cookiecutter.app_name }}_package: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_name {% raw %}}}{% endraw %}.tar.gz"
|
||||
{{ cookiecutter.app_name }}_url: "https://github.com/someuser/somerepo/releases/download/v{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_version {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package {% raw %}}}{% endraw %}"
|
||||
|
||||
# Package paths
|
||||
{{ cookiecutter.app_name }}_download_path: /usr/src
|
||||
{{ cookiecutter.app_name }}_package_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package {% raw %}}}{% endraw %}"
|
||||
{{ cookiecutter.app_name }}_src_bin: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_name {% raw %}}}{% endraw %}/bin/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
||||
|
||||
# Set true to force the download and installation of the binary
|
||||
{{ cookiecutter.app_name }}_force_reinstall: false
|
||||
|
||||
# Installation path
|
||||
{{ cookiecutter.app_name }}_root_path: /opt/{{ cookiecutter.app_name }}
|
||||
{{ cookiecutter.app_name }}_bin_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/bin"
|
||||
{{ cookiecutter.app_name }}_skeleton_paths:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}"
|
||||
{{ cookiecutter.app_name }}_exec_name: {{ cookiecutter.exec_name }}
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
## Service options
|
||||
# Documentation
|
||||
{{ cookiecutter.app_name }}_documentation_link: https://www.example.documentation.com
|
||||
|
||||
# Owner
|
||||
{{ cookiecutter.app_name }}_user: exampleuser
|
||||
{{ cookiecutter.app_name }}_group: examplegroup
|
||||
|
||||
# Maximum number of files limit
|
||||
{{ cookiecutter.app_name }}_max_files: 32768
|
||||
|
||||
# Start on boot
|
||||
{{ cookiecutter.app_name }}_service_enabled: True
|
||||
# Current state: started, stopped
|
||||
{{ cookiecutter.app_name }}_service_state: started
|
||||
|
||||
# Logs
|
||||
# If wanted to output the logs to a file define the following variable
|
||||
# More information at https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=
|
||||
# {{ cookiecutter.app_name }}_log_file: path_of_the_file
|
||||
{{ cookiecutter.app_name }}_log_output: "{% raw %}{%{% endraw %} if {{ cookiecutter.app_name }}_log_file is defined {% raw %}%}{% endraw %} file:{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_file {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} else {% raw %}%}{% endraw %} journal {% raw %}{%{% endraw %} endif {% raw %}%}{% endraw %}"
|
||||
|
||||
# Flags
|
||||
{{ cookiecutter.app_name }}_port: # the port exposed by the service goes here
|
||||
{{ cookiecutter.app_name }}_flag1_value: example_value_1
|
||||
{{ cookiecutter.app_name }}_flag2_value: example_value_2
|
||||
{{ cookiecutter.app_name }}_options:
|
||||
- "port {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_port {% raw %}}}{% endraw %}"
|
||||
- "flag1 {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_flag1_value {% raw %}}}{% endraw %}"
|
||||
- "flag2 {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_flag2_value {% raw %}}}{% endraw %}"
|
||||
|
||||
{{ cookiecutter.app_name }}_private_tmp: true
|
||||
{% endif %}
|
@ -1,8 +0,0 @@
|
||||
---
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
- name: restart {{ cookiecutter.app_name }}
|
||||
systemd:
|
||||
name: {{ cookiecutter.app_name }}
|
||||
state: restarted
|
||||
when: {{ cookiecutter.app_name }}_service_state != 'stopped'
|
||||
{% endif %}
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB |
@ -1,17 +0,0 @@
|
||||
---
|
||||
|
||||
galaxy_info:
|
||||
author: {{ cookiecutter.author }}
|
||||
company: {{ cookiecutter.company }}
|
||||
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
|
||||
min_ansible_version: {{ cookiecutter.min_ansible_version }}
|
||||
license: {{ cookiecutter.license }}
|
||||
galaxy-tags:
|
||||
- {{ cookiecutter.galaxy_tag_1 }}
|
||||
- {{ cookiecutter.galaxy_tag_2 }}
|
||||
- {{ cookiecutter.galaxy_tag_3 }}
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %}
|
@ -1,12 +0,0 @@
|
||||
# Molecule managed
|
||||
|
||||
{% raw %}{% if item.registry is defined %}
|
||||
FROM {{ item.registry.url }}/{{ item.image }}
|
||||
{% else %}
|
||||
FROM {{ item.image }}
|
||||
{% endif %}
|
||||
|
||||
# install minimal packages for debian slim images
|
||||
RUN apt-get update && \
|
||||
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
|
||||
apt-get clean{% endraw %}
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: {{ cookiecutter.app_name }}_group
|
||||
roles:
|
||||
- role: {{ cookiecutter.app_name }}_role
|
@ -1,36 +0,0 @@
|
||||
---
|
||||
|
||||
file:
|
||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}:
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
owner: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}
|
||||
group: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
||||
{% endif %}
|
||||
exists: true
|
||||
filetype: directory
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
# port:
|
||||
# # Check port at IPv6
|
||||
# # https://github.com/aelsabbahy/goss/issues/177
|
||||
# tcp6:{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_port {% raw %}}}{% endraw %}:
|
||||
# listening: true
|
||||
# ip:
|
||||
# - '::'
|
||||
|
||||
service:
|
||||
{{ cookiecutter.app_name }}:
|
||||
enabled: true
|
||||
running: true
|
||||
process:
|
||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}:
|
||||
running: true
|
||||
user:
|
||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}:
|
||||
exists: true
|
||||
groups:
|
||||
- {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
||||
shell: /usr/sbin/nologin
|
||||
group:
|
||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}:
|
||||
exists: true
|
||||
{% endif %}
|
@ -1 +0,0 @@
|
||||
---
|
@ -1,74 +0,0 @@
|
||||
---
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
- name: {{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} group
|
||||
group:
|
||||
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
system: yes
|
||||
state: present
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} user
|
||||
user:
|
||||
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
system: yes
|
||||
shell: /usr/sbin/nologin
|
||||
createhome: no
|
||||
{% endif %}
|
||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths
|
||||
file:
|
||||
dest: "{% raw %}{{{% endraw %} item {% raw %}}}{% endraw %}"
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
{% endif %}
|
||||
state: directory
|
||||
with_items:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton log paths
|
||||
file:
|
||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_path {% raw %}}}{% endraw %}"
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
{% endif %}
|
||||
state: file
|
||||
when: {{ cookiecutter.app_name }}_log_file is defined
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Check {{ cookiecutter.app_name }} version
|
||||
command: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} --version"
|
||||
register: {{ cookiecutter.app_name }}_check
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Download package
|
||||
get_url:
|
||||
url: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_url {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package_path {% raw %}}}{% endraw %}"
|
||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Extract downloaded package
|
||||
unarchive:
|
||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package_path {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}"
|
||||
remote_src: True
|
||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Copy binary
|
||||
copy:
|
||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_src_bin {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
{% endif %}
|
||||
remote_src: True
|
||||
mode: 0755
|
||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Link binary
|
||||
file:
|
||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
||||
dest: "/usr/bin/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
||||
state: link
|
||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Install
|
||||
include: install.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Configure
|
||||
include: config.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
- name: {{ cookiecutter.app_name | upper }} | Service
|
||||
include: service.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_service
|
||||
{% endif %}
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Copy Daemon script
|
||||
template:
|
||||
src: {{ cookiecutter.app_name }}.service.j2
|
||||
dest: /etc/systemd/system/{{ cookiecutter.app_name }}.service
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
notify: restart {{ cookiecutter.app_name }}
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Configuring service
|
||||
systemd:
|
||||
name: {{ cookiecutter.app_name }}
|
||||
state: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_state {% raw %}}}{% endraw %}"
|
||||
enabled: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_enabled {% raw %}}}{% endraw %}"
|
||||
daemon_reload: yes
|
@ -1,24 +0,0 @@
|
||||
{% raw %}{{ ansible_managed | comment }}{% endraw %}
|
||||
[Unit]
|
||||
Description={{ cookiecutter.app_name | replace('_',' ') }}
|
||||
Documentation={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_documentation_link {% raw %}}}{% endraw %}
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
PrivateTmp={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_private_tmp {% raw %}}}{% endraw %}
|
||||
User={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}
|
||||
Group={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
||||
RuntimeDirectory={{ cookiecutter.app_name }}
|
||||
LimitNOFILE={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_max_files {% raw %}}}{% endraw %}
|
||||
|
||||
ExecStart={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} for option in {{ cookiecutter.app_name }}_options {% raw %}%}{% endraw %}{% raw %}{%{% endraw %} if option {% raw %}%}{% endraw %}-{% raw %}{{{% endraw %} option {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} endif {% raw %}%}{% endraw %}{% raw %}{%{% endraw %} endfor {% raw %}%}{% endraw %}
|
||||
|
||||
StandardOutput={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_output {% raw %}}}{% endraw %}
|
||||
StandardError={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_output {% raw %}}}{% endraw %}
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillSignal=SIGTERM
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,4 +0,0 @@
|
||||
ansible=={{ cookiecutter.ansible_version }}
|
||||
molecule=={{ cookiecutter.molecule_version }}
|
||||
docker=={{ cookiecutter.python_docker_version }}
|
||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
@ -1,19 +0,0 @@
|
||||
---
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.7"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- pip install pipenv
|
||||
- pipenv sync
|
||||
env:
|
||||
jobs:
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}- MOLECULE_DISTRO=debian:stretch-slim{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}- MOLECULE_DISTRO=debian:buster-slim{% endif %}
|
||||
script:
|
||||
- pipenv run molecule test
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
Loading…
Reference in New Issue
Block a user