In Ansible, I have an array like this:
tab:
- 'val1'
- 'val2'
And I want to execute a remote script like this:
- name: launch Script
script: "scripts/script.ps1 -tab {{ tab }}"
But the json format is not well recognized ([uval1 uval2]). I have to convert it to a PowerShell format:
$new_tab = $tab -replace '"','' -replace ']','' -replace '\[','' -split ","
Is there a better solution?