Hi Alexandre,
I see. I’ve tested on my end (Rundeck 5.8.0 / Ansible plugin 4.0.5) as follows:
Ansible side config and test1.- My ansible.cfg:
[defaults] inventory=/home/reideianto/Deployments/ansible/config/hosts nocows=12.- My inventory file, the USER_NAME variable is encrypted by ansible-vault in a file called main.yml:
[the_farm] 192.168.56.20 192.168.56.21 192.168.56.22 [the_farm:vars] use_extra_vars=true ansible_user= {{ USER_NAME }}3.- A basic/example playbook (ping_vault.yml) that uses that vault password:
- hosts: all vars_files: - /home/reideianto/Deployments/ansible/config/vaults/main.yml tasks: - name: Ping ping:4.- Now, I’ve tested directly from Ansible (not via rundeck) with the following command:
ansible-playbook ping_vault.yml --ask-vault-passObtaining the following result:
Vault password: PLAY [all] *********************************************************************************************************************************************************************** TASK [Gathering Facts] *********************************************************************************************************************************************************** ok: [192.168.56.20] ok: [192.168.56.22] ok: [192.168.56.21] TASK [Ping] ********************************************************************************************************************************************************************** ok: [192.168.56.20] ok: [192.168.56.22] ok: [192.168.56.21] PLAY RECAP *********************************************************************************************************************************************************************** 192.168.56.20 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.56.21 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.56.22 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=05.- Passing the wrong password the result is expected (it fails):
Vault password: ERROR! Decryption failed (no vault secrets were found that could decrypt) on /home/reideianto/Deployments/ansible/config/vaults/main.yml Now let’s integrate Ansible and Rundeck1.- My Ansible model source config (take a look). Check your settings carefully here.
2.- My Node executor config (take a look).
3.- My Job definition (contains the same Playbook tested in the “only ansible test” as an inline playbook):
- defaultTab: nodes description: '' executionEnabled: true id: c2c64069-2ac8-4857-b872-87e3191539ce loglevel: INFO name: VaultTest nodeFilterEditable: false nodefilters: dispatch: excludePrecedence: true keepgoing: false rankOrder: ascending successOnEmptyNodeFilter: false threadcount: '1' filter: 192.* nodesSelectedByDefault: true plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - configuration: ansible-base-dir-path: /home/reideianto/Deployments/ansible/config/ ansible-become: 'false' ansible-binaries-dir-path: /home/reideianto/.local/bin/ ansible-encrypt-extra-vars: 'false' ansible-playbook-inline: |- - hosts: all vars_files: - /home/reideianto/Deployments/ansible/config/vaults/main.yml tasks: - name: Ping ping: ansible-ssh-passphrase-option: option.password ansible-ssh-use-agent: 'false' ansible-vault-storage-path: keys/vaultpasswd nodeStep: true type: com.batix.rundeck.plugins.AnsiblePlaybookInlineWorkflowNodeStep keepgoing: false strategy: node-first uuid: c2c64069-2ac8-4857-b872-87e3191539ce4.- The vault password is stored on the keys/vaultpasswd Key Storage path (Rundeck).
5.- With the right password (take a look).
6.- With the wrong password (take a look)
Could you test your environment in this way? Probably I’m missing something.
Regards!