Tech/OSS/Ansible/Guide/inventory

From lathama
< Tech‎ | OSS‎ | Ansible‎ | Guide
Jump to navigation Jump to search

Example inventories for the guide

inventory.yaml

---

all:
  hosts:
    localhost:
  children:
    cloud:
      hosts:
        cloudhost:
    servers:
      hosts:
        localserver1:
        localserver2:
      vars:
        region: 'region1'
    bootstrap:
      hosts:
        brand-new-host.somedomain.tld:
          ansible_host: '192.168.1.123'
    legacy:
      hosts:
        oldcisco:
          ansible_ssh_common_args: '-o KexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc'
          ansible_host: '192.168.1.9'
          ansible_user: 'cisco'
          ansible_password: 'topsecret'

host_vars/singlehost.yaml

---

# a variable file for a single host

domain_name: 'example.org'

group_vars/all.yaml

---

# Variables for all hosts can live here

domain_name: 'example.com'