Tag: ansible

Verify git remote repo user:password in advance using ansible task

I need to know in advance if credentials for a given repo are valid and get the latest revision/release number/name . I do something like this in case of svn repo: – name: Validate SVN credentials command: svn info –username {{ app.repo.username }} –password {{ app.repo.password }} {{ app.repo.url }}| awk ‘/Revision/ { print $2; […]

Is there a cache in ansible git module?

I am using an ansible-playbook for my deployment and am using git to checkout my source code. The problem I am having is, I keep on getting stale versions of my source. I don’t know why this is happening. It was okay before this. Is there a way to disable the cache is there is […]

How to clone git repository using ansible under microsoft windows

Ansible 2.1, control host under centos7, number of windows 10 as clients. I need to clone git reposritory on remote side, but no idea how to do this: there is no windows native module linux module doesn’t work I’ve tried something like: – name: clone repositories git: repo: “{{ item.repo }}” dest: “C:\openserver\domains\{{ domain_name }}\{{ […]

Ansible: how to init git bare repository and clone it to the same machine?

I would like to ask you how it is possible to implement such a case using Ansible. My main goal is to nit git bare repository and clone it to the same machine (/var/www). My usual steps were: 1) git init —bare (running in /git/project-name) 2) git clone /git/project-name —no-hardlinks (running in в /var/www) When […]

Triggering Jenkins to run application tests when GitHub PR is created

I am a noob to Jenkins, and I have a Jenkins server that runs an ansible playbook to deploy the app. I would like to be able to have Jenkins run an ansible playbook which runs application python tests when a GitHub pull request is opened. I would then like the results of the tests […]

Unable to install git and related plugins in Jenkins using Ansible

I am trying to install the following Jenkins plugins(while installing Jenkins) using Ansible git,git-client,ssh,scm-api,shiningpanda plugin After execution packages ssh, scm-api, shiningpanda plugins got installed.git and git-client are not in the list of installed plugins. Below is the code and link to the the code I have used: – name: Get the jenkins-cli jarfile from the […]

Pip install of a specific git commit failing via Ansible Playbook

In this example, Django-cities fails. – hosts: localhost tasks: – name: Install Django pip: name=Django – name: Install Userena pip: name=django-userena – name: Install Django Messages pip: name=https://github.com/arneb/django-messages/archive/master.zip – name: Install Django Cities pip: name=git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6 error: TASK [Install Django Cities] *************************************************** fatal: [localhost]: FAILED! => {“changed”: false, “cmd”: “/usr/bin/pip2 install -e git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6”, “failed”: true, “msg”: […]

Ansible hangs when pulling from vsts git repo

Hi I’m attmepting to clone from a vsts git repository (ssh://********/_git/ClouderaAutomation) but ansible seems to just hang when I try. Below is a snippet of the git module being used. name: Clone git repo. git: repo: “{{ repoToClone }}” dest: “/home/vagrant/ClouderaAutomation” accept_hostkey: yes clone: yes become: yes repoToClone is ssh://********/_git/ClouderaAutomation. When i execute ‘git clone’ […]

Using variables assigned with heredoc content in a Bash script via Sed

I’m trying to replace some configuration data in Ansible files with values that I have assigned with heredoc. The heredoc data contains values that are retrieved from Git. The end goal is to retrieve Git config and update some Ansible var files with their values. I don’t know how to resolve the error sed: -e […]

How to get the commit id of git while doing ansible deploy

I’m using ansible to deploy project, while deployment I do take last Commit Id of git so that in case of any problem I should be able to revert back. The process of taking commit id is tedious and requires to login to remote server and getting the commit id. Is there any way I […]

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