解密失败(找不到可以解密的保管库机密)

Pau*_*bro 8 ansible

更新:

我已将配置组织成基于角色的目录结构。其中一些角色具有包含加密文本的默认变量文件。这是一个经过简化且经过测试但失败的任务列表:

---
- name: 'Include some additional variables'
  include_vars:
    dir: "{{playbook_dir}}/roles/foo/defaults/vars"
  tags: 'debug'

- name: 'Debug: display the variables'
  debug:
    msg: "{{item}}"
  with_items:
    - "{{encrypted_text_from_yml_file}}"
  tags: 'debug'

- name: 'Deploy Foo plugins'
  block:
    - name: 'Transfer the folder to the application directory'
      synchronize:
        src: 'some_src_folder'
        dest: "{{some_unencrypted_text_from_another_yml_file}}"
        archive: false
        recursive: true
  tags: 'debug'
Run Code Online (Sandbox Code Playgroud)

但是,在执行我的剧本时,我看到以下错误:

TASK [<some_app> : Transfer the <some_folder> folder to the application directory] **********************************************************************************
fatal: [<some_hostname>]: FAILED! => {"failed": true, "msg": "Decryption failed (no vault secrets would found t
hat could decrypt)"}
Run Code Online (Sandbox Code Playgroud)

正在从密码文件中检索我的凭据。

我在变量包含之后立即抛出了一个调试任务,并显示了所有加密的变量。奇怪的是发生异常的任务块正在使用同步模块。甚至没有使用库中的变量......

知道如何解决这个问题吗?我增加了详细程度-vvvv,但没有看到任何明显的东西。

使用:ansible 2.4.0.0

Pau*_*bro 10

我想通了这个问题。我不小心截断了group_vars/all中的加密字符串。使用-vvvvv(注意第 5 个 v)实际上有助于揭示 HMAC 问题。