2015-01-06 28 views
0

我試圖配置Ansible 1.9以啓動一些OpenStack Nova實例。 對於每個實例,我試圖自動分配一個浮動IP,並將其連接到一個公共段。 當我試試這個:使用Ansible 1.9將浮動IP分配給OpenStack Nova實例的問題

- name: launch Web01 instance 
    hosts: csc 
    tasks: 
    - nova_compute: 
     state: present 
     login_username: tenant_2_user 
     login_password: hello 
     login_tenant_name: tenant_2 
     name: Web01 
     auth_url: http://mylocalhost:5000/v2.0/ 
     region_name: RegionOne 
     image_id: 95c5f4f2-84f2-47fb-a466-3c786677d21c 
     wait_for: 200 
     flavor_id: b772be9a-98cd-446f-879e-89baef600ff0 
     security_groups: default 
    - neutron_floating_ip: 
     state=present 
     login_username=tenant_2_user 
     login_password=hello 
     login_tenant_name=tenant_2 
     network_name=ext-net 
     instance_name=Web01 

我得到:ERROR:neutron_floating_ip不處於Ansible任務或處理程序

法律參數,當我嘗試這樣的:

- name: launch Web01 instance 
    hosts: csc 
    tasks: 
    - nova_compute: 
     state: present 
     login_username: tenant_2_user 
     login_password: hello 
     login_tenant_name: tenant_2 
     name: Web01 
     auth_url: http://mylocalhost:5000/v2.0/ 
     region_name: RegionOne 
     image_id: 95c5f4f2-84f2-47fb-a466-3c786677d21c 
     wait_for: 200 
     flavor_id: b772be9a-98cd-446f-879e-89baef600ff0 
     security_groups: default 
     auto_floating_ip: yes 

消息:不支持模塊參數:auto_floating_ip

這是我的Ansible版本:ansible --version ansible 1.9 配置的模塊搜索路徑=/usr/share/ansible

我可以做些什麼來讓Ansible分配這些浮動IP?

-Eugene

回答

2

我明白了。你不需要使用

auto_floating_ip: yes 

只使用

floating_ip_pools: 
    - Your-external/public-network-id 

希望這有助於。