我的环境:Ansible 1.7.1 / Ubuntu
我有一个私有的OpenStack网络,如果我使用neutron
命令它可以正常工作:
$ env | grep OS_
OS_PASSWORD=cai
OS_AUTH_URL=http://demo-controller:35357/v2.0
OS_USERNAME=larry
OS_TENANT_NAME=demo
$ neutron net-list
+--------------------------------------+---------+--------------------------+
| id | name | subnets |
+--------------------------------------+---------+--------------------------+
| 5ecc0fbb-091b-4c6a-b905-c73e66e1ffda | ext-net | 3aa6539d-24d3-4c06-.. |
| 76506b52-1980-470c-b438-094e8b4bb3e7 | demo-1 | 52cd943d-7f25-4a11-.. |
+--------------------------------------+---------+--------------------------+
现在我想使用quantum_network模块获取network-id
:
$ ansible localhost -m quantum_network -a "state=present login_username=larry login_password=cai login_tenant_name=demo name=demo-1 auth_url=http://demo-controller:35357/v2.0/" -v
但是这会引发身份验证错误:
... File \"/usr/lib/python2.7/dist-packages/keystoneclient/utils.py\", line 318, in
inner\n return func(*args, **kwargs)\n File \"/usr/lib/python2.7/dist- packages/keystoneclient/session.py\", line 251, in request\n raise exceptions.from_response(resp, method, url)\nkeystoneclient.apiclient.exceptions.Forbidden: You are not authorized to perform the requested action, admin_required. (HTTP 403)\n",
"parsed": false
有什么问题?
答案 0 :(得分:1)
这是quantum_network
模块中的错误,请参阅issue #7275,它需要管理员权限才能获得租户ID,这不是必需的。
不确定哪个ansible版本会包含此内容。
我在发行版中使用提交作为补丁