Spec-Zone.ru › Ansible

Building Ansible inventories

Note

Making Open Source More Inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. We ask that you open an issue or pull request if you come upon a term that we have missed. For more details, see our CTO Chris Wright’s message.

Welcome to the guide to building Ansible inventories. An inventory is a list of managed nodes, or hosts, that Ansible deploys and configures. This guide introduces you to inventories and covers the following topics:

  • Creating inventories to track a list of servers and devices that you want to automate.
  • Using dynamic inventories to track cloud services with servers and devices that are constantly starting and stopping.
  • Using patterns to automate specific sub-sets of an inventory.
  • Expanding and refining the connection methods Ansible uses for your inventory.
  • How to build your inventory
    • Inventory basics: formats, hosts, and groups
    • Passing multiple inventory sources
    • Organizing inventory in a directory
    • Adding variables to inventory
    • Assigning a variable to one machine: host variables
    • Defining variables in INI format
    • Assigning a variable to many machines: group variables
    • Organizing host and group variables
    • How variables are merged
    • Connecting to hosts: behavioral inventory parameters
    • Inventory setup examples
  • Working with dynamic inventory
    • Inventory script example: Cobbler
    • Other inventory scripts
    • Using inventory directories and multiple inventory sources
    • Static groups of dynamic groups
  • Patterns: targeting hosts and groups
    • Using patterns
    • Common patterns
    • Limitations of patterns
    • Pattern processing order
    • Advanced pattern options
    • Patterns and ad-hoc commands
    • Patterns and ansible-playbook flags
  • Implicit ‘localhost’
  • Connection methods and details
    • ControlPersist and paramiko
    • Setting a remote user
    • Setting up SSH keys
    • Running against localhost
    • Managing host key checking
    • Other connection methods

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/inventory_guide/index.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API