---
- name: 'Create Provisioning Templates'  # noqa: args[module]
  theforeman.foreman.provisioning_template:
    username: "{{ foreman_username | default(omit) }}"
    password: "{{ foreman_password | default(omit) }}"
    server_url: "{{ foreman_server_url | default(omit) }}"
    validate_certs: "{{ foreman_validate_certs | default(omit) }}"
    name: "{{ item.name }}"
    audit_comment: "{{ item.audit_comment | default(omit) }}"
    file_name: "{{ item.file_name | default(omit) }}"
    kind: "{{ item.kind | default(omit) }}"
    locations: "{{ item.locations | default(omit) }}"
    locked: "{{ item.locked | default(omit) }}"
    operatingsystems: "{{ item.operatingsystems | default(omit) }}"
    organizations: "{{ item.organizations | default(omit) }}"
    template: "{{ item.template | default(omit) }}"
    state: "{{ item.state | default('present') }}"
  loop: "{{ foreman_provisioning_templates }}"
