# Azure module

**URL:** <https://forum.ansible.com/t/azure-module/15378>\
**Category:** Ansible Developer\
**Tags:** azure\
**Created:** [May 30, 2014, 1:59pm UTC](https://forum.ansible.com/t/azure-module/15378 "2014-05-30T13:59:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [May 30, 2014, 1:59pm UTC](https://forum.ansible.com/t/azure-module/15378/1 "2014-05-30T13:59:34Z")

</div>

Moved from ansible-project:

It looks like we’ve received another contribution for this: [https://github.com/ansible/ansible/pull/7593](https://github.com/ansible/ansible/pull/7593)

This has not yet been merged in, but you may want to look at it and see if it meets your needs. If you’ve gotten pretty far in developing your version, you may also want to compare them to see if yours covers any areas that this one does not, and either move that functionality into the one above if/when it is merged or submit a competing version.

As Michael requested, any further discussion on this topic should now be moved to ansible-devel.

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 30, 2014, 3:14pm UTC](https://forum.ansible.com/t/azure-module/15378/2 "2014-05-30T15:14:30Z")

</div>

Yeah please comment on the above PR if you have any thoughts - if there are no major problems, accepting this and using it as a starting point may be wise.

We have some pending interest from a few other parties so may refrain from merging just for a bit to see if they also have comments, but this should be pretty easy to get in I’d think.

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [May 31, 2014, 1:10pm UTC](https://forum.ansible.com/t/azure-module/15378/3 "2014-05-31T13:10:04Z")

</div>

Hi,

I have not added a PR because there are still some open issues (like correct docu, etc) but here are the files I have done so far:

[https://github.com/matlockx/ansible/blob/devel/library/cloud/azure](https://github.com/matlockx/ansible/blob/devel/library/cloud/azure)  
[https://github.com/matlockx/ansible/blob/devel/lib/ansible/module\_utils/azure.py](https://github.com/matlockx/ansible/blob/devel/lib/ansible/module_utils/azure.py)  
[https://github.com/matlockx/ansible/blob/devel/plugins/inventory/windows\_azure.ini](https://github.com/matlockx/ansible/blob/devel/plugins/inventory/windows_azure.ini)  
[https://github.com/matlockx/ansible/blob/devel/plugins/inventory/windows\_azure.py](https://github.com/matlockx/ansible/blob/devel/plugins/inventory/windows_azure.py)

Currently I have also a somehow strange error:

Sometimes the scripts complain that they cannot find the module azure (the sdk one which is installed via pip). It’s not really clear to me why that happens. I think it started when I created the inventory plugin. I had a long time this script complaining about the missing module. Out of the sudden it then disappeared but now the module itself complains that.

Anyone an idea?

Thx

Martin

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 6, 2014, 11:58am UTC](https://forum.ansible.com/t/azure-module/15378/4 "2014-06-06T11:58:01Z")

</div>

I don’t.

Aside from a very clever gremlin process that is occasionally uninstalling and reinstalling the module 🙂

That is probably not the case!

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [June 6, 2014, 3:24pm UTC](https://forum.ansible.com/t/azure-module/15378/5 "2014-06-06T15:24:23Z")

</div>

i think i messed up my system with pip… i cleaned up everything and now it’s working again 🙂  
by the way, is there any information about merging [https://github.com/ansible/ansible/pull/7593](https://github.com/ansible/ansible/pull/7593) and when it will happen? I got the guys from the azure-sdk to merge a pull request for temporary redirects, so that should also be no issue in the future anymore with the module: [https://github.com/Azure/azure-sdk-for-python/pull/157](https://github.com/Azure/azure-sdk-for-python/pull/157)

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [June 6, 2014, 4:02pm UTC](https://forum.ansible.com/t/azure-module/15378/6 "2014-06-06T16:02:07Z")

</div>

I’m actually signing up for an Azure account now to test it, so I hope to merge it in today.

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [June 15, 2014, 1:36pm UTC](https://forum.ansible.com/t/azure-module/15378/7 "2014-06-15T13:36:15Z")

</div>

After the merge of the last pr I wanted to ask how we continue? I would like to see meta data of hosts in the inventory and the feature to create multiple roles in one deployment. What do you think?  
I implemented the roles per deployment already but there is of course some work to do to merge it into the current implementation.  
Our shall we wait for the next release and put it then into the branch?  
There is also a question open in another thread concerning the data structures. Can I use a shared data model of azure objects which can be used in the module and also in the inventory file and if so where to put it in the directory structure?

Thanks,  
Martin

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 16, 2014, 1:24am UTC](https://forum.ansible.com/t/azure-module/15378/8 "2014-06-16T01:24:56Z")

</div>

I’m confused what the azure module has to do with roles.

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [June 16, 2014, 5:26am UTC](https://forum.ansible.com/t/azure-module/15378/9 "2014-06-16T05:26:22Z")

</div>

Ah, sorry. VMs are in azure speak 'roles', one VM == one role.  
The concept of azure wants you to create multiple VMs in one deployment under one cloud service. All VMs, or roles, can communicate over network with each other without a virtual network and you set up a load balance for them.  
So if you want to deploy several instances of the same webapp I think it makes sense to create these 'roles' in one deployment. The azure API has therefore the commands add-role, delete-role, start/stop-role, etc.

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [July 16, 2014, 3:01pm UTC](https://forum.ansible.com/t/azure-module/15378/10 "2014-07-16T15:01:47Z")

</div>

> Hi,

regarding pull request 7966: [https://github.com/ansible/ansible/pull/7966](https://github.com/ansible/ansible/pull/7966) I just wanted to ask whether there is something to do from my side to help get it merged?

Best

Martin

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 17, 2014, 9:50pm UTC](https://forum.ansible.com/t/azure-module/15378/11 "2014-07-17T21:50:43Z")

</div>

Should be good… you are in queue, sir!

Note we have a very big queue and are tackling things in priority order, mostly bug reports affecting the most users first, etc.

Sometimes some very very easy things get merged when we see them.

We are going to be ramping up Azure testing very very soon and will have an opportunity to dig in more deeply.

---

<div class="post-metadata">

**Author:** ![Martin\_Johren](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Johren](https://forum.ansible.com/u/Martin_Johren)\
**Post date:** [July 19, 2014, 6:08am UTC](https://forum.ansible.com/t/azure-module/15378/12 "2014-07-19T06:08:32Z")

</div>

Alright. Thanks 🙂

Best

Martin
