Hi Matt,

How can i force openstack.py script to write IPv4 address? For some reason
the JSON file has IPv6 address.

  "mesos_masters": [
    "b9d2e61e-0653-4a1f-a472-c5f15a017eae",
    "ca8c9fc7-337f-4f92-baac-7fe41f6475ce",
    "a904e509-b4b1-479e-8137-17bb30b400c9"
  ],

I tried the below and it worked

ansible-playbook jenkins_mesos_master.yml -i openstack.py --limit
a904e509-b4b1-479e-8137-17bb30b400c9 --check

PLAY
***************************************************************************

TASK [setup]
*******************************************************************
ok: [a904e509-b4b1-479e-8137-17bb30b400c9]

Thanks,
Govind

On Tue, Feb 16, 2016 at 7:25 PM, govindaraj <[email protected]>
wrote:

> Hi Matt,
>
> Here is the output from running openstack.py --list. Took a snippet of it.
>
>
>           "interface_ip": "96.119.246.10",
>           "key_name": "ssd-xplat",
>           "metadata": {
>             "cluster_name": "jenkins_mesos_master",
>             "group": "mesos_masters",
>             "master_count": "3",
>             "myid": "3"
>           },
>
>
> $ ansible-playbook jenkins_mesos_master.yml -i openstack.py --limit
> 96.119.246.10 --check
> ERROR! Specified --limit does not match any hosts
>
>
> Here is my jenkins_mesos_master.yml playbook
>
> - hosts: *mesos_masters *  (should this be the group name that i need to
> use? )
>   serial: "50%"
>   become: yes
>   become_method: sudo
>   roles:
>     - vmsetup
>     - mesos_master
>
>
>
> On Tue, Feb 16, 2016 at 5:18 PM, Matt Martz <[email protected]> wrote:
>
>> Effectively ansible is calling that inventory like `./openstack.py --list`
>>
>> You would need to inspect the output to see what is available.
>>
>> You are specifying a hosts entry of `jenkins_mesos_slave_prod`, so the
>> dynamic inventory would need to return that group for it to be used.
>>
>> On Tue, Feb 16, 2016 at 4:12 PM, govindaraj <[email protected]>
>> wrote:
>>
>>> Thanks Matt.
>>>
>>> How do i execute this dynamic inventory against my playbook? When i
>>> tried the below it says no hosts matches.
>>>
>>> #ansible-playbook jenkins_mesos_slave.yml -i openstack.py --limit
>>> jmesosslv-cmce-02p.sys.comcast.net
>>>
>>> Here is my playbook. How can i ensure my playbook can run against this
>>> dynamic inventory file?
>>>
>>>  #vi jenkins_mesos_slave.yml
>>> - hosts: jenkins_mesos_slave_prod
>>>   become: yes
>>>   become_method: sudo
>>>   roles:
>>>     - vmsetup
>>>     - mesos_slave
>>>
>>> On Tue, Feb 16, 2016 at 5:07 PM, Matt Martz <[email protected]> wrote:
>>>
>>>> The dynamic inventory scripts are supposed to be used in place of a ini
>>>> formatted inventory.
>>>>
>>>> Instead of using `-i /path/to/ini/inventory`  you would use `-i
>>>> /path/to/openstack.py`
>>>>
>>>> To make that possible, the `openstack.py` file needs to be marked as
>>>> executable.
>>>>
>>>> On Tue, Feb 16, 2016 at 4:05 PM, Govindaraj Venkatesan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Is there any script that we can use to construct dynamic inventory
>>>>> file for Openstack?
>>>>>
>>>>> I downloaded the script but it gives a JSON output. Does anyone have a
>>>>> script to convert JSON to update a inventory file with list of IP address?
>>>>> You can download the latest version of the OpenStack inventory script
>>>>> at:
>>>>> https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack.py
>>>>>
>>>>> Thanks,
>>>>> Govind
>>>>>
>>>>> --
>>>>> 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].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/ansible-project/b038f3e7-7e79-4348-9464-0271f815459f%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/b038f3e7-7e79-4348-9464-0271f815459f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Matt Martz
>>>> @sivel
>>>> sivel.net
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Ansible Project" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/ansible-project/nlgO5fheU7g/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To post to this group, send email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/CAD8N0v9D8-EfpJnC%3D2KNiuhwo75EjROC%2B9QwkDYGotnBVORKKA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v9D8-EfpJnC%3D2KNiuhwo75EjROC%2B9QwkDYGotnBVORKKA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Thanks & Regards
>>> Govindaraj Venkatesan
>>>
>>> --
>>> 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].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CAPnj__gJ76iUqFAZnipWnMm1fUs-FDHbi3v3Jcykk7wLnFcfCA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAPnj__gJ76iUqFAZnipWnMm1fUs-FDHbi3v3Jcykk7wLnFcfCA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Matt Martz
>> @sivel
>> sivel.net
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/nlgO5fheU7g/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAD8N0v-tJVDC7Ee3noHBg%3DqDr_98b20V26FMyauUNrcbo9hX1w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v-tJVDC7Ee3noHBg%3DqDr_98b20V26FMyauUNrcbo9hX1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Thanks & Regards
> Govindaraj Venkatesan
>



-- 

Thanks & Regards
Govindaraj Venkatesan

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPnj__hA6JKuVu_MHhxqJWhd8Xn7okx3Rs%2B%3D%3DPvHmNjYXK8DvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to