<commit_before>---
# Main list of tasks to be executed.
#
#   Fail the play if it runs on an unsupported platform.
- name: Assert platform is supported
  tags: maven
  assert:
    that:
      - ansible_os_family in ['Archlinux', 'Debian', 'RedHat', 'Suse']


- name: Load version vars
  tags: maven
  with_first_found:
    - ../vars/versions/{{ maven_version }}.yml
    - ../vars/versions/default.yml
  include_vars: "{{ item }}"

- name: Assert version vars
  tags: maven
  assert:
    that:
      - maven_redis_sha256sum != None
      - maven_redis_sha256sum != ""


- include: local.yml
  tags: maven


- name: Install remote ansible data path directory
  tags: maven
  file:
    state=directory
    dest={{ remote_ansible_data_path }}

- name: Copy maven distribution
  tags: maven
  copy:
    src={{ local_ansible_data_path }}/{{ maven_redis_filename }}
    dest={{ remote_ansible_data_path }}/{{ maven_redis_filename }}
    owner=0
    group=0
    mode=0644


- name: Install Maven installation directory
  tags: maven
  file:
    state=directory
    owner=0
    group=0
    mode=0755
    dest={{ maven_install_dir }}


- name: Install Maven
  tags: maven
  unarchive:
    src={{ remote_ansible_data_path }}/{{ maven_redis_filename }}
    dest={{ maven_install_dir }}
    copy=false
    creates={{ maven_install_dir }}/apache-maven-{{ maven_version }}


- name: Install Maven bin directory
  tags: maven
  file:
    state=directory
    owner=0
    group=0
    mode=0755
    dest={{ maven_bin_path }}


- name: Install Maven binary
  tags: maven
  file:
    state=link
    force=true
    src={{ maven_install_dir }}/apache-maven-{{ maven_version }}/bin/mvn
    dest={{ maven_bin_path }}/mvn


- name: Install Ansible facts.d directory
  tags: maven
  file:
    state=directory
    dest=/etc/ansible/facts.d
    owner=0
    group=0
    mode=0755

- name: Install Maven facts
  tags: maven
  template:
    src=facts.j2
    dest=/etc/ansible/facts.d/maven.fact
    owner=0
    group=0
    mode=0644

- name: Re-read facts
  tags: maven
  setup:
    filter=ansible_local
<commit_msg>One-step assertion for version vars<commit_after>---
# Main list of tasks to be executed.
#
#   Fail the play if it runs on an unsupported platform.
- name: Assert platform is supported
  tags: maven
  assert:
    that:
      - ansible_os_family in ['Archlinux', 'Debian', 'RedHat', 'Suse']


- name: Load version vars
  tags: maven
  with_first_found:
    - ../vars/versions/{{ maven_version }}.yml
    - ../vars/versions/default.yml
  include_vars: "{{ item }}"

- name: Assert version vars
  tags: maven
  assert:
    that:
      - maven_redis_sha256sum not in (None, "")


- include: local.yml
  tags: maven


- name: Install remote ansible data path directory
  tags: maven
  file:
    state=directory
    dest={{ remote_ansible_data_path }}

- name: Copy maven distribution
  tags: maven
  copy:
    src={{ local_ansible_data_path }}/{{ maven_redis_filename }}
    dest={{ remote_ansible_data_path }}/{{ maven_redis_filename }}
    owner=0
    group=0
    mode=0644


- name: Install Maven installation directory
  tags: maven
  file:
    state=directory
    owner=0
    group=0
    mode=0755
    dest={{ maven_install_dir }}


- name: Install Maven
  tags: maven
  unarchive:
    src={{ remote_ansible_data_path }}/{{ maven_redis_filename }}
    dest={{ maven_install_dir }}
    copy=false
    creates={{ maven_install_dir }}/apache-maven-{{ maven_version }}


- name: Install Maven bin directory
  tags: maven
  file:
    state=directory
    owner=0
    group=0
    mode=0755
    dest={{ maven_bin_path }}


- name: Install Maven binary
  tags: maven
  file:
    state=link
    force=true
    src={{ maven_install_dir }}/apache-maven-{{ maven_version }}/bin/mvn
    dest={{ maven_bin_path }}/mvn


- name: Install Ansible facts.d directory
  tags: maven
  file:
    state=directory
    dest=/etc/ansible/facts.d
    owner=0
    group=0
    mode=0755

- name: Install Maven facts
  tags: maven
  template:
    src=facts.j2
    dest=/etc/ansible/facts.d/maven.fact
    owner=0
    group=0
    mode=0644

- name: Re-read facts
  tags: maven
  setup:
    filter=ansible_local

{'fraction_non_alphanumeric': 0.11167146974063401, 'fraction_numerical': 0.017050912584053793, 'mean_word_length': 2.9181561618062086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '454621', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1468, 'n_words': 371}