Skip to content

Commit

Permalink
ansible: accept 'password' shortcut
Browse files Browse the repository at this point in the history
PR-URL: #2099
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
  • Loading branch information
joaocgreis committed Jan 2, 2020
1 parent 4b5c48f commit c85f5ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ansible_python_interpreter = /NODEJS2/python-2017-04-12-py27/python27/bin/python
home = /u

[hosts:win]
ansible_become = false
ansible_connection = winrm
ansible_winrm_server_cert_validation = ignore

Expand Down
4 changes: 4 additions & 0 deletions ansible/plugins/inventory/nodejs_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ def parse_yaml(hosts, config):
hostvars.update({'ansible_become': True})
del metadata['user']

if 'password' in metadata:
hostvars.update({'ansible_password': str(metadata['password'])})
del metadata['password']

hostvars.update(metadata)

# add specific options from config
Expand Down

0 comments on commit c85f5ca

Please sign in to comment.