我想要创建一个带有ansible的GCE节点,并将其附加到一个固定的IP中。我的问题是ansible似乎没有这个选择的目的。
在搜索和搜索源代码之后,我找不到部署实例的代码在哪里。
如果有人有主意的话?
发布于 2014-12-17 00:03:41
我没有在ansible的源代码中找到它,因为它在不可测模块.核心中。
在对一个坏区域做了一个自愿的错误后,我进行了以下跟踪:
$ ansible-playbook create_vm.yml -i inventory/
PLAY [Create instance(s)] *****************************************************
TASK: [Launch instances] ******************************************************
failed: [localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File "/home/zulu/.ansible/tmp/ansible-tmp-1418774247.2-93981074391261/gce", line 2131, in <module>
main()
File "/home/zulu/.ansible/tmp/ansible-tmp-1418774247.2-93981074391261/gce", line 458, in main
module, gce, inames)
File "/home/zulu/.ansible/tmp/ansible-tmp-1418774247.2-93981074391261/gce", line 278, in create_instances
lc_machine_type = gce.ex_get_size(machine_type)
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 2240, in ex_get_size
zone = self.ex_get_zone(zone)
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 2333, in ex_get_zone
if name.startswith('https://'):
AttributeError: 'NoneType' object has no attribute 'startswith'事实上,任务是由临时脚本/home/zulu/.ansible/tmp/ansible-tmp-1418774247.2-93981074391261/gce启动的,在我的本地源代码中搜索了它之后,我找到了它!
我搜索的代码最初存储在git子模块:https://github.com/ansible/ansible/tree/devel/lib/ansible/modules中。
我已经请求添加external_ips选项:PR #539
https://stackoverflow.com/questions/27515976
复制相似问题