salt icon indicating copy to clipboard operation
salt copied to clipboard

is there any saltstack module for creating azure resource tags.

Open Set4now opened this issue 9 years ago • 8 comments

For aws there are multiple salt modules but i dont see any such modules for azure resouce management. So we are developing customized modules to handle this. import azurerm from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.sql import SqlManagementClient from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.resource.resources.models import DeploymentMode from azure.mgmt.compute import ComputeManagementClient import json import salt def create_tags(tenant_id,application_id,application_secret,subscription_id,GROUP_NAME,VM_NAME,tags): credentials = ServicePrincipalCredentials(client_id=application_id,secret=application_secret,tenant=tenant_id) compute_client = ComputeManagementClient(credentials, subscription_id) result=compute_client.virtual_machines.create_or_update(GROUP_NAME,VM_NAME,tags) result.wait() return result

this is creating tags from unfortunately overriding the existing tags.

any help or suggestions will be appreciated.

Set4now avatar Jun 20 '17 12:06 Set4now

We have a salt-cloud azure arm driver documented here Is that what you are looking for?

Ch3LL avatar Jun 20 '17 20:06 Ch3LL

No....Am actually looking for cloud runners for azure to manage azure resource components.Like you gave boto for ec2...

On Wednesday, 21 June 2017 1:50 AM, Megan Wilhite <[email protected]> wrote:

We have a salt-cloud azure arm driver documented here Is that what you are looking for?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Set4now avatar Jun 21 '17 06:06 Set4now

I don't believe this exists but @gtmanfred might be able to clarify whether i'm wrong or not

Ch3LL avatar Jun 22 '17 20:06 Ch3LL

If there is the ability in https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.azurearm.html to do that, then you can use the cloud.action or cloud.function runner to do it.

If not, then the ability would need to be added to the cloud driver.

We have a desire to add some more stuff like boto in a future iteration on salt cloud, but right now only ec2/boto is implemented.

This was discussed in the first meeting of the SaltCloud working group https://groups.google.com/forum/#!topic/salt-cloud/8phr9hQIqvo

gtmanfred avatar Jun 26 '17 16:06 gtmanfred

Hi... I hace tried the below following but getting errors. Note:- azure-dev is the provider

#salt-cloud -f avail_locations azure-dev [ERROR ] There was an error running the function: 'WebSiteManagementClient' object has no attribute 'global_model'

#root@DNDSaltMaster:/srv/salt/_modules# salt-cloud -f list_networks azure-dev [ERROR ] There was an error running the function: 'NoneType' object is not iterable salt-cloud -f list_storage_accounts azure-dev [ERROR ] There was an error running the function: 'StorageAccount' object is not iterable

Not sure whats wrong with this...i can create ec2 instances with these provider and profile files.

root@DNDSaltMaster:/srv/salt/_modules# salt --versions-report Salt Version: Salt: 2016.11.5

Dependency Versions: cffi: 1.10.0 cherrypy: 3.5.0 dateutil: 2.6.0 docker-py: Not Installed gitdb: 0.6.4 gitpython: 1.0.1 ioflo: Not Installed Jinja2: 2.8 libgit2: Not Installed libnacl: Not Installed M2Crypto: Not Installed Mako: 1.0.3 msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: 2.17 pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 2.7.12 (default, Nov 19 2016, 06:48:10) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 15.2.0 RAET: Not Installed smmap: 0.9.0 timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.1.4

System Versions: dist: Ubuntu 16.04 xenial machine: x86_64 release: 4.4.0-78-generic system: Linux

azure==2.0.0 azure-batch==3.0.0 azure-common==1.1.6 azure-datalake-store==0.0.9 azure-graphrbac==0.30.0 azure-keyvault==0.3.3 azure-mgmt==1.0.0 azure-mgmt-authorization==0.30.0 azure-mgmt-batch==4.0.0 azure-mgmt-cdn==0.30.3 azure-mgmt-cognitiveservices==1.0.0 azure-mgmt-compute==1.0.0 azure-mgmt-containerregistry==0.2.1 azure-mgmt-datalake-analytics==0.1.4 azure-mgmt-datalake-nspkg==2.0.0 azure-mgmt-datalake-store==0.1.4 azure-mgmt-devtestlabs==2.0.0 azure-mgmt-dns==1.0.1 azure-mgmt-documentdb==0.1.3 azure-mgmt-iothub==0.2.2 azure-mgmt-keyvault==0.31.0 azure-mgmt-logic==2.1.0 azure-mgmt-monitor==0.2.1 azure-mgmt-network==1.0.0 azure-mgmt-nspkg==2.0.0 azure-mgmt-rdbms==0.1.0 azure-mgmt-redis==4.1.0 azure-mgmt-resource==1.1.0 azure-mgmt-scheduler==1.1.2 azure-mgmt-sql==0.5.1 azure-mgmt-storage==1.0.0 azure-mgmt-trafficmanager==0.30.0 azure-mgmt-web==0.32.0 azure-nspkg==2.0.0 azure-servicebus==0.21.1 azure-servicefabric==5.6.130 azure-servicemanagement-legacy==0.20.6 azure-storage==0.34.2

Set4now avatar Jun 28 '17 10:06 Set4now

@techhat were you aware of these issues in the azurearm driver?

Thanks, Daniel

gtmanfred avatar Jun 28 '17 15:06 gtmanfred

Hi, if the official salt azure arm driver is not working, Can you suggest me for an alternatives.

Set4now avatar Jun 30 '17 06:06 Set4now

@techhat Any update on azure arm drivers!!!

Set4now avatar Jul 31 '17 13:07 Set4now