---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

####################################################################
# WARNING: These are designed specifically for Ansible tests       #
# and should not be used as examples of how to write Ansible roles #
####################################################################

- block:

  - name: Make sure testhost directory exists
    file:
      path: '{{ remote_tmp_dir }}/files/'
      state: directory
    when: ansible_version.string is version('2.10', '<')
  - name: Copy test files to testhost
    copy:
      src: '{{ role_path }}/files/'
      dest: '{{ remote_tmp_dir }}/files/'

  - name: Run tests with copied certificates
    import_tasks: existing.yml

  - name: Create more certificates
    import_tasks: create.yml

  - name: Run tests with created certificates
    import_tasks: created.yml

  when: cryptography_version.stdout is version('1.5', '>=')
