# Provision OpenNebula VMs using ansible

**URL:** https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896
**Category:** Product Support
**Created:** [September 6, 2017, 7:24pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896 "2017-09-06T19:24:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bnold](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bnold](https://forum.opennebula.io/u/bnold)
#### Post date: [September 6, 2017, 7:24pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/1 "2017-09-06T19:24:40Z")

</div>

Please, describe the problem here and provide additional information below (if applicable) …

Use ansible to provision vms in Opennebula

**Versions of the related components and OS (frontend, hypervisors, VMs):**  
The vms will be Centos 7.2

Any suggestions?

---

<div class="post-metadata">

### Author: ![VURoland](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vuroland/32/7682_2.png) [@VURoland](https://forum.opennebula.io/u/VURoland)
#### Post date: [September 7, 2017, 6:17pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/2 "2017-09-07T18:17:31Z")

</div>

Have you already seen this to get started?

(EDIT: slides!) [https://www.slideshare.net/opennebula/opennebulaconf2017us-configuration-management-with-opennebula-and-ansible-by-jaime-melis-opennebula](https://www.slideshare.net/opennebula/opennebulaconf2017us-configuration-management-with-opennebula-and-ansible-by-jaime-melis-opennebula)

basically, you’re asking “how to provision servers with ansible” - when they are deployed, opennebula is out of the equation.  
Opennebula just deploys them, with a ansible user and ssh key if you want (defined in context), and the provisioning part is done with the playbooks you define using ansible. If you get opennebula to deploy a VM with the ansible user and key, all you need to do is apply your playbooks

hope this helps!

---

<div class="post-metadata">

### Author: ![marcindulak](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@marcindulak](https://forum.opennebula.io/u/marcindulak)
#### Post date: [September 7, 2017, 8:15pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/3 "2017-09-07T20:15:40Z")

</div>

“If you get opennebula to deploy a VM with the ansible user and key, all you need to do is apply your playbooks” - such approach is limited, compared to existing ansible modules for **actual** deployments of VMs on AWS [http://docs.ansible.com/ansible/latest/guide\_aws.html](http://docs.ansible.com/ansible/latest/guide_aws.html) and saltstack opennebula module [https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.opennebula.html](https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.opennebula.html) (mentioned in [https://forum.opennebula.io/t/automate-vm-creation-with-configurations-with-a-click-of-a-button/](https://forum.opennebula.io/t/automate-vm-creation-with-configurations-with-a-click-of-a-button/))

When recording talks in the future please make sure the slides are readable.

---

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [September 1, 2018, 10:48pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/4 "2018-09-01T22:48:49Z")

</div>

Hi,  
is anyone used ansible to provision vm’s in opennebula?  
Ansible 2.6 is having opennebula module, but I am not sure how to use it.  
where to provide opennebula details like, username, password, url etc… please help.

---

<div class="post-metadata">

### Author: ![feldsam](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/feldsam/32/4441_2.png) [@feldsam](https://forum.opennebula.io/u/feldsam)
#### Post date: [September 3, 2018, 1:03pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/5 "2018-09-03T13:03:03Z")

</div>

Just use google and look at documentation.

[https://docs.ansible.com/ansible/2.6/modules/one\_vm\_module.html](https://docs.ansible.com/ansible/2.6/modules/one_vm_module.html)

---

<div class="post-metadata">

### Author: ![Amit\_Kumar](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amit_kumar/32/7867_2.png) [@Amit\_Kumar](https://forum.opennebula.io/u/Amit_Kumar)
#### Post date: [September 14, 2018, 1:16pm UTC](https://forum.opennebula.io/t/provision-opennebula-vms-using-ansible/4896/7 "2018-09-14T13:16:56Z")

</div>

Thanks… I am able to do it now…

requirement “python-oca” is supposed to be installed on opennebula host
