Run ansible scripts

243 views
Skip to first unread message

Charles Moga

unread,
May 26, 2016, 1:41:15 AM5/26/16
to go-cd
Hello,
We use ansible for provisioning and configuration management and I am wondering if anyone has experience running ansible within gocd. We currently use Jenkins but I am sure if/how gocd supports ansible.

Thanks and response.
Regards
Charles

Ashwanth Kumar

unread,
May 26, 2016, 9:24:43 AM5/26/16
to go...@googlegroups.com
Assuming ansible-playbook is installed on the go-agent(s), you can directly invoke ansible-command from Custom Command and run your playbooks. 

HTH. 

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ashwanth Kumar / ashwanthkumar.in

Florin Prodaniuc

unread,
May 26, 2016, 2:37:03 PM5/26/16
to go-cd
Hi, 

We use ansible with gocd. It works fine. You need to have ansible installed on the go agents and make sure the user you are running ansible-playbook with has the correct permissions on the machines in the iventory.

Here's a sample job config that uses ansible:

          <job name="run_ansible">
            <tasks>
              <exec command="/bin/bash">
                <arg>-c</arg>
                <arg>ansible-playbook -i 127.0.0.1, /path/to/the/playbook/playbook_example.yml</arg>
                <runif status="passed" />
              </exec>
            </tasks>
          </job>

Cheers,
Florin

Charles Moga

unread,
May 28, 2016, 3:19:57 PM5/28/16
to go-cd
Thanks a lot.
Reply all
Reply to author
Forward
0 new messages