Compare commits

..

No commits in common. "develop" and "1.0.0" have entirely different histories.

48 changed files with 590 additions and 788 deletions

3
.gitattributes vendored
View File

@ -1,3 +0,0 @@
*.yml linguist-detectable=true
*.yaml linguist-detectable=true
*.html linguist-detectable=false

74
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1,74 @@
# 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 Normal file
View File

@ -0,0 +1,100 @@
# 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 has **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 Normal file
View File

@ -0,0 +1,36 @@
<!--
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.

View File

@ -1,48 +0,0 @@
---
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.]

View File

@ -1,2 +0,0 @@
---
blank_issues_enabled: false

View File

@ -1,31 +0,0 @@
---
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.]

View File

@ -1,27 +0,0 @@
---
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]

View File

@ -1,27 +0,0 @@
---
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 Normal file
View File

@ -0,0 +1,26 @@
### 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 -->

View File

@ -1,23 +0,0 @@
---
# Set to true to add reviewers to pull requests
addReviewers: true
# Set to true to add assignees to pull requests
addAssignees: false
# A list of team reviewers to be added to pull requests (GitHub team slug)
reviewers:
- idealista/reviewers
# Number of reviewers has no impact on Github teams
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
# Set to author to set pr creator as assignee
addAssignees: author
# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
- "WIP"
- "[WIP]"

33
.github/stale.yml vendored
View File

@ -1,33 +0,0 @@
---
issues:
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "pinned"
- "security"
- "good first issue"
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
pulls:
# Number of days of inactivity before a pull request becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale pull request is closed
daysUntilClose: 7
# Comment to post when marking a pull request as stale. Set to `false` to disable
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale pull request. Set to `false` to disable
closeComment: false

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ tests/.cache
__pycache__
.pytest_cache
.molecule
.vagrant
.cache
*.iml

View File

@ -1,23 +1,17 @@
---
dist: focal
dist: xenial
language: python
python: "3.10"
python: "3.7"
os: linux
services:
- docker
install:
- pip install -I pipenv
- pip3 install cookiecutter
env:
jobs:
- MOLECULE_DISTRO=debian:bullseye-slim
- MOLECULE_DISTRO=debian:jessie-slim
- MOLECULE_DISTRO=debian:stretch-slim
- MOLECULE_DISTRO=debian:buster-slim
script:
- ./test.sh
notifications:
email:
if: branch = master
on_success: change
on_failure: always
recipients:
- desarrollo.benders@idealista.com
- ./test.sh

View File

@ -1,229 +1,8 @@
# 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).
## Added
- *[#103](https://github.com/idealista/cookiecutter-ansible-role/pull/103) (2024-01-17)- Add ".gitattributes" file for linguist detection.* @ygomezsaiz
## Unreleased
## [2.10.2](https://github.com/idealista/cookiecutter-ansible-role/tree/2.10.2)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.10.1...2.10.2)
### Changed
- *[98](https://github.com/idealista/cookiecutter-ansible-role/issues/98)* Change goss URL @Marionv91
## [2.10.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.10.)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.10.0...2.10.1)
### Fixed
- *[95](https://github.com/idealista/cookiecutter-ansible-role/issues/95)* Failing travis test builds due to pipenv @ultraheroe
## [2.10.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.10.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.9.0...2.10.0)
### Changed
- *Improve README init scrips to avoid errors when create two roles on same path because already pipenv exists.* @adrian-arapiles
- *Change travis.yml order of email notification as documentation explains.* @adrian-arapiles
- *Add first line `---` to ansible-lint file because it's a yml.* @adrian-arapiles
### Fixed
- *[92](https://github.com/idealista/cookiecutter-ansible-role/issues/92) Fix meta.yml lint warning from `galaxy-tags` to `galaxy_tags`.* @adrian-arapiles
## [2.9.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.9.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.8.1...2.9.0)
### Changed
- *[#86](https://github.com/idealista/cookiecutter-ansible-role/issues/86) Upgrade molecule config to test under debian bullseye* @santi-eidu
- *[#86](https://github.com/idealista/cookiecutter-ansible-role/issues/86) Upgrade ansible to v5.2.0 and ansible lint to v5.3.2 to avoid lint error* @santi-eidu
## [2.8.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.8.1)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.8.0...2.8.1)
### Fixed
- *[#87](https://github.com/idealista/cookiecutter-ansible-role/issues/87) Travis build image and link are broken in the README template* @emepege
## [2.8.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.8.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.7.0...2.8.0)
### Added
- *[#81](https://github.com/idealista/cookiecutter-ansible-role/issues/81) Add log path variable in defaults* @blalop
- *[#79](https://github.com/idealista/cookiecutter-ansible-role/issues/79) Add molecule-docker support* @blalop
- *[#79](https://github.com/idealista/cookiecutter-ansible-role/issues/79) Add default versions for Python packages* @blalop
- *[#83](https://github.com/idealista/cookiecutter-ansible-role/issues/83) Don't leave empty lines when using jinja* @blalop
## [2.7.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.7.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.6.1...2.7.0)
### Added
- *[#76](https://github.com/idealista/cookiecutter-ansible-role/issues/76) Create shell user variable* @emepege
## [2.6.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.6.1)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.6.0...2.6.1)
### Changed
- *[#73](https://github.com/idealista/cookiecutter-ansible-role/issues/73) Add document start to .yml files* @blalop
## [2.6.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.6.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.5.1...2.6.0)
### Added
- *[#69](https://github.com/idealista/cookiecutter-ansible-role/issues/69) Email notifications in travis.* @vicsufer
### Changed
### Fixed
- *[#67](https://github.com/idealista/cookiecutter-ansible-role/issues/67) fix needed task in check_mode- @vicsufer
### Removed
## [2.5.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.5.1)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.5.0...2.5.1)
### Changed
- *[#63](https://github.com/idealista/cookiecutter-ansible-role/issues/63) Ignore html in gitattributes file* @blalop
### Fixed
- *[#62](https://github.com/idealista/cookiecutter-ansible-role/issues/62) molecule verify fails and breaks the run when at least one test fail* @ultraheroe
- *[#60](https://github.com/idealista/cookiecutter-ansible-role/issues/60) [BUG] Wrong state option in "Ensure skeleton log paths" task* @emepege
## [2.5.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.5.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.4.1...2.5.0)
### Added
- *[#57](https://github.com/idealista/cookiecutter-ansible-role/issues/57) Added gitattributes file* @blalop
### Changed
- *[#55](https://github.com/idealista/cookiecutter-ansible-role/issues/55) Excluded non-role files from linting* @blalop
## [2.4.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.4.1)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.4.0...2.4.1)
### Fixed
- *[#50](https://github.com/idealista/cookiecutter-ansible-role/issues/50) Tags not applied properly from playbook* @vicsufer
## [2.4.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.4.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.3.0...2.4.0)
### Added
- *[#45](https://github.com/idealista/cookiecutter-ansible-role/issues/45) Documentation link provided on role generation* @xtianae7
### Changed
- *[#47](https://github.com/idealista/cookiecutter-ansible-role/pull/47) Bump goss version from 0.3.14 to 0.3.16* @vicsufer
- *[#46](https://github.com/idealista/cookiecutter-ansible-role/issues/46) Static tests instead of parameters* @xtianae7
## [2.3.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.3.0)
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.2.0...2.3.0)
### Fixed
- *[#40](https://github.com/idealista/cookiecutter-ansible-role/issues/40) Updated yamllint configuration* @frantsao
### Changed
- *[#38](https://github.com/idealista/cookiecutter-ansible-role/pull/38) Bump goss version from 0.3.11 to 0.3.14* @vicsufer
- *[#30](https://github.com/idealista/cookiecutter-ansible-role/issues/30) Using a new version for issue template* @xtianae7
### Removed
- *[#39](https://github.com/idealista/cookiecutter-ansible-role/pull/39) Community health files* @vicsufer
- *[#30](https://github.com/idealista/cookiecutter-ansible-role/issues/30) PULL_REQUEST_TEMPLATE removed, replaced with default community health file* @xtianae7
## [2.2.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)
### Fixed
- *[#27](https://github.com/idealista/cookiecutter-ansible-role/issues/27) Adding Probot configuration to Ansible Role template* @dortegau
### 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
## [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)
### 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
## [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
## [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
### Added
- *[#4](https://github.com/idealista/cookiecutter-ansible-role/issues/4) Upgrade to Goss v0.3.11* @pablogcaldito
### 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)
### Added
- *First release* @pablogcaldito
- *First release* @pablogcaldito

View File

@ -1,7 +1,9 @@
# Cookiecutter Ansible Role
![Logo](https://raw.githubusercontent.com/idealista/cookiecutter-ansible-role/master/logo.gif)
[![Build Status](https://travis-ci.org/idealista/cookiecutter-ansible-role.png)](https://travis-ci.com/idealista/cookiecutter-ansible-role)
[![Build Status](https://travis-ci.org/idealista/cookiecutter-ansible-role.png)](https://travis-ci.org/idealista/cookiecutter-ansible-role)
This cookiecutter generates an [ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html).
@ -25,12 +27,13 @@ This cookiecutter:
### Prerequisities
You just need to have [pipenv](https://github.com/pypa/pipenv) installed.
Cookiecutter version 1.7.x installed.
You can satify this requirement with ```pip install cookiecutter```
## 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 -rf Pipfile*
requirements.txt && pipenv --rm && rm -rf requirements.txt```.
To generate your ansible role type ```cookiecutter https://github.com/idealista/cookiecutter-ansible-role```.
Then, introduce some parameters needed for generating it.
@ -45,17 +48,19 @@ github_user [idealista]:
company [Idealista S.A.U.]:
author []: pablogcaldito
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
ansible_version []: 2.8.8
molecule_version []: 3.0.1
python_docker_version []: 4.1.0
ansible_lint_version []: 4.2.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_bullseye_support:
Select debian_jessie_support:
1 - True
2 - False
Choose from 1, 2 [1]:
Select debian_stretch_support:
1 - True
2 - False
Choose from 1, 2 [1]:
@ -80,7 +85,6 @@ 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:

View File

@ -7,22 +7,20 @@
"company": "Idealista S.A.U.",
"author": "",
"min_ansible_version": "",
"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",
"ansible_version": "",
"molecule_version": "",
"python_docker_version": "",
"ansible_lint_version":"",
"license":"Apache 2.0",
"galaxy_tag_1":"tag1",
"galaxy_tag_2":"tag2",
"galaxy_tag_3":"tag3",
"debian_bullseye_support":["True", "False"],
"galaxy_tag_1":"example_tag1",
"galaxy_tag_2":"example_tag2",
"galaxy_tag_3":"example_tag3",
"debian_jessie_support":["True", "False"],
"debian_stretch_support":["True", "False"],
"debian_buster_support":["True", "False"],
"has_service":["True", "False"],
"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"],
"documentation_URL":""
"has_templates":["True", "False"]
}

View File

@ -22,7 +22,6 @@ def configureRole():
# 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")
@ -36,7 +35,7 @@ def configureRole():
os.remove("files/.empty")
def generatePipfile():
print("Now cd into the role directory and introduce the following command for it to be ready: \"pipenv install -r test-requirements.txt --three\"")
os.system("pipenv install -r test-requirements.txt --three")
def main():
checkInput()

21
test.sh
View File

@ -3,23 +3,7 @@
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="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_service="False" \
has_files="False" \
has_handlers="False" \
has_templates="False" \
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
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"
(
# Adjust the role to test
cd github_cli_role
@ -28,9 +12,8 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal
sed -i 's/1.0.0/0.6.4/g' defaults/main.yml
sed -i 's/exampleapplication/gh/g' defaults/main.yml
# Launch molecule tests
pipenv install -r test-requirements.txt
pipenv sync
pipenv run molecule test
)
# Cleanup
rm -rf github_cli_role

View File

@ -1,8 +1,5 @@
---
exclude_paths:
- ./molecule
- ./.travis.yml
- ./.github
parseable: true
skip_list:
- '204'

View File

@ -0,0 +1,74 @@
# 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

View File

@ -0,0 +1,100 @@
# 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 has **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

View File

@ -0,0 +1,36 @@
<!--
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.app_name }}_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.

View File

@ -1,49 +0,0 @@
---
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.]

View File

@ -1,3 +0,0 @@
---
blank_issues_enabled: false

View File

@ -1,31 +0,0 @@
---
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.]

View File

@ -1,27 +0,0 @@
---
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]

View File

@ -1,27 +0,0 @@
---
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.

View File

@ -0,0 +1,26 @@
### 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 -->

View File

@ -1,33 +0,0 @@
---
issues:
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "pinned"
- "security"
- "good first issue"
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
pulls:
# Number of days of inactivity before a pull request becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale pull request is closed
daysUntilClose: 7
# Comment to post when marking a pull request as stale. Set to `false` to disable
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale pull request. Set to `false` to disable
closeComment: false

View File

@ -3,9 +3,9 @@
extends: default
ignore: |
molecule/**/tests/
.github
.travis.yml
molecule/
tests/
rules:
braces:
@ -20,13 +20,20 @@ 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

View File

@ -1,18 +0,0 @@
# 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).
## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/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)
### Changed
*[#<issue_number>](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/<issue_number>) \<Change description\>* @\<author\>
## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0)
- Initial release

View File

@ -1,14 +1,12 @@
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
![Logo](logo.gif)
![Logo](https://raw.githubusercontent.com/idealista/{{ cookiecutter.app_name }}_role/master/logo.gif)
[![Build Status](https://app.travis-ci.com/idealista/{{ cookiecutter.app_name }}_role.svg)](https://app.travis-ci.com/github/idealista/{{ cookiecutter.app_name }}_role)
[![Build Status](https://travis-ci.org/idealista/{{ cookiecutter.app_name }}_role.png)](https://travis-ci.org/idealista/{{ cookiecutter.app_name }}_role)
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-idealista.{{ cookiecutter.app_name }}_role-B62682.svg)](https://galaxy.ansible.com/idealista/{{ cookiecutter.app_name }}_role)
This ansible role installs {% if cookiecutter.documentation_URL != "" %}[{% endif %}{{ cookiecutter.app_name | replace('_',' ') | title }}{% if cookiecutter.documentation_URL != "" %}]({{ cookiecutter.documentation_URL }}){% endif %} in a Debian environment. It has been tested for the following Debian versions:
{% if cookiecutter.debian_bullseye_support == 'True' %}* Bulleye{% endif %}
{% if cookiecutter.debian_buster_support == 'True' %}* Buster{% endif %}
This ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for Debian buster and stretch.
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).
@ -28,11 +26,11 @@ These instructions will get you a copy of the role for your Ansible playbook. On
### Prerequisities
Ansible {{ cookiecutter.ansible_version }} version installed.
Ansible 2.8.x.x 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/goss-org/goss) as verifier.
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
@ -84,11 +82,11 @@ $ pipenv run molecule test
![Ansible](https://img.shields.io/badge/ansible-{{ cookiecutter.ansible_version }}-green.svg)
![Molecule](https://img.shields.io/badge/molecule-{{ cookiecutter.molecule_version }}-green.svg)
![Goss](https://img.shields.io/badge/goss-0.3.16-green.svg)
![Goss](https://img.shields.io/badge/goss-0.3.9-green.svg)
## Versioning
For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tags).
For the versions available, see the [tags on this repository](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tags).
Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.
@ -96,7 +94,7 @@ Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGE
* **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.
See also the list of [contributors](https://github.com/idealista/{{ cookiecutter.app_name }}_role/contributors) who participated in this project.
## License

View File

@ -21,18 +21,17 @@
# 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:
{{ 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: "{{ cookiecutter.documentation_URL }}"
{{ cookiecutter.app_name }}_documentation_link: https://www.example.documentation.com
# Owner
{{ cookiecutter.app_name }}_user: exampleuser
{{ cookiecutter.app_name }}_group: examplegroup
{{ cookiecutter.app_name }}_user_shell: /usr/sbin/nologin
# Maximum number of files limit
{{ cookiecutter.app_name }}_max_files: 32768
@ -45,8 +44,7 @@
# 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_path: /var/log
# {{ cookiecutter.app_name }}_log_file: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_path {% raw %}}}{% endraw %}/{{ cookiecutter.app_name }}.log"
# {{ 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
@ -58,5 +56,5 @@
- "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
private_tmp_service: yes
{% endif %}

View File

@ -6,12 +6,13 @@ galaxy_info:
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
min_ansible_version: {{ cookiecutter.min_ansible_version }}
license: {{ cookiecutter.license }}
galaxy_tags:
galaxy-tags:
- {{ cookiecutter.galaxy_tag_1 }}
- {{ cookiecutter.galaxy_tag_2 }}
- {{ cookiecutter.galaxy_tag_3 }}
platforms:
- name: Debian
versions:
{% if cookiecutter.debian_bullseye_support == 'True' %}- bullseye{% endif %}
{% if cookiecutter.debian_jessie_support == 'True' %}- jessie{% endif %}
{% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %}
{% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %}

View File

@ -8,5 +8,5 @@ FROM {{ item.image }}
# install minimal packages for debian slim images
RUN apt-get update && \
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
apt-get clean{% endraw %}

View File

@ -1,3 +0,0 @@
---
{{ cookiecutter.app_name }}_private_tmp: false

View File

@ -10,7 +10,7 @@ platforms:
- name: {{ cookiecutter.app_name }}
groups:
- {{ cookiecutter.app_name }}_group
image: ${MOLECULE_DISTRO:-debian:bullseye-slim}
image: ${MOLECULE_DISTRO:-debian:buster-slim}
privileged: false
capabilities:
- SYS_ADMIN

View File

@ -1,46 +1,36 @@
---
## TODO: Remember to adapt goss tests to your convenience
{% if cookiecutter.has_service == 'True' %}
service:
{{ cookiecutter.app_name }}:
enabled: true
running: true
process:
{{ cookiecutter.exec_name }}:
running: true
user:
exampleuser:
exists: true
groups:
- examplegroup
shell: /usr/sbin/nologin
group:
examplegroup:
exists: true
{% endif %}
file:
/opt/{{ cookiecutter.app_name }}:
{%- if cookiecutter.has_service == 'True' %}
owner: exampleuser
group: examplegroup
{%- endif %}
{% 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
/opt/{{ cookiecutter.app_name }}/bin:
{%- if cookiecutter.has_service == 'True' %}
owner: exampleuser
group: examplegroup
{%- endif %}
exists: true
filetype: directory
## Check if ports are really exposed
{% if cookiecutter.has_service == 'True' %}
# port:
# # Check port at IPv6
# # https://github.com/goss-org/goss/issues/177
# tcp6:<port>:
# # 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 %}

View File

@ -8,11 +8,11 @@
- {{ cookiecutter.app_name }}
become: true
vars:
goss_version: v0.3.16
goss_version: v0.3.10
goss_arch: amd64
goss_dst: /usr/local/bin/goss
goss_sha256sum: 827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb
goss_url: "https://github.com/goss-org/goss/releases/download/{% raw %}{{{% endraw %} goss_version {% raw %}}}{% endraw %}/goss-linux-{% raw %}{{{% endraw %} goss_arch {% raw %}}}{% endraw %}"
goss_sha256sum: 150f25495ca0d1d4fd2ef8d0e750dbd767a15e9a522505f99b61dd1dd40a76d4
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
@ -24,7 +24,7 @@
get_url:
url: "{% raw %}{{{% endraw %} goss_url {% raw %}}}{% endraw %}"
dest: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %}"
checksum: "sha256{% raw %}:{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
sha256sum: "{% raw %}{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
mode: 0755
register: download_goss
until: download_goss is succeeded
@ -45,7 +45,6 @@
command: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %} -g {% raw %}{{{% endraw %} item {% raw %}}}{% endraw %} validate --format {% raw %}{{{% endraw %} goss_format {% raw %}}}{% endraw %}"
register: test_results
with_items: "{% raw %}{{{% endraw %} test_files.stdout_lines {% raw %}}}{% endraw %}"
ignore_errors: true
- name: Display details about the Goss results
debug:
@ -56,4 +55,4 @@
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 %}"

View File

@ -5,62 +5,47 @@
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
system: yes
state: present
tags:
- {{ cookiecutter.app_name }}_install
- 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: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user_shell {% raw %}}}{% endraw %}"
shell: /usr/sbin/nologin
createhome: no
tags:
- {{ cookiecutter.app_name }}_install
{% endif %}
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths
file:
dest: "{% raw %}{{{% endraw %} item {% raw %}}}{% endraw %}"
{%- if cookiecutter.has_service == 'True' %}
{% if cookiecutter.has_service == 'True' %}
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
{%- endif %}
mode: 0755
{% endif %}
state: directory
with_items:
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
tags:
- {{ cookiecutter.app_name }}_install
- 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' %}
{% if cookiecutter.has_service == 'True' %}
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
{%- endif %}
mode: 0755
state: directory
{% endif %}
state: file
when: {{ cookiecutter.app_name }}_log_file is defined
tags:
- {{ cookiecutter.app_name }}_install
- name: {{ cookiecutter.app_name | upper }} | Check {{ cookiecutter.app_name }} version
command: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} --version"
command: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }} --version {% raw %}}}{% endraw %}"
register: {{ cookiecutter.app_name }}_check
changed_when: false
ignore_errors: true
check_mode: no
tags:
- {{ cookiecutter.app_name }}_install
- 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
tags:
- {{ cookiecutter.app_name }}_install
- name: {{ cookiecutter.app_name | upper }} | Extract downloaded package
unarchive:
@ -68,22 +53,18 @@
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
tags:
- {{ cookiecutter.app_name }}_install
- 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' %}
{% if cookiecutter.has_service == 'True' %}
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
{%- endif %}
{% 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
tags:
- {{ cookiecutter.app_name }}_install
- name: {{ cookiecutter.app_name | upper }} | Link binary
file:
@ -91,5 +72,3 @@
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
tags:
- {{ cookiecutter.app_name }}_install

View File

@ -1,17 +1,17 @@
---
- name: {{ cookiecutter.app_name | upper }} | Install
import_tasks: install.yml
include: install.yml
tags:
- {{ cookiecutter.app_name }}_install
- name: {{ cookiecutter.app_name | upper }} | Configure
import_tasks: config.yml
include: config.yml
tags:
- {{ cookiecutter.app_name }}_configure
{% if cookiecutter.has_service == 'True' %}
- name: {{ cookiecutter.app_name | upper }} | Service
import_tasks: service.yml
include: service.yml
tags:
- {{ cookiecutter.app_name }}_service
{% endif %}

View File

@ -8,14 +8,10 @@
owner: root
group: root
notify: restart {{ cookiecutter.app_name }}
tags:
- {{ cookiecutter.app_name }}_service
- 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
tags:
- {{ cookiecutter.app_name }}_service
daemon_reload: yes

View File

@ -6,7 +6,7 @@ Requires=network-online.target
After=network-online.target
[Service]
PrivateTmp={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_private_tmp {% raw %}}}{% endraw %}
PrivateTmp={% raw %}{{ private_tmp_service }}{% endraw %}
User={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}
Group={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
RuntimeDirectory={{ cookiecutter.app_name }}

View File

@ -1,6 +1,4 @@
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 }}
ansible-lint=={{ cookiecutter.ansible_lint_version }}

View File

@ -1,3 +0,0 @@
*.yml linguist-detectable=true
*.yaml linguist-detectable=true
*.html linguist-detectable=false

View File

@ -4,6 +4,7 @@ tests/.cache
__pycache__
.pytest_cache
.molecule
.vagrant
.cache
*.iml

View File

@ -1,25 +1,21 @@
---
dist: xenial
language: python
python: "3.9"
python: "3.7"
os: linux
services:
- docker
install:
- pip install -I pipenv
- pip install pipenv
- pipenv sync
env:
jobs:
{% if cookiecutter.debian_jessie_support == 'True' %}- MOLECULE_DISTRO=debian:jessie-slim{% endif %}
{% if cookiecutter.debian_stretch_support == 'True' %}- MOLECULE_DISTRO=debian:stretch-slim{% endif %}
{% if cookiecutter.debian_buster_support == 'True' %}- MOLECULE_DISTRO=debian:buster-slim{% endif %}
{% if cookiecutter.debian_bullseye_support == 'True' %}- MOLECULE_DISTRO=debian:bullseye-slim{% endif %}
script:
- pipenv run molecule test --all
- export MOLECULE_DISTRO=${MOLECULE_DISTRO}
- pipenv run molecule test
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email:
if: branch = main
on_success: change
on_failure: always
recipients:
- desarrollo.benders@idealista.com
webhooks: https://galaxy.ansible.com/api/v1/notifications/