-
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
add group_by_os_family in azure dynamic inventory #40702
Conversation
The test
The test
The test
The test
The test
The test
The test
|
Where is the doc of azure_rm inventory ? I need to update it to add what provide my few additions to initial script. |
contrib/inventory/azure_rm.py
Outdated
@@ -808,10 +810,16 @@ def _add_host(self, vars): | |||
|
|||
host_name = self._to_safe(vars['name']) | |||
resource_group = self._to_safe(vars['resource_group']) | |||
operating_system_type = self._to_safe(vars['os_disk']['operating_system_type']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change looks good. pls update doc as @yuwzho mentioned.
The doc is updated. I think there's maybe an little enhancement, for me it's better to ensure the operating_system_type is in lower case, no? I'm not a python guru but I think we can change in 2 places: host_vars['os_disk'] = dict(
name=machine.storage_profile.os_disk.name,
operating_system_type=machine.storage_profile.os_disk.os_type.value
) by host_vars['os_disk'] = dict(
name=machine.storage_profile.os_disk.name,
operating_system_type=machine.storage_profile.os_disk.os_type.value.tolower()
) Or in the group : def _add_host(self, vars):
host_name = self._to_safe(vars['name'])
resource_group = self._to_safe(vars['resource_group'])
operating_system_type = self._to_safe(vars['os_disk']['operating_system_type'])
security_group = None by def _add_host(self, vars):
host_name = self._to_safe(vars['name'])
resource_group = self._to_safe(vars['resource_group'])
operating_system_type = self._to_safe(vars['os_disk']['operating_system_type'].tolower())
security_group = None I don't know which is the best/correct way to handle that. Azure send the data with Windows or Linux, and so in group_vars, we need to create Windows.yml or Linux.yml instead of lower case. |
@EtienneDeneuve each way is ok for me. I personal prefer to lower case in _add_host. |
I think it’s the cleaner way too. I’ll change it today
Obtenez Outlook pour iOS<https://aka.ms/o0ukef>
…________________________________
From: Yunge Zhu <notifications@github.com>
Sent: Wednesday, June 13, 2018 7:36:28 AM
To: ansible/ansible
Cc: Etienne Deneuve; Mention
Subject: Re: [ansible/ansible] add group_by_os_family in azure dynamic inventory (#40702)
@EtienneDeneuve<https://github.com/EtienneDeneuve> each way is ok for me. I personal prefer to lower case in _add_host.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#40702 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA9qkadAzLVigLcBHlLYhyFAfSuaZ8iQks5t8KTcgaJpZM4UNmdE>.
|
contrib/inventory/azure_rm.py
Outdated
@@ -808,10 +810,16 @@ def _add_host(self, vars): | |||
|
|||
host_name = self._to_safe(vars['name']) | |||
resource_group = self._to_safe(vars['resource_group']) | |||
operating_system_type = self._to_safe(vars['os_disk']['operating_system_type'].tolower()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower()
@jborean93 Hi Jordan, this PR adds a new option |
@@ -402,6 +404,12 @@ Here are some examples using the inventory script: | |||
# Execute /bin/uname on all instances in the Testing resource group | |||
$ ansible -i azure_rm.py Testing -m shell -a "/bin/uname -a" | |||
|
|||
# Execute win_ping on all Windows instances | |||
$ ansible -i azure_rm.py Windows -m win_ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update sample to use lower case os name
@EtienneDeneuve will you update the PR per comments? I can help after you give me repo permission. |
Oh too bad I didn’t saw your comment until yet! I’ll fix as mentioned today! |
update to match lower case
Normally fixed the 'tolower()' by 'lower()' and change in doc |
shipit |
$ ansible -i azure_rm.py windows -m win_ping | ||
|
||
# Execute win_ping on all Windows instances | ||
$ ansible -i azure_rm.py winux -m ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: linux
* devel: (30 commits) Prevent data being truncated over persistent connection socket (#43885) Fix eos_command integration test failures (#43922) Update iosxr cliconf plugin (#43837) win_domain modules: ensure Netlogon service is still running after promotion (#43703) openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869) Fix typo Fix spelling of ansbile to ansible (#43898) added platform guides for NOS and VOSS (#43854) Fix download URL for yum integration test. New module for managing EMC VNX Block storage (#42945) Docker integration tests: factorize setup (#42306) VMware: datastore selection (#35812) Remove unnecessary features from cli_command (#43829) [doc] import_role: mention version from which behavior changed and fix some typos (#43843) Add source interface and use-vrf features (#43418) Fix unreferenced msg from vmware_host (#43872) set supports_generate_diff to False vyos (#43873) add group_by_os_family in azure dynamic inventory (#40702) ansible-test: Create public key creating Windows targets (#43760) azure_rm_loadbalancer_facts.py: list() takes at least 2 arguments fix (#29046) (#29050) ...
SUMMARY
Add a way to group by os family.
I need that for set correct winrm/ssh connection in group_vars
ISSUE TYPE
COMPONENT NAME
azure_rm.py
azure_rm.ini
ANSIBLE VERSION
ADDITIONAL INFORMATION