---
- name: Evaluate the custom tht script name
  set_fact:
    script_name: "{{ custom_tht_log|replace('_', '-')|replace('.log', '.sh') }}"

- name: Create custom tht script
  template:
    src: "{{ custom_tht_script }}"
    dest: "{{ working_dir }}/{{ script_name }}"
    mode: 0755

- name: Checkout custom tht heat templates from src
  shell: >
    set -o pipefail &&
    {{ working_dir }}/{{ script_name }} 2>&1 {{ timestamper_cmd }} >
    {{ custom_tht_log }}
  become: true
