---

- name: Test for supported package managers
  assert:
    that: ansible_pkg_mgr in [
            'apt',
          ]

- name: Run include vars tasks
  include: include_vars.yml

- name: Set packages__export_raw to get a raw list YAML output from the following templates
  set_fact:
    packages__export_raw: True

- name: Set packages__export_key_name to package_list
  set_fact:
    packages__class_install: '{{ lookup("template", "package_yaml.j2") | from_yaml }}'
    packages__class_absent: '{{ lookup("template", "package_yaml_absent.j2") | from_yaml }}'

- name: Fail when a package has a conflicting state
  fail:
    msg: 'The following packages are required to be installed and at the same time to should be absent: {{ packages__class_install | intersect(packages__absent_for_class[packages__host_class]|d([])) }}'
  when: (packages__class_install | intersect(packages__absent_for_class[packages__host_class]|d([])))

---

- name: Test for supported package managers
  assert:
    that: ansible_pkg_mgr in [
            'apt',
          ]

- name: Run include vars tasks
  include: include_vars.yml

- name: Set packages__export_raw to get a raw list YAML output from the following templates
  set_fact:
    packages__export_raw: True

- name: Set packages__export_key_name to package_list
  set_fact:
    packages__class_install: '{{ lookup("template", "package_yaml.j2") | from_yaml }}'
    packages__class_absent: '{{ lookup("template", "package_yaml_absent.j2") | from_yaml }}'

- name: Fail when a package has a conflicting state
  fail:
    msg: 'The following packages are required to be installed and at the same time should be absent: {{ packages__class_install | intersect(packages__class_absent) }}'
  when: (packages__class_install | intersect(packages__class_absent))

Fix conflicting state detection of present/absent package list
Fix conflicting state detection of present/absent package list
