Comments (20)
@Fred-sun I am going to close this issue because clearly the problem relates to my setup. But if you have any further suggestions please let me know.
When I deleted the 'network' folder as you instructed and then ran the azure-mgmt-network
install it did not install it to the location under my home directory. It installed it to /usr/local/lib/python3.7
, and the playbook failed because it was still looking for the azure-mgmt-network
under my home directory.
Then I removed ~/Library/Python altogether and the problem went away.
Clearly this applies to me:
:(
Thanks again for all your time and help with this.
from azure.
@mark100net I'm glad you are interested in ansilbe-collections. I tested your playbook and it was successful. The test results are as follows:
TASK [create resource group] ****************************************************************************************************************************************************ok: [localhost]
TASK [Create virtual network] ***************************************************************************************************************************************************changed: [localhost]
TASK [debug] ********************************************************************************************************************************************************************ok: [localhost] => {
"output": {
"changed": true,
"check_mode": false,
"failed": false,
"state": {
"address_prefixes": [
"10.0.0.0/16"
],
"etag": "W/\"24d39e33-4824-43b4-b7a0-d71c22fe7714\"",
"id": "/subscriptions/xxxxxxxxxxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/virtualNetworks/fredvnet003",
"location": "eastus",
"name": "fredvnet003",
"provisioning_state": "Succeeded",
"tags": null,
"type": "Microsoft.Network/virtualNetworks"
}
}
}
PLAY RECAP **********************************************************************************************************************************************************************localhost : ok=4 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
from azure.
@mark100net I suspect that your ansible and ansible-collection refer to azure-mgmt-network differently. Can you help confirm this? Thank you very much!
ansible-collection: /usr/local/lib/python3.7/site-packages/azure/mgmt/network/network_management_client.py
ansible: ?
from azure.
@Fred-sun Thanks for trying to reproduce my issue.
I am not completely sure what you are asking. I do have network_management_client.py
in the location you specified.
My azcollection
is in ~/.ansible/collections/ansible_collections/azure/azcollection
My ansible --version
output is (sorry, I should have put that in the original issue):
config file = None
configured module search path = ['/Users/mark/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.7.7 (default, Apr 25 2020, 11:17:28) [Clang 11.0.3 (clang-1103.0.32.29)]
If that does not answer your question please let me know what I need to do to answer your question.
Thanks again.
from azure.
@mark100net Can you do such a verification, edit "/usr/local/lib/python3.7/site-packages/ansible/module_utils/azure_rm_common.py". Then test with default tasks and share the fail log to me! Thank you very much!
@property
def network_client(self):
self.log('Getting network client')
if not self._network_client:
self._network_client = self.get_mgmt_svc_client(NetworkManagementClient,
base_url=self._cloud_environment.endpoints.resource_manager,
api_version='2019-07-01')
return self._network_client
@property
def network_models(self):
self.log("Getting network models...")
return NetworkManagementClient.models("2018-09-01")
from azure.
Hello @Fred-sun , thanks for getting back to me.
I was not sure what you meant by "default tasks". But I made the edits you suggested and ran the playbook with the tasks above and got this fail log:
from azure.
@mark100net Sorry for misunderstand to you. default tasks from the cloud/ansible module. Thank you very much!
from azure.
@Fred-sun I did (also) run the task as the default (i.e. as azure_rm_virtualnetwork
without the collection qualifier). I do not get a failure that way (with or without the edits you gave me). In case it helps, here is the output when I run it with the default with the edits:
from azure.
@mark100net Thank you very much for your feedback. First of all, you should definitely report an error after changing the API version, because the network API does not have these two versions. So your two task executions use different APIs. Second , that I have encountered such a similar problem, ansible and ansible-collection use azure-mgmt-network in different locations. Could you help remove ansible and ansible-collection and reinstall to retry? Thank you very much!
from azure.
@Fred-sun I'm sorry, I realized the file you told me to modify was not properly saved and I was running against the original. I made the edits again and actually am getting a failure log (using the default tasks), attached below, so I hope this helps:
Thanks again.
from azure.
@mark100net Thanks for your feedback! I see!
from azure.
@Fred-sun Do you have any other suggestions then?
from azure.
@Fred-sun Do you have any other suggestions then?
As you can see from your log, ansible and ansible-collections use the same network_management_client.py, the two test results should be the same, and you should not go wrong here. I am still thinking about how to clarify, thank you!
from azure.
@mark100net Please delete β/usr/local/lib/python3.7/site-packages/azure/mgmt/network/β, reinstall azure-mgmt-network and try again, thank you!
sudo pip3 install azure-mgmt-network -I
from azure.
@Fred-sun Thanks for the suggestion. I was able to get past the original error after doing your suggestion, but I got another error later on in my playbook when creating a virtual network. I will get you the details on that at a later date.
In the meantime, did you want me to do that with or without the edits to the azure_rm_common.py
file you gave me before? I get errors either way but the error is different depending on which one.
Thanks again.
from azure.
without the edits to the
azure_rm_common.py
@mark100net Without the edits to the azure_rm_common.py, Thank you very much!
from azure.
@Fred-sun After deleting the network
directory and reinstalling azure-mgmt-network
and running with the original azure_rm_common.py
as you suggested I am still getting the same error as originally reported with the azure.azcollection.azure_rm_vurtualnetwork
task. Output below:
Thanks again.
from azure.
@mark100net Please help provide "pip3 list |grep azure-mgmt-network" information and send me these two files. Thank you!
/Users/mark/Library/Python/3.7/lib/python/site-packages/azure/mgmt/network/network_management_client.py
/Users/mark/Library/Python/3.7/lib/python/site-packages/azure/mgmt/network/_network_management_client.py
from azure.
@Fred-sun here you go:
> pip3 list | grep azure-mgmt-network
azure-mgmt-network 2.3.0
I do not have a _network_management_client.py
in that directory. I have network_management_client.pay
included below (with .txt extension added to I could upload it here):
network_management_client.py.txt
Thanks
from azure.
@mark100net You are using an old version of azure-mgmt-network, please delete β/Users/mark/Library/Python/3.7/lib/python/site-packages/azure/mgmt/networkβ folder and reinstall azure-mgmt-network (sudo pip3 install azure-mgmt-network==10.1.0 -I). Thank you!
from azure.
Related Issues (20)
- Add support to Azure StackHCI vms in the inventory plugin
- Unable to install collection via ansible-galaxy command HOT 5
- [azure_rm_openshiftmanagedcluster] properties.clusterProfile.resourceGroupId set to null, produces error HOT 1
- [azure_rm_openshiftmanagedclusterkubeconfig_info] fails -
- Querying for image-versions fails on empty set. HOT 1
- restorable_dropped_database_id isn't a valid parameter for the azure_rm_sqldatabase module, but it is in the Examples. HOT 3
- Bind the DataProtection API for Azure Backups
- [azure_rm_storageblob] Doc should mention that public_access parameter should not be set for private access. HOT 3
- [azure_rm_common/azure_rm_virtualnetwork] CIDR_PATTERN fails on IPv6 Addresses
- azure_rm_postgresqlflexibleserver - Add Supported PostgreSQL Major Versions 14, 15 & 16
- `azure_rm_virtualmachinescaleset` Module not Updating VMSS tags HOT 3
- [azure_rm_publicipaddress] Add support for setting reverse_fqdn on public IPv4 addresses HOT 1
- Support for Data Collecion Rules / Data Collection Rule Associations HOT 1
- snapshot_info module HOT 1
- azure_rm_virtualmachineextension/azure_rm_virtualmachineextension_info support auto upgrade
- azure_rm_galleryimageversion_info throwing error when image definition does not exist or when image definition does not have image versions HOT 9
- azure_rm_manageddisk trying to modify creation_data when it should not HOT 1
- azure_rm_virtualmachine using "latest" as image version does not select actual latest version HOT 3
- azure_rm_virtualmachine_info - need Object ID - Type SystemAssigned HOT 2
- Virtual Network -- show usage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure.