In the above, a new profile is created based on the CentOS one. This is
done so that specific kickstart metadata (the ksmeta options) can be
assigned to it. The kickstart metadata will be listed as variables in the
Ansible inventory. Two new systems are then created using the new profile,
assigned to a management class (the equivalent of a group in Ansible), and
additional metadata are assigned to it.

When viewed with --host, the foo server would look like this:

{
  "a": "2",
  "b": "3",
  "c": "4"
}

while bar would look like this:

{
  "a": "2",
  "b": "3",
  "c": "5"
}



On Tue, Feb 4, 2014 at 10:41 PM, Shuo Yang <[email protected]> wrote:

> I am reading Ansible's dynamic inventory,
> http://docs.ansible.com/intro_dynamic_inventory.html#example-the-cobbler-external-inventory-script
>
> One question regarding the following code snippet. I would love to hear a
> high level explanation of what this code has achieved line by line. If it
> is too long answer to write, I would like to at least understand how/where
> "a, b, c" is persisted to (are they actually being persisted to
> host_vars/foo, host_vars/bar and group_vars/webserver?)
>
> Thanks,
> Shuo
>
>     -------------
>
> cobbler profile add --name=webserver --distro=CentOS6-x86_64
> cobbler profile edit --name=webserver --mgmt-classes="webserver" 
> --ksmeta="a=2 b=3"
> cobbler system edit --name=foo --dns-name="foo.example.com" 
> --mgmt-classes="atlanta" --ksmeta="c=4"
> cobbler system edit --name=bar --dns-name="bar.example.com" 
> --mgmt-classes="atlanta" --ksmeta="c=5"
>
> -------------
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to