Stouts / Stouts.openvpn

Ansible role to install and configure OpenVPN server
MIT License
287 stars 207 forks source link

Failure during "Set Client cert and CA info as fact" #64

Open bobbyshaw opened 7 years ago

bobbyshaw commented 7 years ago

Ansible version: 2.2.0.0

Installed role via git.

TASK [Stouts.openvpn : Set client cert and CA info as fact.] *******************
fatal: [vpn1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: Unable to look up a name or access an attribute in template string ({{ openvpn_read_tlsauth_file_results['content'] | b64decode | default('') }}).\nMake sure your variable name does not contain invalid characters like '-': a2b_base64() argument 1 must be convertible to a buffer, not StrictUndefined\n\nThe error appears to have been in '/usr/local/etc/ansible/roles/Stouts.openvpn/tasks/read-client-files.yml': line 30, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set client cert and CA info as fact.\n  ^ here\n"}
luntzel commented 7 years ago

same with ansible 2.2.1.0

ponimas commented 7 years ago

same with 2.1.4

jasonsoutar commented 7 years ago

I was having the same problem. I removed - openvpn_unified_client_profiles: yes from my playbook and it started working.

mojojoseph commented 7 years ago

And if someone wants unified client profiles? I receive this error as well and don't want to turn off that option.

JonathanSerafini commented 7 years ago

Seems like openvpn_unified_client_profiles only works in conjunction with openvpn_tls_auth=true

mojojoseph commented 7 years ago

Can confirm that setting openvpn_tls_auth: true will allow the unified client profiles. Just connected to my VPN with a unified profile and works great. Thanks @JonathanSerafini !

rjonczy commented 7 years ago

I can also confirm that unified_client_profiles work with openvpn_tls_auth: true

rolanddb commented 7 years ago

Just one more data point: unified_client_profiles started working only when I set openvpn_tls_auth: true

ansible 2.3.1.0 (managed host: Ubuntu)