mirror of https://github.com/ansible/ansible.git
* Create python3and2 Adding tests to see if dnf still works when python-2 and python-3 are installed. * Update main.yml Include the tests that run on python 2 and python 3, based on the package manager. * Update dnf.py Use python3-dnf by default, otherwise python2-dnf. * Rename python3and2 to python3and2.yml Rename.pull/49510/head
parent
345b6cdec8
commit
3247eec97a
@ -0,0 +1,44 @@
|
|||||||
|
# INSTALLPYTHON3AND2
|
||||||
|
# The module `dnf` installs python3-dnf on python3 systems and python2-dnf
|
||||||
|
# on python2 systems. Fedora 30 and newer have python3 and limited
|
||||||
|
# support for python2, for example python2-dnf is missing.
|
||||||
|
# This test proves that python3 and python2 can be installed and the module
|
||||||
|
# `dnf` works.
|
||||||
|
|
||||||
|
- name: install python2
|
||||||
|
dnf:
|
||||||
|
name: python2
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: use python2
|
||||||
|
set_fact:
|
||||||
|
ansible_python_interpreter: /usr/bin/python
|
||||||
|
|
||||||
|
- name: install a sample package
|
||||||
|
dnf:
|
||||||
|
name: screen
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: clean up sample package
|
||||||
|
dnf:
|
||||||
|
name: screen
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: install python3
|
||||||
|
dnf:
|
||||||
|
name: python3
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: use python3
|
||||||
|
set_fact:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
|
- name: install a sample package
|
||||||
|
dnf:
|
||||||
|
name: screen
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: clean up sample package
|
||||||
|
dnf:
|
||||||
|
name: screen
|
||||||
|
state: absent
|
Loading…
Reference in New Issue