On 02/04/2014 11:41 PM, Shuo Yang 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.
I can't really speak from experience with the cobbler script, but for
most other dynamic inventory scripts, vars for each host end up in
hostvars[hostname].
http://docs.ansible.com/developing_inventory.html
The the json output from the cobbler script would shed more light on how
it works.
--
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.