Skip to content

Commit

Permalink
Allow longer names for hooks related content
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cjeanner authored and openshift-merge-bot[bot] committed Apr 3, 2024
1 parent a312bf0 commit 406ec17
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions roles/run_hook/tasks/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 406ec17

Please sign in to comment.