From 406ec1743ea6a6488d2175e27ef46f788b9e0c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Wed, 3 Apr 2024 09:44:06 +0200 Subject: [PATCH] Allow longer names for hooks related content The ci_script module is truncating at 30 chars, and keep full words. The `truncate` filter in ansible allows to do the same, so let's converge. This patch also removes a now useless `ansible.builtin.debug` tasks: ci_script module outputs the log location directly, so we don't need to do it in a dedicated task anymore. --- roles/run_hook/tasks/playbook.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/roles/run_hook/tasks/playbook.yml b/roles/run_hook/tasks/playbook.yml index b005703e00..295b0b027c 100644 --- a/roles/run_hook/tasks/playbook.yml +++ b/roles/run_hook/tasks/playbook.yml @@ -5,7 +5,7 @@ {{ hook.name | regex_replace('([^a-zA-Z0-9\-\._])+', '_') | lower | - truncate(20, false, '') }} + truncate(30, true, '') }} _play: >- {%- if hook.source is not ansible.builtin.abs -%} {{ role_path }}/../../hooks/playbooks/{{ hook.source }} @@ -73,10 +73,6 @@ state: directory mode: "0755" -- name: Point to the generated log file - ansible.builtin.debug: - msg: "You can follow hook run here: {{ log_path }}" - # We cannot call ansible.builtin.import_playbook from within a play, # even less from a task. So the way to run a playbook from within a playbook # is to call a command. Though we may lose some of the data passed to the