File: ambiguous-ref.yml

package info (click to toggle)
ansible-core 2.19.0~beta6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,628 kB
  • sloc: python: 180,313; cs: 4,929; sh: 4,601; xml: 34; makefile: 21
file content (37 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# test for https://github.com/ansible/ansible-modules-core/pull/3386

- name: AMBIGUOUS-REF | clone repo
  git:
    repo: '{{ repo_format1 }}'
    dest: '{{ checkout_dir }}'

- name: AMBIGUOUS-REF | rename remote to be ambiguous
  command: git remote rename origin v0.1
  args:
    chdir: "{{ checkout_dir }}"

- name: AMBIGUOUS-REF | switch to HEAD
  git:
    repo: '{{ repo_format1 }}'
    dest: '{{ checkout_dir }}'
    remote: v0.1

- name: AMBIGUOUS-REF | rev-parse remote HEAD
  command: git rev-parse v0.1/HEAD
  args:
    chdir: "{{ checkout_dir }}"
  register: git_remote_head

- name: AMBIGUOUS-REF | rev-parse local HEAD
  command: git rev-parse HEAD
  args:
    chdir: "{{ checkout_dir }}"
  register: git_local_head

- assert:
    that: git_remote_head.stdout == git_local_head.stdout

- name: AMBIGUOUS-REF | clear checkout_dir
  file:
    state: absent
    path: "{{ checkout_dir }}"