diff --git a/changelogs/fragments/jinja-version.yml b/changelogs/fragments/jinja-version.yml new file mode 100644 index 00000000000..d7ec4c1e821 --- /dev/null +++ b/changelogs/fragments/jinja-version.yml @@ -0,0 +1,2 @@ +minor_changes: + - Jinja2 version 3.1.0 or later is now required on the controller. diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index 1090acd3350..28738e62403 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -82,9 +82,9 @@ from ansible.module_utils.compat.version import LooseVersion # Used for determining if the system is running a new enough Jinja2 version # and should only restrict on our documented minimum versions jinja2_version = version('jinja2') -if jinja2_version < LooseVersion('3.0'): +if jinja2_version < LooseVersion('3.1'): raise SystemExit( - 'ERROR: Ansible requires Jinja2 3.0 or newer on the controller. ' + 'ERROR: Ansible requires Jinja2 3.1 or newer on the controller. ' 'Current version: %s' % jinja2_version ) diff --git a/requirements.txt b/requirements.txt index 45c9c01b803..2daebde7d68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ # packages. Thus, this should be the loosest set possible (only required # packages, not optional ones, and with the widest range of versions that could # be suitable) -jinja2 >= 3.0.0 +jinja2 >= 3.1.0 # Jinja2 native macro support fixed in 3.1.0 PyYAML >= 5.1 # PyYAML 5.1 is required for Python 3.8+ support cryptography packaging diff --git a/test/lib/ansible_test/_data/requirements/ansible.txt b/test/lib/ansible_test/_data/requirements/ansible.txt index 45c9c01b803..2daebde7d68 100644 --- a/test/lib/ansible_test/_data/requirements/ansible.txt +++ b/test/lib/ansible_test/_data/requirements/ansible.txt @@ -3,7 +3,7 @@ # packages. Thus, this should be the loosest set possible (only required # packages, not optional ones, and with the widest range of versions that could # be suitable) -jinja2 >= 3.0.0 +jinja2 >= 3.1.0 # Jinja2 native macro support fixed in 3.1.0 PyYAML >= 5.1 # PyYAML 5.1 is required for Python 3.8+ support cryptography packaging