mirror of
https://github.com/idealista/cookiecutter-ansible-role.git
synced 2024-11-19 19:06:12 +01:00
commit
74b1c3483f
10
CHANGELOG.md
10
CHANGELOG.md
@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.
|
|||||||
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
|
||||||
|
## [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)
|
## [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)
|
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.6.1...2.7.0)
|
||||||
### Added
|
### Added
|
||||||
|
@ -7,10 +7,11 @@
|
|||||||
"company": "Idealista S.A.U.",
|
"company": "Idealista S.A.U.",
|
||||||
"author": "",
|
"author": "",
|
||||||
"min_ansible_version": "",
|
"min_ansible_version": "",
|
||||||
"ansible_version": "",
|
"ansible_version": "4.4.0",
|
||||||
"molecule_version": "",
|
"molecule_version": "3.4.0",
|
||||||
"python_docker_version": "",
|
"python_docker_version": "5.0.0",
|
||||||
"ansible_lint_version":"",
|
"molecule_docker_version": "0.2.4",
|
||||||
|
"ansible_lint_version":"5.1.2",
|
||||||
"license":"Apache 2.0",
|
"license":"Apache 2.0",
|
||||||
"galaxy_tag_1":"example_tag1",
|
"galaxy_tag_1":"example_tag1",
|
||||||
"galaxy_tag_2":"example_tag2",
|
"galaxy_tag_2":"example_tag2",
|
||||||
|
17
test.sh
17
test.sh
@ -3,7 +3,22 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Generate role
|
# 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
|
# Adjust the role to test
|
||||||
cd github_cli_role
|
cd github_cli_role
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
# Logs
|
# Logs
|
||||||
# If wanted to output the logs to a file define the following variable
|
# 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=
|
# 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 %}"
|
{{ 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
|
# Flags
|
||||||
|
@ -22,17 +22,17 @@ group:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
file:
|
file:
|
||||||
/opt/{{ cookiecutter.app_name }}:
|
/opt/{{ cookiecutter.app_name }}:
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
{%- if cookiecutter.has_service == 'True' %}
|
||||||
owner: exampleuser
|
owner: exampleuser
|
||||||
group: examplegroup
|
group: examplegroup
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
exists: true
|
exists: true
|
||||||
filetype: directory
|
filetype: directory
|
||||||
/opt/{{ cookiecutter.app_name }}/bin:
|
/opt/{{ cookiecutter.app_name }}/bin:
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
{%- if cookiecutter.has_service == 'True' %}
|
||||||
owner: exampleuser
|
owner: exampleuser
|
||||||
group: examplegroup
|
group: examplegroup
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
exists: true
|
exists: true
|
||||||
filetype: directory
|
filetype: directory
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths
|
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths
|
||||||
file:
|
file:
|
||||||
dest: "{% raw %}{{{% endraw %} item {% raw %}}}{% endraw %}"
|
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 %}"
|
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
state: directory
|
state: directory
|
||||||
with_items:
|
with_items:
|
||||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
||||||
@ -34,10 +34,10 @@
|
|||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton log paths
|
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton log paths
|
||||||
file:
|
file:
|
||||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_path {% raw %}}}{% endraw %}"
|
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 %}"
|
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
state: directory
|
state: directory
|
||||||
when: {{ cookiecutter.app_name }}_log_file is defined
|
when: {{ cookiecutter.app_name }}_log_file is defined
|
||||||
tags:
|
tags:
|
||||||
@ -73,10 +73,10 @@
|
|||||||
copy:
|
copy:
|
||||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_src_bin {% raw %}}}{% endraw %}"
|
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 %}"
|
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 %}"
|
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||||
{% endif %}
|
{%- endif %}
|
||||||
remote_src: True
|
remote_src: True
|
||||||
mode: 0755
|
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
|
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 }}
|
ansible=={{ cookiecutter.ansible_version }}
|
||||||
molecule=={{ cookiecutter.molecule_version }}
|
molecule=={{ cookiecutter.molecule_version }}
|
||||||
docker=={{ cookiecutter.python_docker_version }}
|
docker=={{ cookiecutter.python_docker_version }}
|
||||||
|
molecule-docker=={{ cookiecutter.molecule_docker_version }}
|
||||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
Loading…
Reference in New Issue
Block a user