1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/hg/tasks/install.yml
Felix Fontein 027ffcae56
Fix more tests (#66)
* Fix permissions.

* Fix more FQCNs.

* Adjust more ansible_pkg_mgr usages.

* Fix plugin FQCN.

* Change port 12345 -> 12347.

* Print port usage first.

* Support both short and long name.

* Revert "Print port usage first."

This reverts commit ea1dbc60f08a2664a8b01abba7aa7610bc2a23f1.

* Revert "Change port 12345 -> 12347."

This reverts commit cbc13510ee9f855110b4134517b2a548745a1fb0.

* Fix cleanup.

* Add more FQCNs.

* Allow short name as well.

ci_complete

* Add remaining ignore.txt entries for ipaddress.

* Remove kubevirt ignore.txt entries.

* Added missing entries, and sorted.

* Remove superfluous fact gathering.

* Fix FQCNs.

* Temporarily disable supervisorctl (fails on OSX because socket path is too long)

* Add missing file.

* Fix permissions.

ci_complete
2020-03-30 11:06:48 +02:00

78 lines
2.3 KiB
YAML

- name: get the default python version
command: "{{ ansible_python_interpreter }} -V"
register: default_python_version
- name: find the default python
command: which python
register: which_python
- name: find the default pip
command: which pip
register: which_pip
- name: preserve the default python
command: cp -av "{{ which_python.stdout }}" "{{ which_python.stdout }}.default"
- name: preserve the default pip
command: cp -av "{{ which_pip.stdout }}" "{{ which_pip.stdout }}.default"
# using the apt module prevents autoremove from working, so call apt-get via shell instead
- name: install mercurial (apt)
shell: apt-get -y update && apt-get -y install mercurial
when: ansible_facts.pkg_mgr == 'apt'
- name: install mercurial (dnf)
dnf:
name: mercurial
when: ansible_facts.pkg_mgr == 'dnf'
- name: install mercurial (yum)
yum:
name: mercurial
when: ansible_facts.pkg_mgr == 'yum'
- name: install mercurial (pkgng)
package:
name: mercurial
when: ansible_facts.pkg_mgr in ['pkgng', 'community.general.pkgng']
- name: preserve the updated python
command: cp -av "{{ which_python.stdout }}" "{{ which_python.stdout }}.updated"
- name: preserve the updated pip
command: cp -av "{{ which_pip.stdout }}" "{{ which_pip.stdout }}.updated"
- name: locate mercurial
command: which hg
register: which_hg
- name: get the mercurial interpreter
command: head -n 1 "{{ which_hg.stdout }}"
register: hg_interpreter
- name: stat the mercurial interpreter
stat:
path: "{{ hg_interpreter.stdout[2:] }}"
register: stat_hg_interpreter
- name: bypass the mercurial python interpreter symlink (if needed)
lineinfile:
path: "{{ which_hg.stdout }}"
regexp: "^#!.*$"
line: "#!{{ stat_hg_interpreter.stat.lnk_source }}"
when: stat_hg_interpreter.stat.islnk
- name: restore the default python
command: cp -av "{{ which_python.stdout }}.default" "{{ which_python.stdout }}"
- name: restore the default pip
command: cp -av "{{ which_pip.stdout }}.default" "{{ which_pip.stdout }}"
- name: get the current python version
command: "{{ ansible_python_interpreter }} -V"
register: current_python_version
- name: verify the python version has not changed
assert:
that:
- default_python_version.stdout == current_python_version.stdout