Tag: ansible

Ansible with Github: Permission denied (Publickey)

I’m trying to understand the GitHub ssh configuration with Ansible (I’m working on the Ansible: Up & Running book). I’m running into two issues. Permission denied (publickey) – When I first ran the ansible-playbook mezzanine.yml playbook, I got a permission denied: failed: [web] => {“cmd”: “/usr/bin/git ls-remote ” -h refs/heads/HEAD”, “failed”: true, “rc”: 128} stderr: […]

How to add/update git tag from local machine using ansible playbook?

I’m using the following ansible playbook to deploy my applications and I would like to add a tagging role so I can automatically add/update a tag to mark the current commit as the one that has been deployed. Attempt My current attempt is as follow, based on How can I move a tag on a […]

How to check out most recent git tag using Ansible?

Is there an easy way to have Ansible check out the most recent tag on a particular git branch, without having to specify or pass in the tag? That is, can Ansible detect or derive the most recent tag on a branch or is that something that needs to be done separately using the shell […]

Ansible and Git Permission denied (publickey) at Git Clone

I have a playbook where I am trying to clone from a private repo (GIT) to a server. I have setup ssh forwarding and when I ssh into the server and try to manually clone from the same repo, it successfully works. However, when I use ansible for the to clone the repo to the […]

Can't checkout to a new branch – ansible git

I am trying to create a playbook where i can checkout to any branch just by changing a variable. The git section of the playbook is: – name: Clone repository git: repo: “{{ repo_url }}” dest: /some_path key_file: some_path_to_a_file version: “{{ repo_tag }}” force: yes I first used repo_tag=master and it worked. Then i created […]

Ansible sudo_user not using the correct $HOME directory

I have a git directory that is owned by a user that I cannot ssh as. I’m currently using sudo_user: user which is working but does not seem to be setting $HOME correctly. My user account has github in the ~/.ssh/known_hosts file but it is being added to my ~ssh_user/.ssh/known_hosts file (from the accept_hostkey=yes). http://docs.ansible.com/git_module.html […]

How to get the SHA of the checked out code with ansible git module?

I would like to store the currently checked out commit SHA-1 hash for the version of code with Ansible. I want to set_fact of this version for use in another role.

How to pull while deployment in ansible

I am using Ansible for configuration management and the following task to clone a Git repo: # Example git checkout from Ansible Playbooks – git: repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22 This clones the repo with the particular version. Does it do a git pull when run again if the repo already exists? Or does it simply clone […]

private repo is getting cloned via ansible playbook but private gem are not getting installed

I am using ansible for configuration management. I am cloning the private repo after copying the public and private key pair file to the remote server. The cloning is working fine but when I ran bundle install, getting error of public key permission denied. Ansible playbook — – hosts: launched sudo: yes remote_user: ubuntu key_file: […]

Ansible: Install package with pip from a private git repo

I am trying to install a package from a private git repo using ansible‘s pip module this way: – name: Install my package pip: name=’git+ssh://git@github.com/mycompany/my-repo.git#egg=0.1.0′ virtualenv=/path/to/venv But this hangs when I try to provision this with vagrant, most likely because it prompts for confirmation to add the key to the list of known hosts. Indeed […]

Git Baby is a git and github fan, let's start git clone.