privacyinpublic / vpn

Private Internet Access VPN in Vagrant w/ Ansible
Other
7 stars 1 forks source link

python prompting doesnt work #3

Open rubo77 opened 7 years ago

rubo77 commented 7 years ago

the installation fails on my Ubuntu 16.04 system:

Loaded callback default of type stdout, v2.0
1 plays in site.yml
Unexpected Exception: global name 'display' is not defined
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 85, in <module>
    sys.exit(cli.run())
  File "/usr/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 150, in run
    results = pbex.run()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 117, in run
    play.vars[vname] = display.do_var_prompt(vname, private, prompt, encrypt, confirm, salt_size, salt, default)
  File "/usr/lib/python2.7/dist-packages/ansible/utils/display.py", line 303, in do_var_prompt
    display.warning("Not prompting as we are not in interactive mode")
NameError: global name 'display' is not defined
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.  
rubo77 commented 7 years ago

When I comment out these lines in site.yml it works:

vars_prompt:
    - name: "piausername"
      prompt: "PIA Username (blank to skip)"

    - name: "piapassword"
      prompt: "PIA Password (blank to skip)"

    - name: "rsapassphrase"
      prompt: "Password for git key (blank to skip)"

I guess the variables must be defined then in Vagrantfile in the top section:

extraVars = {};
extraVars['piausername'] = 'PIAUSERNAME';
extraVars['piapassword'] = 'PIAPASSWORD';
extraVars['rsapassphrase'] = 'RSAPASSWORD';