theforeman.foreman.foreman_subnet (0.8.1) — module

Manage Foreman Subnets using Foreman API

Authors: Baptiste Agasse (@bagasse)

preview | supported by community

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==0.8.1


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 0.8.1

Description

Create and Delete Foreman Subnets using Foreman API


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: My subnet
  foreman_subnet:
    name: "My subnet"
    description: "My description"
    network: "192.168.0.0"
    mask: "255.255.255.192"
    gateway: "192.168.0.1"
    from_ip: "192.168.0.2"
    to_ip: "192.168.0.42"
    boot_mode: "Static"
    dhcp_proxy: "smart-proxy1.foo.example.com"
    tftp_proxy: "smart-proxy1.foo.example.com"
    dns_proxy: "smart-proxy2.foo.example.com"
    template_proxy: "smart-proxy2.foo.example.com"
    vlanid: 452
    mtu: 9000
    domains:
    - "foo.example.com"
    - "bar.example.com"
    organizations:
    - "Example Org"
    locations:
    - "Toulouse"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "secret"
    state: present

Inputs

    
mtu:
    description: MTU
    required: false
    type: int

cidr:
    description: CIDR prefix length; Required if no mask provided
    type: int

ipam:
    choices:
    - DHCP
    - Internal DB
    - Random DB
    - EUI-64
    - None
    default: DHCP
    description: IPAM mode for this subnet
    required: false
    type: str

mask:
    description: Subnet netmask. Required if no cidr prefix length provided
    type: str

name:
    description: Subnet name
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the entity in Foreman
    type: str

to_ip:
    description: Last IP address of the host IP allocation pool
    required: false
    type: str

vlanid:
    description: VLAN ID
    required: false
    type: int

domains:
    description: List of DNS domains the subnet should assigned to
    elements: str
    required: false
    type: list

from_ip:
    description: First IP address of the host IP allocation pool
    required: false
    type: str

gateway:
    description: Subnet gateway IP address
    required: false
    type: str

network:
    description: Subnet IP address
    required: true
    type: str

password:
    description: Password of the user accessing the Foreman server
    required: true
    type: str

username:
    description: Username accessing the Foreman server
    required: true
    type: str

boot_mode:
    choices:
    - DHCP
    - Static
    default: DHCP
    description: Boot mode used by hosts in this subnet
    required: false
    type: str

dns_proxy:
    description: DNS Smart proxy for this subnet
    required: false
    type: str

locations:
    description: List of locations the entity should be assigned to
    elements: str
    type: list

dhcp_proxy:
    description: DHCP Smart proxy for this subnet
    required: false
    type: str

parameters:
    description:
    - Subnet specific host parameters
    elements: dict
    required: false
    suboptions:
      name:
        description:
        - Name of the parameter
        required: true
        type: str
      parameter_type:
        choices:
        - string
        - boolean
        - integer
        - real
        - array
        - hash
        - yaml
        - json
        default: string
        description:
        - Type of the parameter
        type: str
      value:
        description:
        - Value of the parameter
        required: true
        type: raw
    type: list

server_url:
    description: URL of the Foreman server
    required: true
    type: str

tftp_proxy:
    description: TFTP Smart proxy for this subnet
    required: false
    type: str

description:
    description: Description of the subnet
    type: str

dns_primary:
    description: Primary DNS server for this subnet
    required: false
    type: str

network_type:
    choices:
    - IPv4
    - IPv6
    default: IPv4
    description: Subnet type
    type: str

updated_name:
    description: New subnet name. When this parameter is set, the module will not be idempotent.
    type: str

dns_secondary:
    description: Secondary DNS server for this subnet
    required: false
    type: str

organizations:
    description: List of organizations the entity should be assigned to
    elements: str
    type: list

httpboot_proxy:
    description: HTTP Boot Smart proxy for this subnet
    required: false
    type: str

template_proxy:
    description: Template Smart proxy for this subnet
    required: false
    type: str

validate_certs:
    aliases:
    - verify_ssl
    default: true
    description: Whether or not to verify the TLS certificates of the Foreman server
    type: bool

discovery_proxy:
    description:
    - Discovery Smart proxy for this subnet
    - This option is only available if the discovery plugin is installed.
    required: false
    type: str

remote_execution_proxies:
    description:
    - Remote execution Smart proxies for this subnet
    - This option is only available if the remote_execution plugin is installed.
    elements: str
    required: false
    type: list