diff --git a/.travis.yml b/.travis.yml index 2aaba44..d87c80f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ install: - pip3 install cookiecutter env: jobs: - - MOLECULE_DISTRO=debian:jessie-slim - MOLECULE_DISTRO=debian:stretch-slim - MOLECULE_DISTRO=debian:buster-slim diff --git a/CHANGELOG.md b/CHANGELOG.md index 83bdb36..fe7e448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ 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.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 diff --git a/README.md b/README.md index 1044cb4..d2d88ad 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,11 @@ This cookiecutter: ### Prerequisities -Cookiecutter version 1.7.x installed. - -You can satify this requirement with ```pip install cookiecutter``` +You just need to have [pipenv](https://github.com/pypa/pipenv) installed. ## Usage -To generate your ansible role type ```cookiecutter https://github.com/idealista/cookiecutter-ansible-role```. +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```. Then, introduce some parameters needed for generating it. @@ -56,10 +54,6 @@ 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_jessie_support: -1 - True -2 - False -Choose from 1, 2 [1]: Select debian_stretch_support: 1 - True 2 - False diff --git a/cookiecutter.json b/cookiecutter.json index 7d6c93e..d82c50d 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -15,7 +15,6 @@ "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"], diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7748edf..f0e20c4 100755 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -36,7 +36,7 @@ def configureRole(): os.remove("files/.empty") def generatePipfile(): - os.system("pipenv install -r test-requirements.txt --three") + print("Now cd into the role directory and introduce the following command for it to be ready: \"pipenv install -r test-requirements.txt --three\"") def main(): checkInput() diff --git a/test.sh b/test.sh index 7b4a01f..ca19a0c 100755 --- a/test.sh +++ b/test.sh @@ -3,7 +3,7 @@ set -e # Generate role -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" +printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" && rm Pipfile* requirements.txt ( # Adjust the role to test cd github_cli_role @@ -12,8 +12,9 @@ cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" 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 sync + pipenv install -r test-requirements.txt --three pipenv run molecule test + ) # Cleanup rm -rf github_cli_role diff --git a/{{cookiecutter.app_name}}_role/CHANGELOG.md b/{{cookiecutter.app_name}}_role/CHANGELOG.md index e69de29..4a8cc20 100644 --- a/{{cookiecutter.app_name}}_role/CHANGELOG.md +++ b/{{cookiecutter.app_name}}_role/CHANGELOG.md @@ -0,0 +1,18 @@ +# 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 + *[#](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/) \* @\ + +## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0) +- Initial release diff --git a/{{cookiecutter.app_name}}_role/README.md b/{{cookiecutter.app_name}}_role/README.md index 930381f..64ce241 100644 --- a/{{cookiecutter.app_name}}_role/README.md +++ b/{{cookiecutter.app_name}}_role/README.md @@ -6,7 +6,9 @@ -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 ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for the following Debian versions: +{% if cookiecutter.debian_stretch_support == 'True' %}* Stretch{% endif %} +{% if cookiecutter.debian_buster_support == 'True' %}* Buster{% endif %} This role has been generated using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) tool, you can generate a similar role that fits your needs using the this [cookiecutter template](https://github.com/idealista/cookiecutter-ansible-role). @@ -26,7 +28,7 @@ These instructions will get you a copy of the role for your Ansible playbook. On ### Prerequisities -Ansible 2.8.x.x version installed. +Ansible {{ cookiecutter.ansible_version }} version installed. Molecule 3.x.x version installed. @@ -86,7 +88,7 @@ $ pipenv run molecule test ## Versioning -For the versions available, see the [tags on this repository](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tags). +For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tags). Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file. @@ -94,7 +96,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/idealista/{{ cookiecutter.app_name }}_role/contributors) who participated in this project. +See also the list of [contributors](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/contributors) who participated in this project. ## License diff --git a/{{cookiecutter.app_name}}_role/meta/main.yml b/{{cookiecutter.app_name}}_role/meta/main.yml index 89df173..b5a9c5e 100644 --- a/{{cookiecutter.app_name}}_role/meta/main.yml +++ b/{{cookiecutter.app_name}}_role/meta/main.yml @@ -13,6 +13,5 @@ galaxy_info: platforms: - name: Debian versions: - {% if cookiecutter.debian_jessie_support == 'True' %}- jessie{% endif %} {% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %} {% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %} diff --git a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} index 0f516cc..1d4aa00 100644 --- a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} +++ b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} @@ -10,7 +10,6 @@ install: - 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 %} script: