Updates to network credentials

Separating out the network credential used fields
This commit is contained in:
Matthew Jones
2016-04-21 16:43:31 -04:00
parent efebb3701b
commit fe360ca8e3
5 changed files with 28 additions and 7 deletions

View File

@@ -823,10 +823,10 @@ class RunJob(BaseTask):
env['ANSIBLE_NET_USERNAME'] = network_cred.username
env['ANSIBLE_NET_PASSWORD'] = decrypt_field(network_cred, 'password')
authorize = network_cred.become_method == 'sudo'
authorize = network_cred.authorize
env['ANSIBLE_NET_AUTHORIZE'] = unicode(int(authorize))
if authorize:
env['ANSIBLE_NET_AUTHORIZE_PASSWORD'] = decrypt_field(network_cred, 'become_password')
env['ANSIBLE_NET_AUTHORIZE_PASSWORD'] = decrypt_field(network_cred, 'authorize_password')
# Set environment variables related to scan jobs
if job.job_type == PERM_INVENTORY_SCAN: