Ansible inventory structure

There are two bundle types in ADCM. On this page the Ansible inventory file structure is described for each type.

There is no config section for hosts in inventory file as well. Everything specified for a host in the prototype config section is added directly to host dictionary.

Inventory file for a cluster bundle

Cluster is specified inside inventory.json via the attributes given in the table below.

Inventory file cluster attributes
Attribute Description

id

Internal cluster identifier

state

Current state of a cluster

multi_state

Additional current state of a cluster

before_upgrade

Cluster configuration that existed before an upgrade

config

Current cluster configuration

name

Cluster name defined by the user

version

Cluster version according to prototype description

edition

Cluster edition according to prototype description

Services are specified via the following attributes.

Inventory file service attributes
Attribute Description

<service name>

Service name according to prototype description

id

Internal service identifier

state

Current state of a service

multi_state

Additional current state of a service

before_upgrade

Service configuration that existed before an upgrade

config

Current service configuration

display_name

Service display name according to prototype description

version

Service version according to prototype description

maintenance_mode

Current maintenance mode state for a service

<component name>

Component name according to prototype description

Inventory file component attributes
Attribute Description

component_id

Internal component identifier

state

Current state of a component

multi_state

Additional current state of a component

before_upgrade

Component configuration that existed before an upgrade

config

Current component configuration

display_name

Component display name according to prototype description

maintenance_mode

Current maintenance mode state for a component

Example:

{
  "all": {
    ...
    "vars": {
      "cluster": {
        "id": 210,
        "state": "installed",
        "multi_state": [],
        "before_upgrade": {
          "state": null
        },
        "config": {
	  ...
        },
        "name": "adh",
        "version": "3.2.4_arenadata2_b1-for_autotest",
        "edition": "enterprise"
      },
      "services": {
        "zookeeper": {
          "id": 193,
          "state": "installed",
          "multi_state": [],
          "before_upgrade": {
            "state": null
          },
          "config": {
	    ...
          },
          "display_name": "Zookeeper",
          "version": "3.5.10_arenadata1",
          "maintenance_mode": false,
          "SERVER": {
            "component_id": 582,
            "state": "installed",
            "multi_state": [],
            "before_upgrade": {
              "state": null
            },
            "config": {
              ...
            },
            "display_name": "Zookeeper Server",
            "maintenance_mode": false
          }
        }
      }
    }
  }
}

Inventory file for an infrastructure bundle

The hostprovider is represented in inventory.json via the attributes listed in the table below.

Inventory file hostprovider attributes
Attribute Description

id

Internal hostprovider identifier

host_prototype_id

Internal host prototype identifier

name

Hostprovider name defined by the user

state

Current state of a hostprovider

multi_state

Additional current state of a hostprovider

before_upgrade

Hostprovider configuration that existed before an upgrade

config

Current hostprovider configuration

Example:

{
  "all": {
    ...
    "vars": {
      "provider": {
        "id": 236,
        "host_prototype_id": 1292,
        "name": "Yandex Compute VM Provider 3.5",
        "state": "created",
        "multi_state": [],
        "before_upgrade": {
          "state": null
        },
        "config": {
          ...
        }
      }
    }
  }
}

Inventory file section for hosts

The host is represented in inventory.json according to the attributes listed in the table below. <host> and its description are added to <INVENTORY GROUP NAME> according to the rules for forming inventory groups.

Inventory file host attributes
Attribute Description

adcm_hostid

Internal host identifier

state

Current state of a host

multi_state

Additional current state of a host

ansible_ssh_common_args

Common SSH arguments for Ansible

instance

Host configuration according to prototype description

ansible_host

Name of the host to connect to

ansible_ssh_port

SSH port for Ansible

ansible_ssh_pass

Ansible SSH password

ansible_become

Option for the force escalation of privileges

ansible_become_pass

Password for the force escalation of privileges

ansible_user

Username that is used for SSH connection

ansible_ssh_private_key_file

Ansible SSH private key

Example:

{
  "all": {
    "children": {
      <INVENTORY GROUP NAME>:
        "hosts": {
         <host>: {
            "adcm_hostid": 229,
            "state": "running",
            "multi_state": [],
            "ansible_ssh_common_args": "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null",
            "instance": {
              ...
            },
            "ansible_host": "10.92.40.43",
            "ansible_port": "22",
            "ansible_become": true,
            "ansible_user": "adcm",
            "ansible_ssh_private_key_file": "/adcm/data/file/host.229.ansible_ssh_private_key_file.",
          },
	  ...
        }
      ...
    }
  }
}
Found a mistake? Seleсt text and press Ctrl+Enter to report it