From a3fb7e6a37e51331a3904083b22a8483ccdccc5d Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Tue, 19 Jan 2021 10:03:27 +0100 Subject: [PATCH 1/3] Add tags to included tasks --- CHANGELOG.md | 1 + .../tasks/install.yml | 18 ++++++++++++++++++ .../tasks/service.yml | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a1217..84f9631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## Unreleased ### Fixed +- *[#50](https://github.com/idealista/cookiecutter-ansible-role/issues/50) Tags not applied properly from playbook* @vicsufer ### Added ### Changed ### Removed diff --git a/{{cookiecutter.app_name}}_role/tasks/install.yml b/{{cookiecutter.app_name}}_role/tasks/install.yml index 6a02571..7f3b67e 100644 --- a/{{cookiecutter.app_name}}_role/tasks/install.yml +++ b/{{cookiecutter.app_name}}_role/tasks/install.yml @@ -5,6 +5,8 @@ name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}" system: yes state: present + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} user user: @@ -13,6 +15,8 @@ system: yes shell: /usr/sbin/nologin createhome: no + tags: + - {{ cookiecutter.app_name }}_install {% endif %} - name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths file: @@ -24,6 +28,8 @@ state: directory with_items: - "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}" + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Ensure skeleton log paths file: @@ -34,18 +40,24 @@ {% endif %} state: file when: {{ cookiecutter.app_name }}_log_file is defined + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Check {{ cookiecutter.app_name }} version command: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} --version" register: {{ cookiecutter.app_name }}_check changed_when: false ignore_errors: true + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Download package get_url: url: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_url {% raw %}}}{% endraw %}" dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package_path {% raw %}}}{% endraw %}" 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 + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Extract downloaded package unarchive: @@ -53,6 +65,8 @@ dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}" remote_src: True 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 + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Copy binary copy: @@ -65,6 +79,8 @@ 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 + tags: + - {{ cookiecutter.app_name }}_install - name: {{ cookiecutter.app_name | upper }} | Link binary file: @@ -72,3 +88,5 @@ dest: "/usr/bin/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}" state: link 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 + tags: + - {{ cookiecutter.app_name }}_install diff --git a/{{cookiecutter.app_name}}_role/tasks/service.yml b/{{cookiecutter.app_name}}_role/tasks/service.yml index 9c97f89..42cb70b 100644 --- a/{{cookiecutter.app_name}}_role/tasks/service.yml +++ b/{{cookiecutter.app_name}}_role/tasks/service.yml @@ -8,10 +8,14 @@ owner: root group: root notify: restart {{ cookiecutter.app_name }} + tags: + - {{ cookiecutter.app_name }}_service - name: {{ cookiecutter.app_name | upper }} | Configuring service systemd: name: {{ cookiecutter.app_name }} state: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_state {% raw %}}}{% endraw %}" enabled: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_enabled {% raw %}}}{% endraw %}" - daemon_reload: yes \ No newline at end of file + daemon_reload: yes + tags: + - {{ cookiecutter.app_name }}_service \ No newline at end of file From 3cb19fc4d913089eac57081e1c1fd774889be499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez=20Fern=C3=A1ndez?= <15276132+vicsufer@users.noreply.github.com> Date: Wed, 20 Jan 2021 09:07:06 +0100 Subject: [PATCH 2/3] Add newline at EOF in service.yml --- {{cookiecutter.app_name}}_role/tasks/service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.app_name}}_role/tasks/service.yml b/{{cookiecutter.app_name}}_role/tasks/service.yml index 42cb70b..a20310c 100644 --- a/{{cookiecutter.app_name}}_role/tasks/service.yml +++ b/{{cookiecutter.app_name}}_role/tasks/service.yml @@ -18,4 +18,4 @@ enabled: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_enabled {% raw %}}}{% endraw %}" daemon_reload: yes tags: - - {{ cookiecutter.app_name }}_service \ No newline at end of file + - {{ cookiecutter.app_name }}_service From fc1c8818646ab25f844e4062b973c7ee67d856b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez=20Fern=C3=A1ndez?= <15276132+vicsufer@users.noreply.github.com> Date: Wed, 20 Jan 2021 13:13:35 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f9631..d533cf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +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). ## Unreleased -### Fixed -- *[#50](https://github.com/idealista/cookiecutter-ansible-role/issues/50) Tags not applied properly from playbook* @vicsufer ### Added ### Changed +### Fixed ### Removed +## [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 +- *[#50](https://github.com/idealista/cookiecutter-ansible-role/issues/50) Tags not applied properly from playbook* @vicsufer + ## [2.4.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.4.0) ### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.3.0...2.4.0) ### Added