community.general.cobbler – Cobbler inventory source

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.

New in version 1.0.0: of community.general

Synopsis

  • Get inventory hosts from the cobbler service.

  • Uses a configuration file as an inventory source, it must end in .cobbler.yml or .cobbler.yaml and has a plugin: cobbler entry.

Parameters

Parameter

Comments

cache

boolean

Toggle to enable/disable the caching of the inventory’s source data, requires a cache plugin setup to work.

Choices:

  • no ← (default)

  • yes

Configuration:

  • INI entry:

    [inventory]
    cache = no
    
  • Environment variable: ANSIBLE_INVENTORY_CACHE

cache_connection

string

Cache connection data or path, read cache plugin documentation for specifics.

Configuration:

  • INI entries:

    [defaults]
    fact_caching_connection = None
    
    [inventory]
    cache_connection = None
    
  • Environment variable: ANSIBLE_CACHE_PLUGIN_CONNECTION

  • Environment variable: ANSIBLE_INVENTORY_CACHE_CONNECTION

cache_fallback

boolean

Fallback to cached results if connection to cobbler fails

Choices:

  • no ← (default)

  • yes

cache_plugin

string

Cache plugin to use for the inventory’s source data.

Default: “memory”

Configuration:

  • INI entries:

    [defaults]
    fact_caching = memory
    
    [inventory]
    cache_plugin = memory
    
  • Environment variable: ANSIBLE_CACHE_PLUGIN

  • Environment variable: ANSIBLE_INVENTORY_CACHE_PLUGIN

cache_prefix

string

Prefix to use for cache plugin files/tables

Default: “ansible_inventory_”

Configuration:

  • INI entries:

    [default]
    fact_caching_prefix = ansible_inventory_
    
    [inventory]
    cache_prefix = ansible_inventory_
    
  • Environment variable: ANSIBLE_CACHE_PLUGIN_PREFIX

  • Environment variable: ANSIBLE_INVENTORY_CACHE_PLUGIN_PREFIX

cache_timeout

integer

Cache duration in seconds

Default: 3600

Configuration:

  • INI entries:

    [defaults]
    fact_caching_timeout = 3600
    
    [inventory]
    cache_timeout = 3600
    
  • Environment variable: ANSIBLE_CACHE_PLUGIN_TIMEOUT

  • Environment variable: ANSIBLE_INVENTORY_CACHE_TIMEOUT

exclude_profiles

list / elements=string

Profiles to exclude from inventory

Default: []

group

string

Group to place all hosts into

Default: “cobbler”

group_by

list / elements=string

Keys to group hosts by

Default: [“mgmt_classes”, “owners”, “status”]

group_prefix

string

Prefix to apply to cobbler groups

Default: “cobbler_”

password

string

Cobbler authentication password

Configuration:

  • Environment variable: COBBLER_PASSWORD

plugin

string / required

The name of this plugin, it should always be set to community.general.cobbler for this plugin to recognize it as it’s own.

Choices:

  • cobbler

  • community.general.cobbler

url

string

URL to cobbler.

Default: “http://cobbler/cobbler_api”

Configuration:

  • Environment variable: COBBLER_SERVER

user

string

Cobbler authentication user.

Configuration:

  • Environment variable: COBBLER_USER

want_facts

boolean

Toggle, if true the plugin will retrieve host facts from the server

Choices:

  • no

  • yes ← (default)

Examples

# my.cobbler.yml
plugin: community.general.cobbler
url: http://cobbler/cobbler_api
user: ansible-tester
password: secure

Authors

  • Orion Poplawski (@opoplawski)