71 Commits

Author SHA1 Message Date
Adrián
3917b2a78b Release 2.10.0 2022-09-22 21:27:18 +02:00
Adrián
c6446c7e58 Merge pull request #93 from idealista/feature/issue-92
Several improvements and fixes
2022-09-22 21:26:20 +02:00
Adrián Arapiles
45e9ea744b Change python version on travis.yml 2022-09-22 18:37:44 +02:00
Adrián Arapiles
1e99d8b02c Add yamllint to readme and test.sh 2022-09-22 18:33:53 +02:00
Adrián Arapiles
f23f55643d Add yamllint to dependendecies because is mandatory for lint step.
#92 Fix examples tags to achieve meta.yml galaxy_tags requisites.
2022-09-22 18:14:06 +02:00
Adrián Arapiles
4b7c659da1 Remove requirements on README command after use 2022-06-16 22:34:13 +02:00
Adrián Arapiles
f6f4658aef Fix travis indent 2022-06-16 22:16:55 +02:00
Adrián Arapiles
42900e46c4 Improve README init scrips to avoid errors when create two roles on same path because already pipenv exists.
Change travis.yml order of email notification as documentation explains.
Add first line `---` to ansible-lint file because it's a yml.
#92 Fix meta.yml lint warning from `galaxy-tags` to `galaxy_tags`.
2022-05-26 12:55:48 +02:00
Santiago Perez
6522c7ef21 Merge pull request #90 from idealista/features/86-update-debian-version issue #86
Features/86 update debian version
2022-04-01 11:10:32 +02:00
santi-eidu
8a599c249f Remove python2 in molecule Dockerfile 2022-03-24 18:20:09 +01:00
santi-eidu
fdbc7c3908 Change CHANGELOG.md to use github user 2022-03-24 11:13:47 +01:00
santi-eidu
1121b4534e Update CHANGELOG.md and README.md 2022-03-24 10:15:55 +01:00
santi-eidu
16095bb031 Update travis ci yml file 2022-03-23 19:59:00 +01:00
santi-eidu
8ef54f7f0d Update ansible to v5.2.0 and ansible-lint to v5.3.2 2022-03-23 18:01:02 +01:00
santi-eidu
b33689d3b5 #86 Change debian supported version stretch to bulleye 2022-03-23 17:59:55 +01:00
Marcos Pérez García
2406ba62c1 update CHANGELOG.md 2021-10-26 11:00:28 +02:00
Marcos Pérez García
9e1cb98351 Merge pull request #88 from idealista/features/87
resolve #87 Travis build image and link are broken
2021-10-26 10:57:17 +02:00
Marcos Pérez García
dc504ad7d6 resolve #87 Travis build image and link are broken 2021-09-28 17:48:56 +02:00
Alex Blanco
b5685a90cd Merge branch 'master' into develop 2021-08-24 13:07:33 +02:00
Alex Blanco
23d2def966 Update CHANGELOG.md 2021-08-24 12:51:41 +02:00
Alex Blanco
076db03bbe Merge pull request #84 from idealista/bugs/83
#83 Don't leave empty lines when using jinja
2021-08-24 12:49:53 +02:00
Alejandro Blanco Lopez
c9e2a83163 #83 don't leave empty lines when using jinja 2021-08-24 12:12:44 +02:00
Alex Blanco
ff5533b940 Merge pull request #82 from idealista/bugs/81
#81 add log path variable in defaults
2021-08-24 09:12:43 +02:00
Alex Blanco
9211b42147 Merge branch 'develop' into bugs/81 2021-08-24 08:34:14 +02:00
Alex Blanco
4c2995e3d8 Merge pull request #80 from idealista/bugs/79
#79 add molecule-docker support
2021-08-24 08:33:35 +02:00
Alejandro Blanco Lopez
07f9750241 #81 add log path variable in defaults 2021-08-23 09:05:51 +02:00
Alejandro Blanco Lopez
14ae8d9e14 #79 add default pip versions 2021-08-23 08:48:43 +02:00
Alejandro Blanco Lopez
ed6eb9ff29 #79 update testing versions 2021-08-20 15:34:03 +02:00
Alejandro Blanco Lopez
92e30ec9ac #79 add molecule-docker support 2021-08-20 15:21:51 +02:00
Marcos Pérez García
f33225106e Merge pull request #78 from idealista/develop
Release 2.7.0
2021-06-16 09:33:58 +02:00
Marcos Pérez García
665d89beb0 update CHANGELOG.md 2021-06-16 08:58:06 +02:00
Marcos Pérez García
4459ae1aa6 Merge pull request #77 from idealista/features/76
Create shell user variable
2021-06-16 08:51:30 +02:00
Marcos Pérez García
28fe4678d7 resolve #76 create shell user variable 2021-06-14 17:21:16 +02:00
Alex Blanco
57633e39ad Merge pull request #75 from idealista/develop
Release 2.6.1
2021-06-02 15:36:00 +02:00
Alex Blanco
668d890ce6 Update CHANGELOG.md 2021-06-02 12:31:55 +02:00
Alex Blanco
71711119ea Merge branch 'master' into develop 2021-06-02 12:31:19 +02:00
Alex Blanco
cdb741f701 Merge pull request #74 from idealista/bugs/73
#73 --- in the .yml files
2021-06-02 12:30:16 +02:00
Alejandro Blanco López
fb3253da25 #73 --- in the .yml files 2021-06-02 11:16:39 +02:00
Víctor Suárez Fernández
0211cfcd29 Merge pull request #71 from idealista/develop
Release 2.6.0
2021-04-30 10:11:20 +02:00
Víctor Suárez Fernández
01d41dc596 Merge branch 'master' into develop 2021-04-30 09:12:43 +02:00
Víctor Suárez Fernández
5fd7fc7e1d Update CHANGELOG.md 2021-04-30 09:11:33 +02:00
Víctor Suárez Fernández
3514236fa0 Merge pull request #70 from idealista/features/69
travis.yml email notifications
2021-04-30 09:10:06 +02:00
Víctor Suárez Fernández
d9964134da Update CHANGELOG.md 2021-04-29 17:38:30 +02:00
Víctor Suárez Fernández
9a971619a7 Update CHANGELOG.md 2021-04-29 15:38:57 +02:00
Víctor Suárez Fernández
409e7f8bd2 Update .travils.yml template 2021-04-29 15:32:18 +02:00
Víctor Suárez Fernández
6a760eb1dc Update .travis.yml 2021-04-29 15:29:30 +02:00
Víctor Suárez Fernández
684428ec80 Merge pull request #67 from idealista/fix/check_mode
Fix check_mode
2021-03-31 12:17:34 +02:00
Víctor Suárez Fernández
3a93e6734d Update CHANGELOG.md 2021-03-29 15:25:58 +02:00
Víctor Suárez Fernández
5ad5453892 Update CHANGELOG.md 2021-03-29 15:01:25 +02:00
Víctor Suárez Fernández
8e1924e9e3 Install checkmode 2021-03-29 14:57:06 +02:00
David Mateo
519a783810 Merge pull request #66 from idealista/develop
Release 2.5.1
2021-03-09 12:08:36 +01:00
Alex Blanco
5fc3bcaa2e Merge branch 'master' into develop 2021-03-09 12:07:40 +01:00
David Mateo
dacd85ef41 Update CHANGELOG.md 2021-03-09 12:05:23 +01:00
David Mateo
7e8ec829c9 Merge pull request #65 from idealista/bugs/62
Adding changes to resolve #62
2021-03-09 11:44:35 +01:00
Víctor Suárez Fernández
cc0eb0ce7c Merge branch 'develop' into bugs/62 2021-03-08 10:37:48 +01:00
Alex Blanco
08003a20e3 Merge pull request #64 from idealista/bugs/63
#63 ignore html code in linguist detection
2021-03-08 09:40:24 +01:00
David Mateo
2838871c2b Adding changes to resolve #62
- ignore_errors set to true in to the goss tests execution task
   - Change log update
2021-03-08 09:18:01 +01:00
Alex Blanco
498bb69af5 Merge branch 'develop' into bugs/63 2021-03-05 13:56:07 +01:00
Marcos Pérez García
9e12212122 Merge pull request #61 from idealista/bugs/60
Change state value in "Ensure skeleton log paths"
2021-03-05 13:49:53 +01:00
Alejandro Blanco López
bf38884dcd #63 ignore html code in linguist detection 2021-03-05 13:31:24 +01:00
Marcos Pérez García
2372221f93 update CHANGELOG.md 2021-02-23 16:37:10 +01:00
Marcos Pérez García
a082c79f12 resolve #60 change state value in Ensure skeleton log paths 2021-02-23 13:31:02 +01:00
Alex Blanco
921231864f Merge pull request #59 from idealista/develop
Release 2.5.0
2021-02-19 04:55:24 -08:00
Alex Blanco
c7be6405e8 Merge branch 'master' into develop 2021-02-19 04:54:55 -08:00
Alex Blanco
53acbaa7d7 Update CHANGELOG.md 2021-02-19 13:54:28 +01:00
Alex Blanco
055c1ed1a8 Merge pull request #58 from idealista/features/57
#57 gitattributes for yaml detection
2021-02-19 04:51:52 -08:00
Alex Blanco
092a44d4d2 Merge branch 'develop' into features/57 2021-02-19 04:51:23 -08:00
Alex Blanco
e216704e9f Merge pull request #56 from idealista/features/55
#55 exclude non-role files from linting
2021-02-19 04:51:00 -08:00
Alejandro Blanco López
1b9b8e81a2 #57 gitattributes for yaml detection 2021-02-18 12:39:38 +01:00
Alejandro Blanco López
8b089d7fdc follow excluding convention 2021-02-17 18:24:53 +01:00
Alejandro Blanco López
bd4c9ee55d #55 exclude non-role files from linting 2021-02-17 18:22:37 +01:00
24 changed files with 161 additions and 51 deletions

