---
- name: 'Create Subnets'  # noqa: args[module]
  theforeman.foreman.subnet:
    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 }}"
    bmc_proxy: "{{ item.bmc_proxy | default(omit) }}"
    boot_mode: "{{ item.boot_mode | default(omit) }}"
    cidr: "{{ item.cidr | default(omit) }}"
    description: "{{ item.description | default(omit) }}"
    dhcp_proxy: "{{ item.dhcp_proxy | default(omit) }}"
    discovery_proxy: "{{ item.discovery_proxy | default(omit) }}"
    dns_primary: "{{ item.dns_primary | default(omit) }}"
    dns_proxy: "{{ item.dns_proxy | default(omit) }}"
    dns_secondary: "{{ item.dns_secondary | default(omit) }}"
    domains: "{{ item.domains | default(omit) }}"
    externalipam_group: "{{ item.externalipam_group | default(omit) }}"
    externalipam_proxy: "{{ item.externalipam_proxy | default(omit) }}"
    from_ip: "{{ item.from_ip | default(omit) }}"
    gateway: "{{ item.gateway | default(omit) }}"
    httpboot_proxy: "{{ item.httpboot_proxy | default(omit) }}"
    ipam: "{{ item.ipam | default(omit) }}"
    locations: "{{ item.locations | default(omit) }}"
    mask: "{{ item.mask | default(omit) }}"
    mtu: "{{ item.mtu | default(omit) }}"
    network: "{{ item.network | default(omit) }}"
    network_type: "{{ item.network_type | default(omit) }}"
    organizations: "{{ item.organizations | default(omit) }}"
    parameters: "{{ item.parameters | default(omit) }}"
    remote_execution_proxies: "{{ item.remote_execution_proxies | default(omit) }}"
    template_proxy: "{{ item.template_proxy | default(omit) }}"
    tftp_proxy: "{{ item.tftp_proxy | default(omit) }}"
    to_ip: "{{ item.to_ip | default(omit) }}"
    vlanid: "{{ item.vlanid | default(omit) }}"
    state: "{{ item.state | default('present') }}"
  loop: "{{ foreman_subnets }}"
