ansible-consul
ansible-consul copied to clipboard
Unable to find '/tmp/consul_raw.key' in expected paths
The first run of the playbook is successful but every repeated run fails with the following error message:
Playbook
- role: brianshumate.consul
vars:
consul_group_name: "consul_nodes"
Error:
task path: /root/.ansible/roles/brianshumate.consul/tasks/nix.yml:116
[WARNING]: Unable to find '/tmp/consul_raw.key' in expected paths (use -vvvvv to see paths)
File lookup using None as file
fatal: [chachingprod0]: FAILED! => {
"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"
}
Hack/Workaround: On line: 112 in file nix.yml remove the conditions:
when:
- not consul_local_key.changed
- not bootstrap_state.stat.exists | bool
This hack will fix the issue but certainly cause unwanted side effects?!? Any idea what is causing the error in first place what actions should we take to solve this issue? Maybe we are missing some required configuration?
Versions: python-version: 2.7.16 ansible-version: 2.9.7 os-version: Debian 10 brianshumate.consul: v2.5.3
I can confirm that I'm seeing this issue as well, thanks for the hack @JakobStadlhuber
This is fixed on #407 Any timeline for the next release?
Update : https://github.com/ansible-community/ansible-consul/issues/389#issuecomment-860003991
Can confirm this. Using master branch.
Hosts run ubuntu.
Was working fine few days ago !
I tried logging it and the below error appears:
The task includes an option with an undefined variable. The error was: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'encrypt
From what i understand, the Json is not being parsed properly...
Update: It seems that my /etc/consul/config.json is messed up in previous run. Hence in the new run, it is not able to parse it correctly. So no +1 in this issue. Thanks !
If you are using the new fixed version and still getting this error, you are probably running ansible for the second time on the same server, like me. At this stage, you need to delete all the paths in "defaults/main.yml" in order to overcome the problem.
After deleting all defined paths, I was able to bypass the error.
Like as; rm -rf /usr/local/bin/consul rm -rf /etc/consul* rm -rf /opt/consul rm -rf /run/consul