Skip to content
Advertisement

Ansible Replace the string variable in uri module

I want to download the filebeat7.15.2 binaries form artifactory. I am passing the version in my playbook as 7-15-2, but want to change in the playbook to 7.15.2 in uri module only. My binary is stored in example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7.15.2-linux-x86_64.tar.gz

my playbook:

JavaScript

I am running the playbook like

JavaScript
JavaScript

I am getting error as url not found: “url”: “example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7-15-2-linux-x86_64.tar.gz”,

Any suggest on how to change the example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7-15-2-linux-x86_64.tar.gz to example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7.15.2-linux-x86_64.tar.gz

Advertisement

Answer

Have you tried

JavaScript

you can also store the parsed filebeat version as it’s own variable/fact for the task similar to the following

JavaScript

and then you can use the filebeat_semver whenever you want the parsed semantic version.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement