trailofbits / algo

Set up a personal VPN in the cloud
https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
GNU Affero General Public License v3.0
28.65k stars 2.31k forks source link

a bytes-like object is required, not 'AnsibleUnsafeText' #277

Closed FiloSottile closed 7 years ago

FiloSottile commented 7 years ago

OS / Environment

Local: macOS Sierra

Remote: Debian Jessie

Ansible version

ansible 2.2.0.0
  config file = /Users/filippo/build/algo/ansible.cfg
  configured module search path = Default w/o overrides

Version of components from requirements.txt

ansible (2.2.0.0)
apache-libcloud (1.5.0)
asn1crypto (0.22.0)
azure (2.0.0rc5)
azure-batch (0.30.0rc5)
azure-common (1.1.4)
azure-graphrbac (0.30.0rc5)
azure-mgmt (0.30.0rc5)
azure-mgmt-authorization (0.30.0rc5)
azure-mgmt-batch (0.30.0rc5)
azure-mgmt-cdn (0.30.0rc5)
azure-mgmt-cognitiveservices (0.30.0rc5)
azure-mgmt-commerce (0.30.0rc5)
azure-mgmt-compute (0.30.0rc5)
azure-mgmt-keyvault (0.30.0rc5)
azure-mgmt-logic (0.30.0rc5)
azure-mgmt-network (0.30.0rc5)
azure-mgmt-notificationhubs (0.30.0rc5)
azure-mgmt-nspkg (1.0.0)
azure-mgmt-powerbiembedded (0.30.0rc5)
azure-mgmt-redis (0.30.0rc5)
azure-mgmt-resource (0.30.0rc5)
azure-mgmt-scheduler (0.30.0rc5)
azure-mgmt-storage (0.30.0rc5)
azure-mgmt-web (0.30.0rc5)
azure-nspkg (1.0.0)
azure-servicebus (0.20.2)
azure-servicemanagement-legacy (0.20.3)
azure-storage (0.32.0)
boto (2.46.1)
boto3 (1.4.4)
botocore (1.5.29)
certifi (2017.1.23)
cffi (1.10.0)
chardet (2.3.0)
cryptography (1.8.1)
docutils (0.13.1)
dopy (0.3.5)
enum34 (1.1.6)
idna (2.5)
isodate (0.5.4)
Jinja2 (2.8)
jmespath (0.9.2)
keyring (10.3.1)
MarkupSafe (1.0)
msrest (0.4.1)
oauthlib (2.0.2)
packaging (16.8)
paramiko (2.1.2)
pip (7.1.2)
pyasn1 (0.2.3)
pycparser (2.17)
pycrypto (2.6.1)
pyOpenSSL (16.2.0)
pyparsing (2.2.0)
python-dateutil (2.6.0)
PyYAML (3.12)
requests (2.13.0)
requests-oauthlib (0.8.0)
s3transfer (0.1.10)
setuptools (18.2)
six (1.10.0)
wheel (0.24.0)

Summary of the problem

TASK [vpn : Set facts for mobileconfigs] ***************************************
fatal: [X.X.X.X]: FAILED! => {"failed": true, "msg": "Unexpected templating type error occurred on ({{ lookup('file' , 'configs/{{ IP_subject_alt_name }}/pki/cacert.pem')|b64encode }}): a bytes-like object is required, not 'AnsibleUnsafeText'"}

Steps to reproduce the behavior

Happens every time I run ./algo

The way of deployment (cloud or local)

Cloud - 5. existing Ubuntu

FiloSottile commented 7 years ago

ansible/ansible#20290

vytis commented 7 years ago

I had the same issue and forcing Python2.7 solved it - https://github.com/trailofbits/algo/blob/master/docs/TROUBLESHOOTING.md#6-error-typeerror-must-be-str-not-bytes

dguido commented 7 years ago

Thanks for the note, that makes sense.