2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | clean out the output_dir
|
2017-01-06 23:38:53 +01:00
|
|
|
file:
|
|
|
|
path: "{{ output_dir }}"
|
|
|
|
state: absent
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | create clean output_dir
|
2017-01-06 23:38:53 +01:00
|
|
|
file:
|
|
|
|
path: "{{ output_dir }}"
|
|
|
|
state: directory
|
|
|
|
|
2018-02-10 19:48:44 +01:00
|
|
|
- name: SETUP | install git
|
|
|
|
package:
|
2020-01-24 15:42:47 +01:00
|
|
|
name: '{{ item }}'
|
2020-08-07 21:28:10 +02:00
|
|
|
when: ansible_distribution not in ["MacOSX", "Alpine"]
|
2019-03-29 00:08:38 +01:00
|
|
|
notify:
|
2020-02-11 22:25:44 +01:00
|
|
|
- cleanup
|
2020-01-24 15:42:47 +01:00
|
|
|
with_items: "{{ git_required_packages[ansible_os_family | default('default') ] | default(git_required_packages.default) }}"
|
2018-02-10 19:48:44 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | verify that git is installed so this test can continue
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: which git
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | get git version, only newer than {{git_version_supporting_depth}} has fixed git depth
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: git --version | grep 'git version' | sed 's/git version //'
|
|
|
|
register: git_version
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | get gpg version
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: gpg --version 2>1 | head -1 | sed -e 's/gpg (GnuPG) //'
|
|
|
|
register: gpg_version
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | set git global user.email if not already set
|
2017-01-26 02:53:53 +01:00
|
|
|
shell: git config --global user.email || git config --global user.email "noreply@example.com"
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | set git global user.name if not already set
|
2017-01-26 02:53:53 +01:00
|
|
|
shell: git config --global user.name || git config --global user.name "Ansible Test Runner"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP | create repo_dir
|
|
|
|
file:
|
|
|
|
path: "{{ repo_dir }}"
|
|
|
|
state: directory
|
2019-06-19 18:38:05 +02:00
|
|
|
|
|
|
|
- name: SETUP | show git version
|
|
|
|
debug:
|
|
|
|
msg: "Running test with git {{ git_version.stdout }}"
|