I am trying to install software on centos 7 using ansible playbook through jenkins.
I am trying to call ansible playbook from jenkins for installing the software.
I am using vars_prompt in ansible playbook to pass some user-defined parameters, when i run the ansible playbook manually, it asks for prompts and runs successfully but when i build using jenkins it doesn't prompt for any inputs.
Pipeline:
node {
ansiblePlaybook(
installation: 'FirstAnsibleTest',
inventory: '/etc/ansible/hosts',
playbook: '/etc/ansible/install.yml',
become: true,
colorized: true,
)
}
install.yml:
- hosts: all
vars_prompt:
- name: "webusername"
prompt: "Enter webusername"
- name: "webpassword"
prompt: "Enter webpassword"
private: yes
tasks:
- import_tasks: /etc/ansible/roles/installe/tasks/main.yml
How can I make jenkins to ask for prompts that can be passed to the ansible playbook?