foreman_subnet – Manage Foreman Subnets using Foreman API

Synopsis

  • Create and Delete Foreman Subnets using Foreman API

Requirements

The below requirements are needed on the host that executes this module.

  • apypie

  • ipaddress

Parameters

Parameter Choices/Defaults Comments
boot_mode
string
    Choices:
  • DHCP ←
  • Static
Boot mode used by hosts in this subnet
cidr
integer
CIDR prefix length; Required if no mask provided
description
string
Description of the subnet
dhcp_proxy
string
DHCP Smart proxy for this subnet
discovery_proxy
string
Discovery Smart proxy for this subnet
This option is only available if the discovery plugin is installed.
dns_primary
string
Primary DNS server for this subnet
dns_proxy
string
DNS Smart proxy for this subnet
dns_secondary
string
Secondary DNS server for this subnet
domains
list / elements=string
List of DNS domains the subnet should assigned to
from_ip
string
First IP address of the host IP allocation pool
gateway
string
Subnet gateway IP address
httpboot_proxy
string
HTTP Boot Smart proxy for this subnet
ipam
string
    Choices:
  • DHCP ←
  • Internal DB
  • Random DB
  • EUI-64
  • None
IPAM mode for this subnet
locations
list / elements=string
List of locations the entity should be assigned to
mask
string
Subnet netmask. Required if no cidr prefix length provided
mtu
integer
MTU
name
string / required
Subnet name
network
string / required
Subnet IP address
network_type
string
    Choices:
  • IPv4 ←
  • IPv6
Subnet type
organizations
list / elements=string
List of organizations the entity should be assigned to
parameters
list / elements=dictionary
Subnet specific host parameters
name
string / required
Name of the parameter
parameter_type
string
    Choices:
  • string ←
  • boolean
  • integer
  • real
  • array
  • hash
  • yaml
  • json
Type of the parameter
value
raw / required
Value of the parameter
password
string / required
Password of the user accessing the Foreman server
remote_execution_proxies
list / elements=string
Remote execution Smart proxies for this subnet
This option is only available if the remote_execution plugin is installed.
server_url
string / required
URL of the Foreman server
state
string
    Choices:
  • present ←
  • absent
State of the entity in Foreman
template_proxy
string
Template Smart proxy for this subnet
tftp_proxy
string
TFTP Smart proxy for this subnet
to_ip
string
Last IP address of the host IP allocation pool
updated_name
string
New subnet name. When this parameter is set, the module will not be idempotent.
username
string / required
Username accessing the Foreman server
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server

aliases: verify_ssl
vlanid
integer
VLAN ID

Examples

- 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

Status

Authors

  • Baptiste Agasse (@bagasse)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.