Good morning all,
I'm very new to Ansible, but am looking to use it to baremetal and configure our company's infrastructure products on either Azure or on client sites with VMware or Hyper-V. As the company is pushing Azure at the moment, I'm focusing on learning with that in the forefront of my mind. Whilst I'm able to fairly easily configure linux & windows machine running within our network, I am struggling with building environments within Azure, and somewhat falling at the first hurdle. I followed the bits in the guide
https://docs.ansible.com/ansible/guide_azure.html and am using a service pricipal to connect to Azure. I installed the necessary modules via pip as follows:
sudo pip install "azure==2.0.0rc6"
sudo pip install msrestazure
I am trying to get the very very basic playbook as follows to execute but barfs with the below syntax error within the module:
---
- hosts: localhost
connection: local
#strategy: debug
gather_facts: no
tasks:
#- name: Create storage account
#azure_rm_storageaccount:
#resource_group: test
#name: testaccount001
#account_type: Standard_LRS
- name: build a machine
azure_rm_deployment:
resource_group_name: test
parameters:
vmSize: Standard_D1
vmName: test001
vmStorageAccountContainerName: private
vmStorageAccountName: storagetier1
adminUsername: user
adminPassword: pass
imagePublisher: OpenLogic
imageOffer: CentOS
sku: '7.1'
version: latest
Non-sensical error I am seeing:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SyntaxError: invalid syntax
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_oBtFhV/ansible_module_azure_rm_deployment.py\", line 376, in <module>\n from ansible.module_utils.azure_rm_common import *\n File \"/tmp/ansible_oBtFhV/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py\", line 77, in <module>\n File \"/usr/lib/python2.6/site-packages/msrest/__init__.py\", line 27, in <module>\n from .configuration import Configuration\n File \"/usr/lib/python2.6/site-packages/msrest/configuration.py\", line 39, in <module>\n from .pipeline import (\n File \"/usr/lib/python2.6/site-packages/msrest/pipeline.py\", line 207\n for p in [p.partition('=') for p in query.split('&')]\n ^\nSyntaxError: invalid syntax\n", "module_stdout": "", "msg": "MODULE FAILURE"}
As I say, I am a n00b so please be gentle :)