Files @ 0c330b88956a
Branch filter:

Location: majic-ansible-roles/roles/preseed/tasks/main.yml

branko
MAR-218: Switch to using task imports instead of includes:

- Should result in somewhat faster run, except the includes happen
during planning phase. None of the changed includes will have
problem with this.
- Solves the issue of (included) imported tasks not being tagged
properly, particularly in relation to the mechanism for explicitly
running all handlers.
---

- name: Create directory for storing preseed configurations
  ansible.builtin.file:
    path: "{{ preseed_directory }}"
    mode: "0750"
    state: directory

- name: Create preseed configuration file
  ansible.builtin.template:
    src: "preseed.cfg.j2"
    dest: "{{ preseed_directory }}/{{ item }}.cfg"
    mode: "0640"
  when: item != "localhost"
  with_items: "{{ groups['all'] }}"

- name: Explicitly run all handlers
  ansible.builtin.import_tasks: ../handlers/main.yml
  when: "run_handlers | default(False) | bool()"
  tags:
    - handlers