I use an Ansible provisioning and deployment framework called
Trellis to deploy Wordpress-based applications.
I'm cloning the master from a private Bitbucket repository using the following tasks:
- name: Clone project files
git:
repo: "{{ project_git_repo }}"
dest: "{{ project_source_path }}"
version: "{{ project_version }}"
accept_hostkey: "{{ project.repo_accept_hostkey | default(repo_accept_hostkey | default(true)) }}"
ignore_errors: true
no_log: true
register: git_clone
- name: Failed connection to remote repo
fail:
msg: |
Error message here (removed for brevity)
when: git_clone | failed
The task fails, delivering the error message, but it does clone the repository. I had added some
debugging code, confirming that I was in fact accessing the correct repository successfully (before noticing that the codebase was being cloned.)
I'm not sure why the task is (or thinks it is) failing or where to look for answers.
Loving Python and Ansible.
Hoping someone can help.