From 42900e46c45e47e0406196559115ce9e7f2e3ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 26 May 2022 12:55:48 +0200 Subject: [PATCH 1/6] 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`. --- .travis.yml | 6 +++--- CHANGELOG.md | 7 +++++++ README.md | 3 ++- {{cookiecutter.app_name}}_role/.ansible-lint | 1 + {{cookiecutter.app_name}}_role/meta/main.yml | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a709d07..7fe9692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ script: - ./test.sh notifications: email: - if: branch = master - on_success: change - on_failure: always recipients: - desarrollo.benders@idealista.com + if: branch = master + on_success: change + on_failure: always diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ccfdb9..764a454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ 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 +### 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 diff --git a/README.md b/README.md index ac95f8f..3d81ecd 100644 --- a/README.md +++ b/README.md @@ -29,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```. Then, introduce some parameters needed for generating it. diff --git a/{{cookiecutter.app_name}}_role/.ansible-lint b/{{cookiecutter.app_name}}_role/.ansible-lint index 59eca22..355eeac 100644 --- a/{{cookiecutter.app_name}}_role/.ansible-lint +++ b/{{cookiecutter.app_name}}_role/.ansible-lint @@ -1,3 +1,4 @@ +--- exclude_paths: - ./molecule - ./.travis.yml diff --git a/{{cookiecutter.app_name}}_role/meta/main.yml b/{{cookiecutter.app_name}}_role/meta/main.yml index 2bc2c18..03785df 100644 --- a/{{cookiecutter.app_name}}_role/meta/main.yml +++ b/{{cookiecutter.app_name}}_role/meta/main.yml @@ -6,7 +6,7 @@ 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 }} From f6f4658aef67532ccaa0811bb2108583df5b80da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 16 Jun 2022 22:16:55 +0200 Subject: [PATCH 2/6] Fix travis indent --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7fe9692..5d0e10a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,9 @@ script: - ./test.sh notifications: email: + if: branch = master + on_success: change + on_failure: always recipients: - desarrollo.benders@idealista.com - if: branch = master - on_success: change - on_failure: always + From 4b7c659da1b78beb81385cac8350b7132cc168d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 16 Jun 2022 22:34:13 +0200 Subject: [PATCH 3/6] Remove requirements on README command after use --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d81ecd..126b5b2 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ 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 -rf Pipfile* -requirements.txt && pipenv --rm```. +requirements.txt && pipenv --rm && rm -rf requirements.txt```. Then, introduce some parameters needed for generating it. From f23f55643dcc614399c60ce216d044a03f94d967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 22 Sep 2022 18:14:06 +0200 Subject: [PATCH 4/6] Add yamllint to dependendecies because is mandatory for lint step. #92 Fix examples tags to achieve meta.yml galaxy_tags requisites. --- cookiecutter.json | 7 ++++--- test.sh | 2 +- {{cookiecutter.app_name}}_role/test-requirements.txt | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 8a5240c..6013775 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -12,10 +12,11 @@ "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", + "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"], diff --git a/test.sh b/test.sh index 4ab9398..fc4aa95 100755 --- a/test.sh +++ b/test.sh @@ -17,7 +17,7 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal has_files="False" \ has_handlers="False" \ has_templates="False" \ - documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt + documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt ( # Adjust the role to test diff --git a/{{cookiecutter.app_name}}_role/test-requirements.txt b/{{cookiecutter.app_name}}_role/test-requirements.txt index fd772c1..c0440ff 100644 --- a/{{cookiecutter.app_name}}_role/test-requirements.txt +++ b/{{cookiecutter.app_name}}_role/test-requirements.txt @@ -2,4 +2,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 }} \ No newline at end of file +ansible-lint=={{ cookiecutter.ansible_lint_version }} +yamllint=={{ cookiecutter.yamllint_version }} \ No newline at end of file From 1e99d8b02c5aef47af960e0ab29d906512bc8f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 22 Sep 2022 18:33:53 +0200 Subject: [PATCH 5/6] Add yamllint to readme and test.sh --- README.md | 6 ++++-- test.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 126b5b2..a69ec92 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,11 @@ company [Idealista S.A.U.]: author []: pablogcaldito min_ansible_version []: 2.2 ansible_version []: 5.2.0 -molecule_version []: 3.0.1 -python_docker_version []: 4.1.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 diff --git a/test.sh b/test.sh index fc4aa95..5e31fe5 100755 --- a/test.sh +++ b/test.sh @@ -13,6 +13,7 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal 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" \ From 45e9ea744bcbec7a4c74f2606d94af4a2bab3cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arapiles?= Date: Thu, 22 Sep 2022 18:37:44 +0200 Subject: [PATCH 6/6] Change python version on travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d0e10a..580ae30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- dist: focal language: python -python: "3.9" +python: "3.10" os: linux services: - docker