community.general.cobbler_system (8.5.0) — module

Manage system objects in Cobbler

Authors: Dag Wieers (@dagwieers)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Add, modify or remove systems in Cobbler

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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: true
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Query all systems in Cobbler
  community.general.cobbler_system:
    host: cobbler01
    username: cobbler
    password: MySuperSecureP4sswOrd
    state: query
  register: cobbler_systems
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
host:
    default: 127.0.0.1
    description:
    - The name or IP address of the Cobbler system.
    type: str

name:
    description:
    - The system name to manage.
    type: str

port:
    description:
    - Port number to be used for REST connection.
    - The default value depends on parameter O(use_ssl).
    type: int

sync:
    default: false
    description:
    - Sync on changes.
    - Concurrently syncing Cobbler is bound to fail.
    type: bool

state:
    choices:
    - absent
    - present
    - query
    default: present
    description:
    - Whether the system should be present, absent or a query is made.
    type: str

use_ssl:
    default: true
    description:
    - If V(false), an HTTP connection will be used instead of the default HTTPS connection.
    type: bool

password:
    description:
    - The password to log in to Cobbler.
    type: str

username:
    default: cobbler
    description:
    - The username to log in to Cobbler.
    type: str

interfaces:
    description:
    - A list of dictionaries containing interface options.
    type: dict

properties:
    description:
    - A dictionary with system properties.
    type: dict

validate_certs:
    default: true
    description:
    - If V(false), SSL certificates will not be validated.
    - This should only set to V(false) when used on personally controlled sites using
      self-signed certificates.
    type: bool

Outputs

system:
  description: (Resulting) information about the system we are working with
  returned: when O(name) is provided
  type: dict
systems:
  description: List of systems
  returned: O(state=query) and O(name) is not provided
  type: list