If curl is not available, the task Check the opensearch status fails with the error
TASK [linux/opensearch : Check the opensearch status] *************************************************************************
[WARNING]: Consider using the get_url or uri module rather than running 'curl'. If you need to use command because get_url or
uri is insufficient you can add 'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid
of this message.
fatal: [os1]: FAILED! => {"changed": false, "cmd": "curl 'https://os1:9200/_cluster/health?pretty' -u 'admin:********@123' -k", "msg": "[Errno 2] No such file or directory: b'curl'", "rc": 2}
...
To Reproduce
Steps to reproduce the behavior:
Provide machines without curl installed
Execute the playbook opensearch.yml using ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" --become
See the above error
Expected behavior
No error.
Playbook Nameopensearch.yml
Host/Environment (please complete the following information):
Describe the bug
If
curl
is not available, the taskCheck the opensearch status
fails with the errorTo Reproduce Steps to reproduce the behavior:
curl
installedopensearch.yml
usingansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" --become
Expected behavior No error.
Playbook Name
opensearch.yml
Host/Environment (please complete the following information):
Additional context As already indicated in the error message, using the
uri
module would be preferred over calling the external commandcurl
. I guess https://github.com/heiderich/ansible-playbook/commit/b41ae14115e7ffaa691e25e5db2738ec6550000e will resolve this issue. However currently I cannot completely test it due to another issue.Independently of this issue it would be a good idea to validate the certs. But I consider this a separate issue.