#language en = Salt-cloud Azure deployement = * Links [[SaltStack]] , [[Azure]] * https://azure.microsoft.com/en-us/resources/samples/resource-manager-python-template-deployment/ * 2018 - Main SaltStack dependancy for AzureARM (v2) api {{{ pip install 'azure-cli>=2.0.12' sudo apt-get install build-essential libssl-dev libffi-dev python-dev }}} * 2017 - v36 Get updated python storage driver for azure. {{{ # pip install azure-storage }}} * Note, before update use to get the following error {{{ if LooseVersion(azure.storage.__version__) < LooseVersion('0.20.0'): }}} {{{ # time salt-cloud -P -m /etc/salt/cloud.maps.d/AEA01/azure_shamera-INF01AEA01-INF.conf [ERROR ] Failed to import fileserver azurefs, this is due most likely to a syntax error: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1461, in _load_module mod = imp.load_module(mod_namespace, fn_, fpath, desc) File "/usr/lib/python2.7/dist-packages/salt/fileserver/azurefs.py", line 69, in print( azure.storage.__version__ ) AttributeError: 'module' object has no attribute '__version__' }}} * salt-cloud keeps asking for an encryption key, it is explained [[https://lnx.azurewebsites.net/please-enter-password-for-encrypted-keyring-when-running-python-script-on-ubuntu/|here]] and fixed with ... * Edit ~/.local/share/python_keyring/keyringrc.cfg: {{{ [backend] default-keyring=keyrings.alt.file.PlaintextKeyring }}} == pudb python debug salt-cloud == * run python pudb debug with {{{ # pudb /usr/bin/salt-cloud -l info -m /etc/salt/cloud.maps.d/ENV/azure_TEST.conf }}} * 201807 breakpoint at line 2235 file salt/cloud/__init__.py "# Not deploying in parallel" * 201807 breakpoint at line 1284 file salt/cloud/__init__.py "output = self.clouds[func](vm_)" Call azurearm to create vm == Setup dev salt-stack azure branch == * Checkout salt-stack repo * virtualenv . in git/salt * source bin/activate * install salt into the virtual env from the git repo with, pip install -e . * pip install azure-cli * test salt-cloud -F * Failure {{{ [WARNING ] Keyring cache token has failed: No recommended backend was available. Install the keyrings.alt package if you want to use the non-recommended backends. See README.rst for details. }}} * Fix: ...