# Ansible Azure create VM with Java installed

**URL:** <https://forum.ansible.com/t/ansible-azure-create-vm-with-java-installed/27168>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [April 2, 2018, 6:18am UTC](https://forum.ansible.com/t/ansible-azure-create-vm-with-java-installed/27168 "2018-04-02T06:18:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bubul\_Medhi](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@Bubul\_Medhi](https://forum.ansible.com/u/Bubul_Medhi)\
**Post date:** [April 2, 2018, 6:18am UTC](https://forum.ansible.com/t/ansible-azure-create-vm-with-java-installed/27168/1 "2018-04-02T06:18:56Z")

</div>

Hi,

I am new to Ansible. I have two separate playbooks to create VM and Install Java on it.  
I am trying to create a single playbook which creates an VM with latest Java installed on it. Please help.

Regards,  
Uday

---

<div class="post-metadata">

**Author:** ![Bubul\_Medhi](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@Bubul\_Medhi](https://forum.ansible.com/u/Bubul_Medhi)\
**Post date:** [April 2, 2018, 6:26pm UTC](https://forum.ansible.com/t/ansible-azure-create-vm-with-java-installed/27168/2 "2018-04-02T18:26:51Z")

</div>

No reply ☹

---

<div class="post-metadata">

**Author:** ![Oleg\_Gerasymchuk](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@Oleg\_Gerasymchuk](https://forum.ansible.com/u/Oleg_Gerasymchuk)\
**Post date:** [April 2, 2018, 7:28pm UTC](https://forum.ansible.com/t/ansible-azure-create-vm-with-java-installed/27168/3 "2018-04-02T19:28:28Z")

</div>

Hi Uday,

It might be good approach keep your playbooks separately, organized in roles.

And both will be called one-by-one by high-level simple playbook. So, something like this, when talking about structure of your project:

create\_vm\_with\_java.yml

roles/

create\_vm/

tasks/

handlers/

files/

vars/

defaults/

install\_java/

tasks/

defaults/

meta/

```auto
and your top-level playbook create_vm_with_java.yml will have next content:

```
