Skip to content
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_rm inventory should add "ansible_connection: winrm" in host_vars for windows hosts #34689

Closed
themr0c opened this issue Jan 10, 2018 · 3 comments
Labels
affects_2.4 This issue/PR affects Ansible v2.4 azure bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category support:community This issue/PR relates to code supported by the Ansible community.

Comments

@themr0c
Copy link
Contributor

themr0c commented Jan 10, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm inventory

ANSIBLE VERSION
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/fft/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/fft/.fftpython2/local/lib/python2.7/site-packages/ansible
  executable location = /home/fft/.fftpython2/bin/ansible
  python version = 2.7.14rc1 (default, Sep  5 2017, 18:16:23) [GCC 7.2.0]

CONFIGURATION

N/A

OS / ENVIRONMENT

Target hosts: Windows

SUMMARY

azure_rm inventory should add "ansible_connection: winrm" in host_vars for windows hosts

STEPS TO REPRODUCE

Run azure_rm (Microsoft Azure Resource Manager Inventory in AWX) to inventory a Windows host.

Look at the variables in the output.

EXPECTED RESULTS

A windows host should be reached with winrm.

I expect this variable to be present in the host variables:

ansible_connection: winrm
ACTUAL RESULTS

The variable ansible_connection: winrm is missing.

Ansible will use the standard SSH connexion mechanism, which will obviously fail.

We get information about the OS from Azure, though:

os_disk: 
  operating_system_type: Windows

So when this information is present, azure_rm inventory should also set the variable ansible_connection: winrm.

@ansibot
Copy link
Contributor

ansibot commented Jan 10, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jan 10, 2018

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 azure bug_report c:inventory/contrib_script cloud inventory Inventory category needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jan 10, 2018
@themr0c
Copy link
Contributor Author

themr0c commented Jan 10, 2018

Here the complete host_vars of the host that I receive (and is displayed in AWX):

powerstate: running
resource_group: test-rg
tags:
  displayName: test-vm
image:
  sku: 2012-R2-Datacenter
  publisher: MicrosoftWindowsServer
  version: latest
  offer: WindowsServer
public_ip_alloc_method: null
provisioning_state: Succeeded
public_ip: null
public_ip_name: null
private_ip: X.X.X.X
computer_name: test-vm
public_ip_id: null
plan: null
windows_timezone: null
id: >-
  /subscriptions/XXXX/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/test-vm
fqdn: null
name: test-vm
windows_rm: null
os_disk:
  operating_system_type: Windows
  name: test-vmosdisk
ansible_host: null
virtual_machine_size: Standard_F2
network_interface_id: >-
  /subscriptions/XXXX/resourceGroups/test-rg/providers/Microsoft.Network/networkInterfaces/test-vm-nic
private_ip_alloc_method: Static
location: northeurope
windows_auto_updates_enabled: true
mac_address: XXXX
type: Microsoft.Compute/virtualMachines
network_interface: test-vm-nic

@gundalow gundalow removed the needs_triage Needs a first human triage before being processed. label Jan 10, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 azure bug This issue/PR relates to a bug. c:inventory/contrib_script cloud inventory Inventory category support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

3 participants