theforeman / theforeman.foreman / 4.0.0 / module / subnet Manage Subnets | "added in version" 1.0.0 of theforeman.foreman" Authors: Baptiste Agasse (@bagasse)theforeman.foreman.subnet (4.0.0) — module
Install with ansible-galaxy collection install theforeman.foreman:==4.0.0
collections: - name: theforeman.foreman version: 4.0.0
Create, update, and delete Subnets
- name: My subnet theforeman.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: "changeme" state: present
mtu: description: MTU required: false type: int cidr: description: CIDR prefix length; Required if I(network_type=IPv4) and no I(mask) provided type: int ipam: choices: - DHCP - Internal DB - Random DB - EUI-64 - External IPAM - None default: DHCP description: IPAM mode for this subnet required: false type: str mask: description: Subnet netmask. Required if I(network_type=IPv4) and no I(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 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. - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD) will be used instead. required: true type: str username: description: - Username accessing the Foreman server. - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME) will be used instead. required: true type: str bmc_proxy: description: BMC Smart proxy for this subnet required: false type: str version_added: 2.1.0 version_added_collection: theforeman.foreman boot_mode: choices: - DHCP - Static default: DHCP description: Boot mode used by hosts in this subnet required: false type: str dns_proxy: description: Reverse 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. - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL) will be used instead. 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: default: true description: - Whether or not to verify the TLS certificates of the Foreman server. - If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS) will be used instead. 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 externalipam_group: description: - External IPAM group for this subnet. - Only relevant if I(ipam=External IPAM). required: false type: str version_added: 1.5.0 version_added_collection: theforeman.foreman externalipam_proxy: description: - External IPAM proxy for this subnet. - Only relevant if I(ipam=External IPAM). 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. - This will always report I(changed=true) when used with I(remote_execution < 4.1.0), due to a bug in the plugin. elements: str required: false type: list
entity: contains: subnets: description: List of subnets. elements: dict type: list description: Final state of the affected entities grouped by their type. returned: success type: dict