community.general.cobbler_system – Manage system objects in Cobbler

Note

This plugin is part of the community.general collection (version 3.8.3).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.cobbler_system.

Synopsis

  • Add, modify or remove systems in Cobbler

Parameters

Parameter

Comments

host

string

The name or IP address of the Cobbler system.

Default: “127.0.0.1”

interfaces

dictionary

A list of dictionaries containing interface options.

name

string

The system name to manage.

password

string

The password to log in to Cobbler.

port

integer

Port number to be used for REST connection.

The default value depends on parameter use_ssl.

properties

dictionary

A dictionary with system properties.

state

string

Whether the system should be present, absent or a query is made.

Choices:

  • absent

  • present ← (default)

  • query

sync

boolean

Sync on changes.

Concurrently syncing Cobbler is bound to fail.

Choices:

  • no ← (default)

  • yes

use_ssl

boolean

If no, an HTTP connection will be used instead of the default HTTPS connection.

Choices:

  • no

  • yes ← (default)

username

string

The username to log in to Cobbler.

Default: “cobbler”

validate_certs

boolean

If no, SSL certificates will not be validated.

This should only set to no when used on personally controlled sites using self-signed certificates.

Choices:

  • no

  • yes ← (default)

Notes

Note

Examples

- name: Ensure the system exists in Cobbler
  community.general.cobbler_system:
    host: cobbler01
    username: cobbler
    password: MySuperSecureP4sswOrd
    name: myhost
    properties:
      profile: CentOS6-x86_64
      name_servers: [ 2.3.4.5, 3.4.5.6 ]
      name_servers_search: foo.com, bar.com
    interfaces:
      eth0:
        macaddress: 00:01:02:03:04:05
        ipaddress: 1.2.3.4
  delegate_to: localhost

- name: Enable network boot in Cobbler
  community.general.cobbler_system:
    host: bdsol-aci-cobbler-01
    username: cobbler
    password: ins3965!
    name: bdsol-aci51-apic1.cisco.com
    properties:
      netboot_enabled: yes
    state: present
  delegate_to: localhost

- name: Query all systems in Cobbler
  community.general.cobbler_system:
    host: cobbler01
    username: cobbler
    password: MySuperSecureP4sswOrd
    state: query
  register: cobbler_systems
  delegate_to: localhost

- name: Query a specific system in Cobbler
  community.general.cobbler_system:
    host: cobbler01
    username: cobbler
    password: MySuperSecureP4sswOrd
    name: '{{ inventory_hostname }}'
    state: query
  register: cobbler_properties
  delegate_to: localhost

- name: Ensure the system does not exist in Cobbler
  community.general.cobbler_system:
    host: cobbler01
    username: cobbler
    password: MySuperSecureP4sswOrd
    name: myhost
    state: absent
  delegate_to: localhost

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

system

dictionary

(Resulting) information about the system we are working with

Returned: when name is provided

systems

list / elements=string

List of systems

Returned: state=query and name is not provided

Authors

  • Dag Wieers (@dagwieers)