---

- name: Ensure tripleo-validations rpm requirements are installed
  yum:
    name: openstack-tripleo-validations
    state: present
  become: true

- name: Create run-tripleo-validations.sh
  template:
    src: "{{ run_tripleo_validations_script }}"
    dest: "{{ val_working_dir }}/run-tripleo-validations.sh"
    mode: 0755
  when: run_tripleo_validations|bool

- when: run_tripleo_validations_negative_tests|bool
  block:
    - name: Create run-preintro-validations-negative-tests.sh
      template:
        src: "{{ run_preintro_val_script }}"
        dest: "{{ val_working_dir }}/run-preintro-validations-negative-tests.sh"
        mode: 0755

    - name: Create run-predep-validations-negative-tests.sh
      template:
        src: "{{ run_predep_val_script }}"
        dest: "{{ val_working_dir }}/run-predep-validations-negative-tests.sh"
        mode: 0755

    - name: Create run-postdep-validations-negative-tests.sh
      template:
        src: "{{ run_postdep_val_script }}"
        dest: "{{ val_working_dir }}/run-postdep-validations-negative-tests.sh"
        mode: 0755
