Ansible Deploy for Bamboo

Description

A simple addon introducing support for ansible execution directly from your deploy and build projects

​Main features:


  • support for main commands ansible and ansible-playbook



  •  automatic cleanup of child processes from ansible





In order to use the plugin you will need to install ansible of the agent and ensure it is in the system path.

12 comments:

  1. This above information really Good beginners are looking for these type of blogs, Thanks for sharing article on Devops Online Training Bangalore

    ReplyDelete
  2. Why is it not using the ssh key from the user running bamboo? Is there a way to use key authentication without providing it in the task?

    ReplyDelete
    Replies

    1. I never provide the keys inside bamboo plugin. I only specify in inventory the servers and keys like ~/.ssh/xsa.pem or just server address

      Also make sure the bamboo agent user is trusted by remote server.

      Delete
    2. The bamboo agent user is trusted by remote server, but it seams that the way ansible gets called from bamboo the key in my case ~/.ssh/id_ecdsa is not used, when I login as the bamboo agent user and ssh to the remote server I can login with the ssh key.

      Delete
    3. My bad, as usual the problem sits in front of the pc, after going through with -vvvv I got the problem, I forgot to set the remote_user to root.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Hi, there. I uploaded the PEM via the task, public key has been deployed to the target server, but I'm still getting the ERROR 13(host key cannot be verified)

    ReplyDelete
    Replies
    1. Try to add -vvvv to the options of the ansible deploy task to see more information. I would check few things like: permissions of the authorized_keys, enabled key types on the server (like is rsa, dsa enabled depending on your key) etc. The flag -vvvv should give more info about what is wrong.

      Delete
    2. Thanks! I got it working with the default ssh key, id_rsa....what if i have a different key pair with name like "ansible", how can I specify the task to use this key?

      Delete
    3. I put in inventory something like this:

      [bastionhosts]
      1.1.1.1 ansible_ssh_private_key_file=~/.ssh/bastion.pem ansible_ssh_user=ec2-user

      Delete
    4. Anonymous3/26/2018

      Thanks a lot... I will give it a try

      Delete
  5. This comment has been removed by the author.

    ReplyDelete