I have an Ansible Inventory file which has ansible_password value which needs to be replaced by user input
what I have is below in a windows.yaml
ansible_user=sa_user@somewindowsdomain.external
ansible_password =
and I take an userInput from Jenkins, where user enters &32lihdye34jC5W
parameters {
password defaultValue: '', description: 'Please Enter ansible_password ', name: 'sa_pass'
}
sh 'echo ${sa_pass}'
I tried below
sed -i "s/ansible_password=.*/ansible_password=${sa_pass}/g" $inventory_path/windows.yaml
which doesn't do what I wanted but got below
ansible_password=ansible_password32lihdye34jC5W
what I was expecting is
ansible_password = &32lihdye34jC5W