2017-11-25 7 views
0

debops.nullmailer을 사용할 수 없습니다 (2.4)를 사용하여 내 호스트에 nullmailer를 구성하려고합니다. 변수에 암호가 암호화되어 있으므로 보안 기능을 사용하여 암호를 암호화하려고합니다. --ask-vault-pass와이 적용 그러나유능한에서 볼트 사용하기 : 'str'과 'AnunciationVaultEncryptedUnicode'를 연결할 수 없습니다.

--- 
- name: My baseline 
    hosts: all 
    become: true 
    vars: 
    nullmailer__default_remotes: 
    - port: "587" 
     host: smtp.mailgun.org 
     user: myusername 
     pass: !vault | 
      $ANSIBLE_VAULT;1.1;AES256 
      6430...63433 
    roles: 
    - role: debops.nullmailer 

, 장황한 오류 제공합니다 : 내 작전이처럼 보이는 pass 변수를 복용

TASK [debops.nullmailer : Generate private configuration files] *******************************************************************************************************************************************************************************
fatal: [talkbot]: FAILED! => {"failed": true, "msg": "[{u'dest': u'/etc/nullmailer/remotes', u'content': u\"{{ lookup('template', 'lookup/nullmailer__remotes.j2') | from_yaml | join('\n') }}\", u'group': u'mail', u'mode': u'0600', u'owner': u'mail'}]: An unhandled exception occurred while running the lookup plugin 'template'. Error was a , original message: Unexpected templating type error occurred on ({% set nullmailer__tpl_remotes = [] %}\n{% for entry in (nullmailer__default_remotes + nullmailer__remotes) %}\n{% set nullmailer__tpl_entry = [] %}\n{% if entry is string %}\n{% set _ = nullmailer__tpl_remotes.append(entry) %}\n{% elif entry is mapping %}\n{% if entry.host|d() %}\n{% set _ = nullmailer__tpl_entry.append(entry.host) %}\n{% set _ = nullmailer__tpl_entry.append(entry.protocol|d('smtp')) %}\n{% if (((entry.starttls|d() and entry.starttls|bool) or nullmailer__starttls|bool) and (entry.ssl is undefined or not entry.ssl|bool) and (entry.options is undefined or not entry.options)) %}\n{% set _ = nullmailer__tpl_entry.append('--starttls') %}\n{% endif %}\n{% if entry.ssl|d() and entry.ssl|bool %}\n{% set _ = nullmailer__tpl_entry.append('--ssl') %}\n{% endif %}\n{% if entry.insecure|d() and entry.insecure|bool %}\n{% set _ = nullmailer__tpl_entry.append('--insecure') %}\n{% endif %}\n{% if entry.x509fmtder|d() and entry.x509fmtder|bool %}\n{% set _ = nullmailer__tpl_entry.append('--x509fmtder') %}\n{% endif %}\n{% if entry.x509cafile|d() %}\n{% set _ = nullmailer__tpl_entry.append('--x509cafile=' + entry.x509cafile) %}\n{% endif %}\n{% if entry.x509certfile|d() %}\n{% set _ = nullmailer__tpl_entry.append('--x509certfile=' + entry.x509certfile) %}\n{% endif %}\n{% if entry.x509crlfile|d() %}\n{% set _ = nullmailer__tpl_entry.append('--x509crlfile=' + entry.x509crlfile) %}\n{% endif %}\n{% if entry.port|d() %}\n{% set _ = nullmailer__tpl_entry.append('--port=' + entry.port) %}\n{% endif %}\n{% if ((entry.auth|d() and entry.auth|bool) or (entry.auth_login|d() and entry.auth_login|bool)) %}\n{% set _ = nullmailer__tpl_entry.append('--auth-login') %}\n{% endif %}\n{% if entry.user|d() %}\n{% set _ = nullmailer__tpl_entry.append('--user=' + entry.user) %}\n{% endif %}\n{% if entry.password|d() or entry.pass|d() %}\n{% set _ = nullmailer__tpl_entry.append('--pass=' + (entry.password | d(entry.pass))) %}\n{% endif %}\n{% if entry.options|d() %}\n{% set _ = nullmailer__tpl_entry.append(entry.options if entry.options is string else entry.options|join(' ')) %}\n{% endif %}\n{% set _ = nullmailer__tpl_remotes.append(nullmailer__tpl_entry | join(' ')) %}\n{% endif %}\n{% endif %}\n{% endfor %}\n{% if nullmailer__tpl_remotes %}\n{% for entry in nullmailer__tpl_remotes %}\n- '{{ entry }}'\n{% endfor %}\n{% else %}\n- ''\n{% endif %}\n): cannot concatenate 'str' and 'AnsibleVaultEncryptedUnicode' objects"}

성공적으로 작동하도록 원인이 있지만, 분명히 --pass= 매개 변수없이를 /etc/nullmailer/remotes에 필요합니다.

나는 꽤 재능이 있습니다. 여기서 무슨 일이 일어나고있는가요? strAnsibleVaultEncryptedUnicode을 연결하려는 이유는 무엇입니까? 암호 해독이 작동하지 않습니까? Ansible 볼트 암호화 변수가 Jinja2 (파이썬) append 방법 내에서 사용하는 경우

답변

1

Is the decryption not working?

은 그것도 시도 아니에요. 말했다

, 당신이해야 가장 가능성 :

  • 자신이 상황을 처리 할 수 ​​ansible-nullmailer 프로젝트를 수정 Ansible 볼트는 GitHub의 /에 문제를 대신 변수의 파일, 또는

  • 파일을 사용합니다.

+0

아, 재미 있습니다. 대신 볼트 파일을 사용해 보겠습니다. – growse