I have Ansible and Jenkins installed on Different Servers how can i configure both

26 views
Skip to first unread message

Sai Prasha

unread,
Jan 22, 2020, 11:04:00 PM1/22/20
to Ansible Project
I have Ansible and Jenkins on Windows but on different servers how can i establish a connection between this two to trigger a playbook based on inventory files
What is the inventory path to be given? 
My inventory file is as shown below 

[win]
10.96.43.61
10.96.43.177

[win:vars]
ansible_user=Administrator
ansible_password=N0b0r33l
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore

J Hawkesworth

unread,
Jan 24, 2020, 12:31:30 PM1/24/20
to Ansible Project
You can use the not-particularly-helpfully-named 'Publish Over SSH' Jenkins plugin https://plugins.jenkins.io/publish-over-ssh which lets you run arbitrary commands as well as transferring files.

If your playbooks run for more than 2 minutes you will need to configure the 'Exec timeout (ms)' setting ( I found I had to do this in the common jenkins configuration and individually on each Jenkins job).

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages