---

- name: Display the role path
  debug:
    var: role_path

- name: Print deprecation notice
  pause:
    prompt: |
      ""
      "*** NOTE: This role is deprecated. ***"
      ""
      "Role sap_general_preconfigure provides all the features of this role, and more."
      "You can find the role in repository https://www.github.com/sap-linuxlab/community.sap_install ."
      ""
      "Press RETURN to continue anyway, or <ctrl>c, a, to abort:"

- name: Include OS specific vars
  include_vars: '{{ item }}'
  with_first_found:
    - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml'
    - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml'
    - '{{ ansible_os_family }}.yml'

- name: Set filename prefix to empty string if role is run in normal mode
  set_fact:
    __sap_preconfigure_fact_assert_filename_prefix: ""
  when: not sap_preconfigure_assert|d(false)

- name: Prepend filename with assert string if role is run in assert mode
  set_fact:
    __sap_preconfigure_fact_assert_filename_prefix: "assert-"
  when: sap_preconfigure_assert|d(false)

# required for installation and configuration tasks:
- name: Gather package facts
  package_facts:

- include_tasks: '{{ __sap_preconfigure_fact_assert_filename_prefix }}installation.yml'
  when: sap_preconfigure_config_all|d(true) or sap_preconfigure_installation|d(false)

- include_tasks: '{{ __sap_preconfigure_fact_assert_filename_prefix }}configuration.yml'
  when: sap_preconfigure_config_all|d(true) or sap_preconfigure_configuration|d(false)
