Hello,

I have a playbook.yml which outputs password, please see this task:

tasks:

- name: get
  command: echo {{ test_password }}
  register: result

- debug: var=result.stdout_lines


I run this playbook in python script:

    def run_playbook():
        stats = callbacks.AggregateStats()
        playbook_cb = callbacks.PlaybookCallbacks(
                      verbose=ansible.utils.VERBOSITY)
        runner_cb = callbacks.PlaybookRunnerCallbacks(
                      stats, verbose=ansible.utils.VERBOSITY)
        pb = PlayBook(playbook='playbook.yml',
                      stats=stats,
                      callbacks=playbook_cb,
                      runner_callbacks=runner_cb,
                      check=True,
                      vault_password='abcd')
        pb.run()

Print pb

returns an object, but I fail to figure out how to return the content of 
password so I can use it in the python script for the authentication.
Any ideas?


Thanks in advance,
Eve

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/eaf47962-ac6d-45e5-9572-95b38f2cec09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to