Use case : Running the ansible playbook from jenkins(Parameterized pipeline), user should be able to edit the ansible inventory file.
my inventory file looks like below(yml format, filename: hosts): [myhosts]
[myhosts:vars]
ansible_host=xx.xxx.xxx.xx
ansible_user=user
ansible_password=password
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
What I am looking for : display hosts file content in input text parameter,
<input type="text" id="inve" name="value" class="setting-input" value="#**hostfilecontent**#">
user should be able to edit the values from input text field, and the pipeline should be able to replace the **hosts **file with the new values which user edited from the parameterized pipeline.
Is there any plugin which helps me to do this?
Tried active choice reactive reference parameter which returns an html, Groovy script:
String fileContents = new File('/path/to/file').text
return """<html> <input type="text" id="inve" name="value" class="setting-input" value="${fileContent}">"""
This displays the content, but in a single line.