Package: ansible
Version: 2.7.5+dfsg-1
Severity: normal

Dear Maintainer,

Using testing, Ansible crashes when trying to read vault variables. I
see this issue since Ansible 2.6 at least.

For example, I have a playbook I run with:
  ansible-playbook -i host.ini -bkK --vault-id @prompt main.yml -vvv

The error is attached (ansible-crash.log).

The vault is:

$ANSIBLE_VAULT;1.1;AES256
38613831366531323432326436616438363765303566326439336563313534386533396236383035
3363363335383833303665326262666563646465363862330a336639646631336265613639666365
62396566663234303533653934366536313765376135303162306432373662376638326634343432
3933633832353761300a333964393134316265653161633736656233306463346535313761303732
61653363623836383964663365663734346636323735623863396435303938306162663939363135
3634663662386334383263653430653965383162376532633664

And contains:

dyndns_pwd: 1234
smtpd_pwd: 1234

For reference, I asked on Ansible forums
(https://groups.google.com/forum/#!msg/ansible-project/WlPtOS2h1vE/fnlzbZv1BgAJ)
with no answer.

Best regards,
Yvan

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8),
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ansible depends on:
ii  python                2.7.15-3
ii  python-crypto         2.6.1-9+b1
ii  python-cryptography   2.3-1
ii  python-httplib2       0.11.3-1
ii  python-jinja2         2.10-1
ii  python-netaddr        0.7.19-1
ii  python-paramiko       2.4.2-0.1
ii  python-pkg-resources  40.6.2-1
ii  python-yaml           3.13-1

Versions of packages ansible recommends:
ii  python-jmespath   0.9.3-1
ii  python-kerberos   1.1.14-1+b1
ii  python-libcloud   2.3.0-3
ii  python-selinux    2.8-1+b1
pn  python-winrm      <none>
ii  python-xmltodict  0.11.0-2

Versions of packages ansible suggests:
pn  cowsay   <none>
ii  sshpass  1.06-1

-- no debconf information
TASK [include_vars] ******************************************************************************************************************************************************************************
task path: /some/path/to/playbook.yml:39
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 140, in run
    res = self._execute()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 612, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/include_vars.py", line 131, in run
    self._load_files(self.source_file)
  File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/include_vars.py", line 236, in _load_files
    b_data, show_content = self._loader._get_file_contents(filename)
  File "/usr/lib/python2.7/dist-packages/ansible/parsing/dataloader.py", line 162, in _get_file_contents
    return self._decrypt_if_vault_data(data, b_file_name)
  File "/usr/lib/python2.7/dist-packages/ansible/parsing/dataloader.py", line 132, in _decrypt_if_vault_data
    b_data = self._vault.decrypt(b_vault_data, filename=b_file_name)
  File "/usr/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py", line 658, in decrypt
    plaintext, vault_id, vault_secret = self.decrypt_and_get_vault_id(vaulttext, filename=filename)
  File "/usr/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py", line 743, in decrypt_and_get_vault_id
    display.vvvvv('Decrypt%s successful with secret=%s and vault_id=%s' % (file_slug, vault_secret, vault_secret_id))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 36: ordinal not in range(128)

fatal: [home-server]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to