-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azure deployment - integers being passed as string #47696
Comments
Hi @vpopescu, thank you for submitting this issue! |
Files identified in the description: If these files are inaccurate, please update the |
@vpopescu, just so you are aware we have a dedicated Working Group for azure. |
@vpopescu this is actually generic Ansible issue, not relayed to azure. so when you do this: "{{ agent_count | int}}" there is already a discussion on this..... seems it needs to be revisited.... |
@zikalino Thanks, I thought my googling returned some solutions for other modules where the "int" filter actually worked, I guess i was wrong. But this is a fundamental issue then, if you can't use integer values in ansible, since many systems validate results against a schema of some sort. What should I do with the bug, how do I make it a generic one? Doesn't help that the other discussions are all closed if they were not resolved. :( |
I think there was another, more generic discussion about this, but couldn't find it yet. |
Thanks. Wouldn't the example in the other post have the same issue when i try to set the count from an external variable, and it would convert it to a string, thereby making the REST API choke? |
actually, probably yes, I think REST API should be more forgiving when passing integer as string.... but needs to be checked. |
also it should be possible to pass JSON. |
If you don't mind, I'd like to take a look at this but am new to open source. Is there any way I can assign myself to it per chance? |
@kaelscion unfortunately it's possible to assign only members.... I can assign myself, and then help you merge if you create pr :-) |
seems like, when just using single numeric variable, say "a", "{{ a }}" will be actually a number. |
Hmm. Once I dig in a bit more I'll be able to answer this for myself I'm sure (cloning the version in the bug report right now) but just to save some time, is there templating support built in? Like Jinja or Django's template system or the like? I'm guessing an Azure deployment has web template support at some area of the stack. Thank you so much btw for answering my questions. If it gets converted to an int via the Python code, then back to a string by them template engine, that gives me a place to start at least. |
Fair enough. I work with Jinja2 templating alot in my Flask development projects so I'm pretty familiar with it. I'll take a look at the differences between web and native and how they hand int input. We'll get this tracked down. I'll be taking a look this weekend and see what I can find out 😁😁 |
@kaelscion Thanks for your contribution, Could you update the tracking result? Thanks! |
I haven't made a pull request as of yet. I'm having a bit of trouble getting things set up properly on Azure to test honestly. I'm usually an AWS and GCloud guys. I use the Jinja2 template all the time, hence my interest in this particular bug, but I cannot seem to get the environment set up correctly to test :O. I will update as soon as I have submitted changes. Apologies for delay! |
@kaelscion Thanks for your update. Once you submitted changes, I will push maintainer to review and merge. Thanks! |
kindly ping |
Unfortunately, you may want to remove me from this bug. Azure is much different than what I am used to and, while I am sure I can work within the context of the bug once all is deployed to Azure, I simply cannot seem to get a working version of Ansible up and running on the Azure platform. I apologize for wasting folk's time as I would really like to work on this, but I am just too green in Azure to get a playbook up and running, let alone to the point of reproducing the issue. I'm sure I could figure it out eventually, but I simply do not have enough time to play with it among my other commitments to do this in a timely manner. Unless there is a tutorial or something that the Ansible team uses to deploy to Azure that could be linked here, I should probably just let you guys move on. |
@kaelscion just curious, why do you need it running in Azure? You can run the playbook on your local computer and manage Azure that way. |
My word. Well, that's "bug vision" for ya.. I got so consumed with the fact that the issue took place in management of Azure that I absolutely missed the fact that I could run it locally. Wow. Okay I'll get back at it thank you so much for letting me know! |
@zikalino how about the issue going ahead? Could you help take a look? Thanks! |
kindly ping |
3 similar comments
kindly ping |
@zikalino Do you have any update about this issue? |
resolved_by_pr #32738 You can simply set the environment variable or modify the reference: |
SUMMARY
I am trying to deploy an cluster via azure_rm_deployment and an inline template. I am getting an error when trying to send an integer property, it appears it's being serialized as a string.
The value in question is count, below. I have a string value of "1" and I'm trying to send it as an integer:
I found this filter in another bug report, and it appered that it would fix my needs. However my JSON still comes out as a string:
If I however replace the line with:
Then It gets generated correctly. What am I doing wrong?
ISSUE TYPE
COMPONENT NAME
azure_rm_deployment
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu / WSL
STEPS TO REPRODUCE
...
...
EXPECTED RESULTS
The playbook should execute.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: