From b33689d3b559afdbabad2f395b91b7dc5a8caa01 Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Wed, 23 Mar 2022 16:11:42 +0100 Subject: [PATCH 1/6] #86 Change debian supported version stretch to bulleye --- .travis.yml | 2 +- CHANGELOG.md | 4 ++++ README.md | 2 +- cookiecutter.json | 2 +- {{cookiecutter.app_name}}_role/README.md | 2 +- {{cookiecutter.app_name}}_role/meta/main.yml | 2 +- {{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 | 2 +- {{cookiecutter.app_name}}_role/molecule/default/molecule.yml | 2 +- .../{% raw %}.travis.yml{% endraw %} | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6522ad7..6894123 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ install: - pip3 install cookiecutter env: jobs: - - MOLECULE_DISTRO=debian:stretch-slim + - MOLECULE_DISTRO=debian:bullseye-slim - MOLECULE_DISTRO=debian:buster-slim script: - ./test.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd222b..e412f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ 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.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 #86* @sperez ## [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 diff --git a/README.md b/README.md index 8086ff9..b14d5b4 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ 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]: diff --git a/cookiecutter.json b/cookiecutter.json index 4ef4152..3c9c9c3 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -16,7 +16,7 @@ "galaxy_tag_1":"example_tag1", "galaxy_tag_2":"example_tag2", "galaxy_tag_3":"example_tag3", - "debian_stretch_support":["True", "False"], + "debian_bullseye_support":["True", "False"], "debian_buster_support":["True", "False"], "has_service":["True", "False"], "has_files":["True", "False"], diff --git a/{{cookiecutter.app_name}}_role/README.md b/{{cookiecutter.app_name}}_role/README.md index 7119d7f..8a9e67c 100644 --- a/{{cookiecutter.app_name}}_role/README.md +++ b/{{cookiecutter.app_name}}_role/README.md @@ -7,7 +7,7 @@ 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). diff --git a/{{cookiecutter.app_name}}_role/meta/main.yml b/{{cookiecutter.app_name}}_role/meta/main.yml index b5a9c5e..2bc2c18 100644 --- a/{{cookiecutter.app_name}}_role/meta/main.yml +++ b/{{cookiecutter.app_name}}_role/meta/main.yml @@ -13,5 +13,5 @@ galaxy_info: 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 %} diff --git a/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 b/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 index c4dbd4e..c210902 100644 --- a/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 +++ b/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 @@ -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 python sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \ apt-get clean{% endraw %} diff --git a/{{cookiecutter.app_name}}_role/molecule/default/molecule.yml b/{{cookiecutter.app_name}}_role/molecule/default/molecule.yml index b3da2fb..83c6550 100644 --- a/{{cookiecutter.app_name}}_role/molecule/default/molecule.yml +++ b/{{cookiecutter.app_name}}_role/molecule/default/molecule.yml @@ -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 diff --git a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} index eb97830..190df8b 100644 --- a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} +++ b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} @@ -10,8 +10,8 @@ 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 From 8ef54f7f0d1b15129adf4ed8a0ed87d32208bde6 Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Wed, 23 Mar 2022 18:01:02 +0100 Subject: [PATCH 2/6] Update ansible to v5.2.0 and ansible-lint to v5.3.2 --- README.md | 4 ++-- cookiecutter.json | 4 ++-- test.sh | 6 +++--- {{cookiecutter.app_name}}_role/molecule/default/verify.yml | 2 +- {{cookiecutter.app_name}}_role/tasks/install.yml | 2 ++ {{cookiecutter.app_name}}_role/tasks/main.yml | 6 +++--- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b14d5b4..d1ef27a 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ github_user [idealista]: company [Idealista S.A.U.]: author []: pablogcaldito min_ansible_version []: 2.2 -ansible_version []: 2.8.8 +ansible_version []: 5.2.0 molecule_version []: 3.0.1 python_docker_version []: 4.1.0 -ansible_lint_version []: 4.2.0 +ansible_lint_version []: 5.3.2 license [Apache 2.0]: galaxy_tag_1 [example_tag1]: github_cli galaxy_tag_2 [example_tag2]: github diff --git a/cookiecutter.json b/cookiecutter.json index 3c9c9c3..8a5240c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,11 +7,11 @@ "company": "Idealista S.A.U.", "author": "", "min_ansible_version": "", - "ansible_version": "4.4.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.1.2", + "ansible_lint_version":"5.3.2", "license":"Apache 2.0", "galaxy_tag_1":"example_tag1", "galaxy_tag_2":"example_tag2", diff --git a/test.sh b/test.sh index dfc090a..4ab9398 100755 --- a/test.sh +++ b/test.sh @@ -8,11 +8,11 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal exec_name="gh" \ author="John Doe" \ min_ansible_version="2.2" \ - ansible_version="4.4.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.1.2" \ + ansible_lint_version="5.3.2" \ has_service="False" \ has_files="False" \ has_handlers="False" \ @@ -29,7 +29,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 diff --git a/{{cookiecutter.app_name}}_role/molecule/default/verify.yml b/{{cookiecutter.app_name}}_role/molecule/default/verify.yml index a604052..94e9691 100644 --- a/{{cookiecutter.app_name}}_role/molecule/default/verify.yml +++ b/{{cookiecutter.app_name}}_role/molecule/default/verify.yml @@ -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 diff --git a/{{cookiecutter.app_name}}_role/tasks/install.yml b/{{cookiecutter.app_name}}_role/tasks/install.yml index 0ffea00..34025a9 100644 --- a/{{cookiecutter.app_name}}_role/tasks/install.yml +++ b/{{cookiecutter.app_name}}_role/tasks/install.yml @@ -25,6 +25,7 @@ owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}" group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}" {%- endif %} + mode: 0755 state: directory with_items: - "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}" @@ -38,6 +39,7 @@ owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}" group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}" {%- endif %} + mode: 0755 state: directory when: {{ cookiecutter.app_name }}_log_file is defined tags: diff --git a/{{cookiecutter.app_name}}_role/tasks/main.yml b/{{cookiecutter.app_name}}_role/tasks/main.yml index f959f73..25be2e8 100644 --- a/{{cookiecutter.app_name}}_role/tasks/main.yml +++ b/{{cookiecutter.app_name}}_role/tasks/main.yml @@ -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 %} \ No newline at end of file From 16095bb0312d685702c5b650c167509a4dbfe551 Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Wed, 23 Mar 2022 18:47:05 +0100 Subject: [PATCH 3/6] Update travis ci yml file --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6894123..a709d07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ --- -dist: xenial +dist: focal language: python python: "3.9" os: linux services: - docker install: - - pip3 install cookiecutter + - pip install pipenv env: jobs: - MOLECULE_DISTRO=debian:bullseye-slim From 1121b4534e5b3949940060a80afc5bc88df390be Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Thu, 24 Mar 2022 10:15:55 +0100 Subject: [PATCH 4/6] Update CHANGELOG.md and README.md --- CHANGELOG.md | 3 ++- README.md | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e412f4f..27cda06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [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 #86* @sperez +- *[#86](https://github.com/idealista/cookiecutter-ansible-role/issues/86) Upgrade molecule config to test under debian bullseye* @sperez +- *[#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* @sperez ## [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 diff --git a/README.md b/README.md index d1ef27a..ac95f8f 100644 --- a/README.md +++ b/README.md @@ -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). From fdbc7c3908f3013606fad0b1af3a41524eb2e1a7 Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Thu, 24 Mar 2022 11:13:47 +0100 Subject: [PATCH 5/6] Change CHANGELOG.md to use github user --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27cda06..9ccfdb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [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* @sperez -- *[#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* @sperez +- *[#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 From 8a599c249f60eeae22556cd8db3c68569c0a787b Mon Sep 17 00:00:00 2001 From: santi-eidu Date: Thu, 24 Mar 2022 18:20:09 +0100 Subject: [PATCH 6/6] Remove python2 in molecule Dockerfile --- {{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 b/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 index c210902..0b1c413 100644 --- a/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 +++ b/{{cookiecutter.app_name}}_role/molecule/default/Dockerfile.j2 @@ -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 python3-pip && \ + apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \ apt-get clean{% endraw %}