View File

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

View File

@@ -1,3 +1,4 @@
---
# Set to true to add reviewers to pull requests
addReviewers: true

1
.github/stale.yml vendored
View File

@@ -1,3 +1,4 @@
---
issues:
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90

View File

@@ -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 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

View File

@@ -3,11 +3,67 @@ 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
## [2.10.0](https://github.com/idealista/cookiecutter-ansible-role/tree/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

View File

@@ -1,9 +1,7 @@
# Cookiecutter Ansible Role
![Logo](https://raw.githubusercontent.com/idealista/cookiecutter-ansible-role/master/logo.gif)
[![Build Status](https://travis-ci.com/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.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]:

View File

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

20
test.sh
View File

@@ -3,7 +3,23 @@
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" documentation_URL="https://cli.github.com/manual/" && 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_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
(
# Adjust the role to test
cd github_cli_role
@@ -14,7 +30,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

View File

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

View File

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

View File

@@ -1,3 +1,4 @@
---
issues:
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90

View File

@@ -4,6 +4,8 @@ extends: default
ignore: |
molecule/**/tests/
.github
.travis.yml
rules:
braces:

View File

@@ -1,13 +1,13 @@
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
![Logo](logo.gif)
[![Build Status](https://travis-ci.com/idealista/{{ cookiecutter.app_name }}_role.png)](https://travis-ci.com/idealista/{{ cookiecutter.app_name }}_role)
[![Build Status](https://app.travis-ci.com/idealista/{{ cookiecutter.app_name }}_role.svg)](https://app.travis-ci.com/github/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_stretch_support == 'True' %}* Stretch{% endif %}
{% if cookiecutter.debian_bullseye_support == 'True' %}* Bulleye{% 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).

View File

@@ -21,7 +21,7 @@
# 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' %}
@@ -32,6 +32,7 @@
# 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
@@ -44,7 +45,8 @@
# 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_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_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

View File

@@ -6,12 +6,12 @@ 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_stretch_support == 'True' %}- stretch{% endif %}
{% if cookiecutter.debian_bullseye_support == 'True' %}- bullseye{% 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 python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
apt-get clean{% endraw %}

View File

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

View File

@@ -22,17 +22,17 @@ group:
{% endif %}
file:
/opt/{{ cookiecutter.app_name }}:
{% if cookiecutter.has_service == 'True' %}
{%- if cookiecutter.has_service == 'True' %}
owner: exampleuser
group: examplegroup
{% endif %}
{%- endif %}
exists: true
filetype: directory
/opt/{{ cookiecutter.app_name }}/bin:
{% if cookiecutter.has_service == 'True' %}
{%- if cookiecutter.has_service == 'True' %}
owner: exampleuser
group: examplegroup
{% endif %}
{%- endif %}
exists: true
filetype: directory

View File

@@ -24,7 +24,7 @@
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
@@ -45,6 +45,7 @@
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:

View File

@@ -13,7 +13,7 @@
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
system: yes
shell: /usr/sbin/nologin
shell: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user_shell {% raw %}}}{% endraw %}"
createhome: no
tags:
- {{ cookiecutter.app_name }}_install
@@ -21,10 +21,11 @@
- 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 %}
{%- endif %}
mode: 0755
state: directory
with_items:
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
@@ -34,11 +35,12 @@
- 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 %}
state: file
{%- endif %}
mode: 0755
state: directory
when: {{ cookiecutter.app_name }}_log_file is defined
tags:
- {{ cookiecutter.app_name }}_install
@@ -48,6 +50,7 @@
register: {{ cookiecutter.app_name }}_check
changed_when: false
ignore_errors: true
check_mode: no
tags:
- {{ cookiecutter.app_name }}_install
@@ -72,10 +75,10 @@
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

View File

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

View File

@@ -1,4 +1,6 @@
ansible=={{ cookiecutter.ansible_version }}
molecule=={{ cookiecutter.molecule_version }}
docker=={{ cookiecutter.python_docker_version }}
ansible-lint=={{ cookiecutter.ansible_lint_version }}
molecule-docker=={{ cookiecutter.molecule_docker_version }}
ansible-lint=={{ cookiecutter.ansible_lint_version }}
yamllint=={{ cookiecutter.yamllint_version }}

View File

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

View File

@@ -10,10 +10,16 @@ install:
- 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 %}
{% if cookiecutter.debian_bullseye_support == 'True' %}- 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:
- desarrollo.benders@idealista.com