From 314f8b693769b3d82ee436944301425e88a6051b Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mar 27 2018 17:17:38 +0000 Subject: Merge remote-tracking branch 'origin/master' into el6 --- diff --git a/.gitignore b/.gitignore index e70e740..db2219e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ /ansible-2.4.0.0.tar.gz /ansible-2.4.1.0.tar.gz /ansible-2.4.2.0.tar.gz +/ansible-2.4.3.0.tar.gz +/ansible-2.5.0.tar.gz diff --git a/28015d8ae9831c272d16ce0ae2a57ccff3b445c7.patch b/28015d8ae9831c272d16ce0ae2a57ccff3b445c7.patch new file mode 100644 index 0000000..2bea93b --- /dev/null +++ b/28015d8ae9831c272d16ce0ae2a57ccff3b445c7.patch @@ -0,0 +1,21 @@ +From 28015d8ae9831c272d16ce0ae2a57ccff3b445c7 Mon Sep 17 00:00:00 2001 +From: Brian Coca +Date: Tue, 13 Feb 2018 17:43:26 -0500 +Subject: [PATCH] ensure cli dir exists before saving files to it + +--- + docs/docsite/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/docs/docsite/Makefile b/docs/docsite/Makefile +index 3bb3c454c35..4b5d8d9d203 100644 +--- a/docs/docsite/Makefile ++++ b/docs/docsite/Makefile +@@ -74,6 +74,7 @@ clean: + + # TODO: make generate_man output dir cli option + cli: $(GENERATE_CLI) ++ mkdir -p rst/cli + PYTHONPATH=../../lib $(GENERATE_CLI) --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py + + keywords: $(FORMATTER) ../templates/playbooks_keywords.rst.j2 diff --git a/4b406de19ae66263c3623d82db6b93d7d112018a.patch b/4b406de19ae66263c3623d82db6b93d7d112018a.patch new file mode 100644 index 0000000..b8601c3 --- /dev/null +++ b/4b406de19ae66263c3623d82db6b93d7d112018a.patch @@ -0,0 +1,62 @@ +From 4b406de19ae66263c3623d82db6b93d7d112018a Mon Sep 17 00:00:00 2001 +From: Matt Davis +Date: Fri, 23 Mar 2018 05:04:13 -0700 +Subject: [PATCH] pick up missing plugin docs boolean coercion backport + +--- + docs/templates/plugin.rst.j2 | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2 +index 106d82b64ff..2572232c79c 100644 +--- a/docs/templates/plugin.rst.j2 ++++ b/docs/templates/plugin.rst.j2 +@@ -107,7 +107,7 @@ Parameters + {# default / choices #} + +
+- {# Recalculate choices and boolean values #} ++ {# Turn boolean values in 'yes' and 'no' values #} + {% if value.default is defined %} + {% if value.default == true %} + {% set _x = value.update({'default': 'yes'}) %} +@@ -122,10 +122,16 @@ Parameters + {% if value.choices %} +
    Choices: + {% for choice in value.choices %} +- {% if (value.default is string and choice == value.default) or (value.default is iterable and choice in value.default) %} +-
  • @{ choice | escape }@ ←
  • ++ {# Turn boolean values in 'yes' and 'no' values #} ++ {% if choice == true %} ++ {% set choice = 'yes' %} ++ {% elif choice == false %} ++ {% set choice = 'no' %} ++ {% endif %} ++ {% if (value.default is string and value.default == choice) or (value.default is iterable and value.default is not string and choice in value.default) %} ++
  • @{ choice | escape }@ ←
  • + {% else %} +-
  • @{ choice | escape }@
  • ++
  • @{ choice | escape }@
  • + {% endif %} + {% endfor %} +
+@@ -305,7 +311,6 @@ Common return values are documented :ref:`here `, the foll +
+ {% for i in range(1, loop.depth) %} +
 
+-
+ {% endfor %} +
+ @{ key }@ +@@ -324,9 +329,9 @@ Common return values are documented :ref:`here `, the foll + {% endfor %} + {% endif %} +
+- {% if value.sample is defined and value.sample %} ++ {% if value.sample is defined and value.sample %} +
Sample:
+- {# TODO: The sample should be escaped, using | escape or | htmlify, but both mess things up beyond repair with dicts #} ++ {# TODO: The sample should be escaped, using |escape or |htmlify, but both mess things up beyond repair with dicts #} +
@{ value.sample | replace('\n', '\n ') | html_ify }@
+ {% endif %} +
diff --git a/ansible.spec b/ansible.spec index ba64974..904d077 100644 --- a/ansible.spec +++ b/ansible.spec @@ -5,32 +5,39 @@ %global __python2 /usr/bin/python2.6 %endif -%if 0%{?rhel} <= 5 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -%endif - +# RHEL 6 and 7 do not have BuildRequires to build docs %if 0%{?fedora} || 0%{?rhel} >= 8 %global with_docs 1 %else %global with_docs 0 %endif -%if 0%{?fedora} +# Build Fedora and RHEL larger than 7 with python3 +%if 0%{?fedora} || 0%{?rhel} >= 8 %global with_python3 1 %else %global with_python3 0 %endif -%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +# Fedora 29+ and RHEL larger than 7 no python2, python3 default +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +%global with_python2 0 +%else +%global with_python2 1 +%endif Name: ansible Summary: SSH-based configuration management, deployment, and task execution system -Version: 2.4.2.0 +Version: 2.5.0 Release: 1%{?dist} Group: Development/Libraries License: GPLv3+ Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz +# Docs fixes from master branch +Patch0: https://github.com/ansible/ansible/commit/28015d8ae9831c272d16ce0ae2a57ccff3b445c7.patch +Patch1: https://github.com/ansible/ansible/commit/f237508caa6e99aafb8691b148b41371105d12e7.patch +Patch2: https://github.com/ansible/ansible/commit/4b406de19ae66263c3623d82db6b93d7d112018a.patch # Patch to utilize a newer jinja2 package on epel6 # Non-upstreamable as it creates a dependency on a specific version of jinja. @@ -41,6 +48,14 @@ Patch100: ansible-newer-jinja.patch Url: http://ansible.com BuildArch: noarch +# This is needed to update the old ansible-fireball package that is no +# longer needed. Note that you should also remove ansible-node-fireball manually +# Where you still have it installed. +# +Provides: ansible-fireball = %{version}-%{release} +Obsoletes: ansible-fireball < 1.2.4 + +%if 0%{?with_python2} %if 0%{?rhel} && 0%{?rhel} <= 5 # On RHEL6 use the python26 stack BuildRequires: python26-devel @@ -52,8 +67,10 @@ Requires: python26-jinja2 BuildRequires: python2-devel BuildRequires: python-setuptools -# For building docs +# For building docs/tests +BuildRequires: git-core BuildRequires: python-sphinx +BuildRequires: asciidoc # For tests # We don't run tests on epel6, so don't bother pulling these in there. @@ -69,15 +86,16 @@ BuildRequires: python-mock BuildRequires: python-boto3 BuildRequires: python-botocore BuildRequires: python-passlib +# Fedora only docs building +BuildRequires: python2-sphinx-theme-alabaster # rhel7 does not have python-pytest but has pytest %if 0%{?rhel} == 7 BuildRequires: pytest -#BuildRequires: python-pytest-xdist -#BuildRequires: python-pytest-mock %else BuildRequires: python-pytest BuildRequires: python-pytest-xdist BuildRequires: python-pytest-mock +BuildRequires: python-packaging %endif %endif @@ -126,22 +144,16 @@ BuildRequires: python-crypto2.6 BuildRequires: python-simplejson %endif -# -# This is needed to update the old ansible-firewall package that is no -# longer needed. Note that you should also remove ansible-node-firewall manually -# Where you still have it installed. -# -Provides: ansible-fireball = %{version}-%{release} -Obsoletes: ansible-fireball < 1.2.4 %description - Ansible is a radically simple model-driven configuration management, multi-node deployment, and remote task execution system. Ansible works over SSH and does not require any software or daemons to be installed on remote nodes. Extension modules can be written in any language and are transferred to managed machines automatically. +%endif # python2 + %if 0%{?with_python3} # Note, ansible is not intended to be used as a library so avoiding the @@ -151,8 +163,16 @@ are transferred to managed machines automatically. # versions of ansible should behave identically but python3-only bugs may be present. # So upstream would like us to ship both py2 and py3 ansible (at least in # rawhide) for people to beat on and find bugs. + +# However, for future ELs and Fedora 29+, we want Python 3 only +%if 0%{?with_python2} %package -n ansible-python3 Summary: SSH-based configuration management, deployment, and task execution system +%else +Provides: ansible-python3 = %{version}-%{release} +Obsoletes: ansible-python3 < %{version}-%{release} +%endif + BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -160,6 +180,13 @@ BuildRequires: python3-setuptools BuildRequires: python3-PyYAML BuildRequires: python3-paramiko BuildRequires: python3-crypto +BuildRequires: python3-packaging + +# For Docs/tests +BuildRequires: git-core +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx-theme-alabaster +BuildRequires: asciidoc # accelerate is the only thing that makes keyczar mandatory. Since accelerate # is deprecated, just ignore it #BuildRequires: python-keyczar @@ -168,6 +195,7 @@ BuildRequires: python3-nose BuildRequires: python3-pytest BuildRequires: python3-pytest-xdist BuildRequires: python3-pytest-mock +BuildRequires: python3-requests BuildRequires: python3-coverage BuildRequires: python3-mock BuildRequires: python3-boto3 @@ -187,11 +215,13 @@ Requires: python3-jinja2 Requires: sshpass # needed for json_query filter Requires: python3-jmespath -%endif -%if 0%{?with_python3} +%if 0%{?with_python2} %description -n ansible-python3 +%else +%description +%endif Ansible is a radically simple model-driven configuration management, multi-node deployment, and remote task execution system. Ansible works @@ -200,7 +230,7 @@ on remote nodes. Extension modules can be written in any language and are transferred to managed machines automatically. This package installs versions of ansible that execute on Python3. -%endif # with_python3 +%endif # python3 %package -n ansible-doc Summary: Documentation for Ansible @@ -218,6 +248,10 @@ This package installs extensive documentation for ansible %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + %if 0%{?rhel} == 6 %patch100 -p1 %endif @@ -228,15 +262,25 @@ cp -a . %{py3dir} %endif # with_python3 %build +%if 0%{?with_python2} %{__python2} setup.py build -# Build docs -# EPEL6/7 don't have a recent enough sphinx to build the docs -%if %with_docs - make webdocs %endif %if 0%{?with_python3} +pushd %{py3dir} %py3_build + +%if %with_docs +# Fedora 26 does not have pathfix, so build docs with python2 +%if (0%{?fedora} == 26) + make PYTHON=/usr/bin/python2 webdocs +%else + pathfix.py -i %{__python3} -p docs/bin + make PYTHON=/usr/bin/python3 webdocs +%endif +%endif + +popd %endif # with_python3 @@ -248,23 +292,32 @@ popd for i in $RPM_BUILD_ROOT/%{_bindir}/ansible* ; do if [ $(basename $i) = "ansible-connection" -o $(basename $i) = "ansible" ] ; then - mv $i $i-%{python3_version} + %if 0%{?with_python2} + mv $i $i-%{python3_version} + %else + # for backwards compatibility + ln -s $(basename $i) $i-%{python3_version} + %endif ln -s %{_bindir}/$(basename $i)-%{python3_version} $i-3 + %if 0%{?with_python2} else # The ansible commands are themselves symlinks to /usr/bin/ansible. # Need to change them to point to the python3 version ln -s %{_bindir}/ansible-3 $i-%{python3_version} ln -s %{_bindir}/$(basename $i)-%{python3_version} $i-3 + %endif fi done %endif # with_python3 +%if 0%{?with_python2} %{__python2} setup.py install --root=$RPM_BUILD_ROOT for i in $RPM_BUILD_ROOT/%{_bindir}/{ansible,ansible-console,ansible-doc,ansible-galaxy,ansible-playbook,ansible-pull,ansible-vault} ; do mv $i $i-%{python2_version} ln -s %{_bindir}/$(basename $i)-%{python2_version} $i ln -s %{_bindir}/$(basename $i)-%{python2_version} $i-2 done +%endif mkdir -p $RPM_BUILD_ROOT/etc/ansible/ mkdir -p $RPM_BUILD_ROOT/etc/ansible/roles/ @@ -275,7 +328,9 @@ cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/ cp -pr docs/docsite/rst . %if %with_docs - cp -pr docs/docsite/_build/html . + pushd %{py3dir} + cp -pr docs/docsite/_build/html %{_builddir}/%{name}-%{version}/html + popd %endif @@ -283,53 +338,43 @@ cp -pr docs/docsite/rst . # RHEL <= 6 doesn't have a new enough python-mock to run the tests # Currently RHEL <= 7 doesn't have pytest-xdist or a new enough pytest # Fedora 25 doesn't have a new enough pytest -%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 -if test -z $(which pytest) ; then - mkdir tests_bin - pushd tests_bin - ln -s `which py.test` pytest - export PATH=$PATH:$(pwd) - popd -fi -make tests +%if 0%{?with_python2} && 0%{?fedora} >= 26 +ln -s /usr/bin/pytest bin/pytest +make PYTHON=/usr/bin/python2 tests +%endif # New enough Fedora with python2 %if 0%{?with_python3} pushd %{py3dir} -if test -z $(which pytest) ; then - mkdir tests_bin - pushd tests_bin - ln -s `which py.test` pytest - export PATH=$PATH:$(pwd) - popd -fi -make tests +ln -s /usr/bin/pytest-3 bin/pytest +make PYTHON=/usr/bin/python3 tests-py3 +popd %endif # python3 -%endif # New enough Fedora/RHEL -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(-,root,root) +%if 0%{?with_python2} %{python_sitelib}/ansible* +%endif %{_bindir}/ansible* -%if 0%{?with_python3} +%if 0%{?with_python3} && 0%{?with_python2} %exclude %{_bindir}/ansible*-3* -%endif # python3 +%endif # python3 and 2 %config(noreplace) %{_sysconfdir}/ansible/ -%doc README.md PKG-INFO COPYING CHANGELOG.md +%doc README.md PKG-INFO COPYING changelogs/CHANGELOG-v2.5.rst %doc %{_mandir}/man1/ansible* %if 0%{?with_python3} +%if 0%{?with_python2} %files -n ansible-python3 %defattr(-,root,root,-) -%{python3_sitelib}/ansible* -%{_bindir}/ansible*-3* %config(noreplace) %{_sysconfdir}/ansible/ -%doc README.md PKG-INFO COPYING CHANGELOG.md +%doc README.md PKG-INFO COPYING changelogs/CHANGELOG-v2.5.rst %doc %{_mandir}/man1/ansible* +%{_bindir}/ansible*-3* +%endif # python2 +%{python3_sitelib}/ansible* %endif # python3 %files -n ansible-doc @@ -339,6 +384,22 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Sat Mar 24 2018 Kevin Fenzi - 2.5.0-1 +- Update to 2.5.0. Fixes bug #1559852 +- Spec changes/improvements with tests, docs, and conditionals. + +* Fri Mar 16 2018 Miro HronĨok - 2.4.3.0-3 +- Don't build and ship Python 2 bits on EL > 7 and Fedora > 29 + +* Wed Feb 07 2018 Fedora Release Engineering - 2.4.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jan 31 2018 Kevin Fenzi - 2.4.3.0-1 +- Update to 2.4.3. See https://github.com/ansible/ansible/blob/stable-2.4/CHANGELOG.md for full changes. + +* Mon Jan 08 2018 Troy Dawson - 2.4.2.0-2 +- Update conditional + * Wed Nov 29 2017 Kevin Fenzi - 2.4.2.0-1 - Update to 2.4.2. See https://github.com/ansible/ansible/blob/stable-2.4/CHANGELOG.md for full changes. diff --git a/f237508caa6e99aafb8691b148b41371105d12e7.patch b/f237508caa6e99aafb8691b148b41371105d12e7.patch new file mode 100644 index 0000000..8293780 --- /dev/null +++ b/f237508caa6e99aafb8691b148b41371105d12e7.patch @@ -0,0 +1,41 @@ +From f237508caa6e99aafb8691b148b41371105d12e7 Mon Sep 17 00:00:00 2001 +From: Dag Wieers +Date: Thu, 22 Mar 2018 22:33:51 +0100 +Subject: [PATCH] Fix nested parameters in module docs (#37793) + +(cherry picked from commit 69c0f96112de16e45cd089d765d43c1573116d35) +--- + docs/templates/plugin.rst.j2 | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2 +index 84bc5a4f66c..106d82b64ff 100644 +--- a/docs/templates/plugin.rst.j2 ++++ b/docs/templates/plugin.rst.j2 +@@ -95,7 +95,7 @@ Parameters + +
+ {% for i in range(1, loop.depth) %} +-
++
 
+ {% endfor %} +
+ @{ key }@ +@@ -240,7 +240,7 @@ Facts returned by this module are added/updated in the ``hostvars`` host facts a + +
+ {% for i in range(1, loop.depth) %} +-
++
 
+ {% endfor %} +
+ @{ key }@ +@@ -304,7 +304,7 @@ Common return values are documented :ref:`here `, the foll + +
+ {% for i in range(1, loop.depth) %} +-
++
 
+
+ {% endfor %} +
diff --git a/sources b/sources index ce4adbf..d895de3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-2.4.2.0.tar.gz) = 32a075959dca01e184d9c3988fc9c491e904e7627a38e3527c37a8b26340f331bd294cacfe7353d339d15488857ba5ee1b36d9ae4ebeb8b5827934a73f4b42b0 +SHA512 (ansible-2.5.0.tar.gz) = 93dee0404c5de0a9c8c5b8987f1fb2dbacceb848e8d5b4c70c5a6692d6fe8e9d4bec67d592071346f458b46b9ed2d800609a080d7d4b16266943f32d56a19220