Saturday, January 16, 2016

Trellis/Vagrant problem - ansible-galaxy fails with : "fatal error - [FOLDER] not a git repository"

This is a tip for you if your vagrant up command, or  ansible-galaxy install command fails with something like this:

fatal error: [FOLDER]/.git  not a git repository


In my case , I have tracked this error to this line in roles/nginx/tasks/main.yml file of my Vagrant (Trellis) folder:

- name: Grab h5bp/server-configs-nginx
  git:
    repo: "https://github.com/h5bp/server-configs-nginx.git"
    dest: "{{ nginx_path }}/h5bp-server-configs"

    force: yes

Replaced it with this:


- name: Clean h5bp/server-configs-nginx
  command: rm -rf "{{ nginx_path }}/h5bp-server-configs"


- name: Grab h5bp/server-configs-nginx
  command: git clone "https://github.com/h5bp/server-configs-nginx.git" {{ nginx_path }}/h5bp-server-configs
 

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...