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

Add computer_name to the list of host variables for azure_rm plugin #279

Closed
PavelPikat opened this issue Oct 1, 2020 · 1 comment · Fixed by #312
Closed

Add computer_name to the list of host variables for azure_rm plugin #279

PavelPikat opened this issue Oct 1, 2020 · 1 comment · Fixed by #312

Comments

@PavelPikat
Copy link

SUMMARY

Make Windows computer name available as host variable for azure_rm plugin, so it can be used to override ansible_host

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

azure_rm inventory plugin

ADDITIONAL INFORMATION

My use cases revolves around Domain joined Azure Windows VMs without public IPs. I have Ansible controller within my domain and I use Kerberos authentication. My VM name and computer name are different, so I can't use built-in name host variable offered by azure_rm plugin. It works by hard-coding computer name, but ideally I would like to have computer_name provided by the inventory plugin similar to name and other host variables.

plugin: azure_rm
auth_source: credential_file
profile: development
plain_host_names: false
include_vm_resource_groups:
  - <my-rg>
keyed_groups:
  - prefix: tag
    key: tags
hostvar_expressions:
  ansible_user: "'user@DOMAIN.LOCAL'"
  ansible_password: "'pw'"
  ansible_connection: "'winrm'"
  ansible_winrm_transport: "'kerberos'"
  ansible_winrm_server_cert_validation: "'ignore'"
  ansible_host: "computer_name + '.DOMAIN.LOCAL'"
@PavelPikat PavelPikat changed the title Add VM computer name to the list of host variables for azure_rm plugin Add computer_name to the list of host variables for azure_rm plugin Oct 1, 2020
@paultaiton
Copy link
Contributor

I have opened pull request #312 that adds this property to the available host variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants