{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2064","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2064/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2064/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2064/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2064","id":149620831,"number":2064,"title":"Fixed netif params when create lxc container - Fixes #1217","user":{"login":"adriagalin","id":1245219,"avatar_url":"https://avatars.githubusercontent.com/u/1245219?v=3","gravatar_id":"","url":"https://api.github.com/users/adriagalin","html_url":"https://github.com/adriagalin","followers_url":"https://api.github.com/users/adriagalin/followers","following_url":"https://api.github.com/users/adriagalin/following{/other_user}","gists_url":"https://api.github.com/users/adriagalin/gists{/gist_id}","starred_url":"https://api.github.com/users/adriagalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriagalin/subscriptions","organizations_url":"https://api.github.com/users/adriagalin/orgs","repos_url":"https://api.github.com/users/adriagalin/repos","events_url":"https://api.github.com/users/adriagalin/events{/privacy}","received_events_url":"https://api.github.com/users/adriagalin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bugfix_pull_request","name":"bugfix_pull_request","color":"ded270"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/community_review","name":"community_review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-20T00:40:37Z","updated_at":"2016-04-20T04:25:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/2064","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2064","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/2064.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/2064.patch"},"body":"##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n[proxmox](https://github.com/ansible/ansible-modules-extras/blob/devel/cloud/misc/proxmox.py)\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.0.1.0\r\n```\r\n\r\n##### SUMMARY\r\n\r\nI found that the proxmox module needs process the \"netif param\". In the [proxmox docs](http://pve.proxmox.com/pve2-api-doc/) the netif param does not exist. The correct param is **net[n]**. I created these params from netif var, for example:\r\n\r\n```\r\n...\r\n\r\nvars:\r\nct_netif: \"{ 'net0':'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.1/24', 'net1':'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.2/24' }\"\r\nct_ostemplate: \"local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz\"\r\nct_vmid: 101\r\n\r\ntasks:\r\n    - proxmox:\r\n        api_user: \"{{ proxmox_api_user }}\"\r\n        api_password: \"{{ proxmox_api_password }}\"\r\n        api_host: \"{{ proxmox_api_host }}\"\r\n        node: \"{{ proxmox_node }}\"\r\n        vmid: \"{{ ct_vmid }}\"\r\n        netif: \"{{ ct_netif }}\"\r\n        ostemplate: \"{{ ct_ostemplate }}\"\r\n\r\n```\r\nResult before:\r\n```\r\n{'onboot': 0, 'force': 0, 'netif': {'net1': 'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.2/24', 'net0': 'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.1/24'}, 'ostemplate': 'local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz', 'cpuunits': 1000}\"}\r\n```\r\n```\r\n{\"changed\": false, \"failed\": true, \"msg\": \"creation of lxc VM 101 failed with exception: 400 Bad Request\"}\r\n```\r\n\r\nResult after:\r\n```\r\n{'force': 0, 'cpuunits': 1000, 'ostemplate': 'local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz', **'net0'**: 'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.1/24', 'cpulimit': 1, 'onboot': 0, 'net1': 'gw=10.10.22.254,bridge=vmbr0,name=eth0,ip=10.10.22.2/24', 'rootfs': 3}```\r\nNow the module runs as expected.\r\n```\r\n```\r\n{\"changed\": true, \"msg\": \"deployed VM 101 from template local:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz\"}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/212250695","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2064#issuecomment-212250695","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2064","id":212250695,"user":{"login":"gregdek","id":252125,"avatar_url":"https://avatars.githubusercontent.com/u/252125?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdek","html_url":"https://github.com/gregdek","followers_url":"https://api.github.com/users/gregdek/followers","following_url":"https://api.github.com/users/gregdek/following{/other_user}","gists_url":"https://api.github.com/users/gregdek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdek/subscriptions","organizations_url":"https://api.github.com/users/gregdek/orgs","repos_url":"https://api.github.com/users/gregdek/repos","events_url":"https://api.github.com/users/gregdek/events{/privacy}","received_events_url":"https://api.github.com/users/gregdek/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T04:25:06Z","updated_at":"2016-04-20T04:25:06Z","body":"Thanks @adriagalin. To the current maintainers, @UnderGreen please review according to guidelines (http://docs.ansible.com/ansible/developing_modules.html#module-checklist) and comment with text 'shipit', 'needs_revision' or 'close_me' as appropriate.\n\n[This message brought to you by your friendly Ansibull-bot.]"}}