forked from Mirrors/cookiecutter-ansible-role
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea7487e2a9 | ||
|
|
2406ba62c1 | ||
|
|
9e1cb98351 | ||
|
|
dc504ad7d6 | ||
|
|
74b1c3483f | ||
|
|
b5685a90cd | ||
|
|
23d2def966 | ||
|
|
076db03bbe | ||
|
|
c9e2a83163 | ||
|
|
ff5533b940 | ||
|
|
9211b42147 | ||
|
|
4c2995e3d8 | ||
|
|
07f9750241 | ||
|
|
14ae8d9e14 | ||
|
|
ed6eb9ff29 | ||
|
|
92e30ec9ac | ||
|
|
f33225106e | ||
|
|
665d89beb0 | ||
|
|
4459ae1aa6 | ||
|
|
28fe4678d7 | ||
|
|
57633e39ad | ||
|
|
668d890ce6 | ||
|
|
71711119ea | ||
|
|
cdb741f701 | ||
|
|
fb3253da25 | ||
|
|
0211cfcd29 | ||
|
|
01d41dc596 | ||
|
|
5fd7fc7e1d | ||
|
|
3514236fa0 | ||
|
|
d9964134da | ||
|
|
9a971619a7 | ||
|
|
409e7f8bd2 | ||
|
|
6a760eb1dc | ||
|
|
684428ec80 | ||
|
|
3a93e6734d | ||
|
|
5ad5453892 | ||
|
|
8e1924e9e3 | ||
|
|
519a783810 | ||
|
|
5fc3bcaa2e | ||
|
|
dacd85ef41 | ||
|
|
7e8ec829c9 | ||
|
|
cc0eb0ce7c | ||
|
|
08003a20e3 | ||
|
|
2838871c2b | ||
|
|
498bb69af5 | ||
|
|
9e12212122 | ||
|
|
bf38884dcd | ||
|
|
2372221f93 | ||
|
|
a082c79f12 | ||
|
|
921231864f | ||
|
|
c7be6405e8 | ||
|
|
53acbaa7d7 | ||
|
|
055c1ed1a8 | ||
|
|
092a44d4d2 | ||
|
|
e216704e9f | ||
|
|
1b9b8e81a2 | ||
|
|
8b089d7fdc | ||
|
|
bd4c9ee55d |
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +1,2 @@
|
||||
---
|
||||
blank_issues_enabled: false
|
||||
|
||||
1
.github/auto_assign.yml
vendored
1
.github/auto_assign.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# Set to true to add reviewers to pull requests
|
||||
addReviewers: true
|
||||
|
||||
|
||||
1
.github/stale.yml
vendored
1
.github/stale.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
issues:
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
||||
|
||||
12
.travis.yml
12
.travis.yml
@@ -1,7 +1,7 @@
|
||||
---
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.7"
|
||||
python: "3.9"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
@@ -11,6 +11,12 @@ env:
|
||||
jobs:
|
||||
- MOLECULE_DISTRO=debian:stretch-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
|
||||
|
||||
42
CHANGELOG.md
42
CHANGELOG.md
@@ -3,11 +3,53 @@ 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.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
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
"company": "Idealista S.A.U.",
|
||||
"author": "",
|
||||
"min_ansible_version": "",
|
||||
"ansible_version": "",
|
||||
"molecule_version": "",
|
||||
"python_docker_version": "",
|
||||
"ansible_lint_version":"",
|
||||
"ansible_version": "4.4.0",
|
||||
"molecule_version": "3.4.0",
|
||||
"python_docker_version": "5.0.0",
|
||||
"molecule_docker_version": "0.2.4",
|
||||
"ansible_lint_version":"5.1.2",
|
||||
"license":"Apache 2.0",
|
||||
"galaxy_tag_1":"example_tag1",
|
||||
"galaxy_tag_2":"example_tag2",
|
||||
|
||||
17
test.sh
17
test.sh
@@ -3,7 +3,22 @@
|
||||
set -e
|
||||
|
||||
# Generate role
|
||||
printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" 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="4.4.0" \
|
||||
molecule_version="3.4.0" \
|
||||
python_docker_version="5.0.0" \
|
||||
molecule_docker_version="0.2.4" \
|
||||
ansible_lint_version="5.1.2" \
|
||||
has_service="False" \
|
||||
has_files="False" \
|
||||
has_handlers="False" \
|
||||
has_templates="False" \
|
||||
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt
|
||||
|
||||
(
|
||||
# Adjust the role to test
|
||||
cd github_cli_role
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
exclude_paths:
|
||||
- ./molecule
|
||||
- ./.travis.yml
|
||||
- ./.github
|
||||
parseable: true
|
||||
skip_list:
|
||||
- '204'
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
---
|
||||
|
||||
blank_issues_enabled: false
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
issues:
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
||||
|
||||
@@ -4,6 +4,8 @@ extends: default
|
||||
|
||||
ignore: |
|
||||
molecule/**/tests/
|
||||
.github
|
||||
.travis.yml
|
||||
|
||||
rules:
|
||||
braces:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
||||

|
||||
|
||||
[](https://travis-ci.com/idealista/{{ cookiecutter.app_name }}_role)
|
||||
[](https://app.travis-ci.com/github/idealista/{{ cookiecutter.app_name }}_role)
|
||||
[](https://galaxy.ansible.com/idealista/{{ cookiecutter.app_name }}_role)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,10 @@
|
||||
- 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 %}
|
||||
state: directory
|
||||
with_items:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
||||
@@ -34,11 +34,11 @@
|
||||
- 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 %}
|
||||
state: directory
|
||||
when: {{ cookiecutter.app_name }}_log_file is defined
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
||||
@@ -48,6 +48,7 @@
|
||||
register: {{ cookiecutter.app_name }}_check
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
check_mode: no
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
||||
|
||||
@@ -72,10 +73,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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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 }}
|
||||
@@ -0,0 +1,3 @@
|
||||
*.yml linguist-detectable=true
|
||||
*.yaml linguist-detectable=true
|
||||
*.html linguist-detectable=false
|
||||
@@ -17,3 +17,9 @@ script:
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
email:
|
||||
if: branch = main
|
||||
on_success: change
|
||||
on_failure: always
|
||||
recipients:
|
||||
- desarrollo.benders@idealista.com
|
||||
|
||||
Reference in New Issue
Block a user