X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id ACE3ADC24E0 for ; Thu, 4 Feb 2016 01:36:01 +0000 (UTC) Received: from lithium.8pit.net (lithium.8pit.net [81.4.121.103]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 0E3CEDC090A; Thu, 4 Feb 2016 01:36:00 +0000 (UTC) Received: from localhost (ip5f5aca3f.dynamic.kabel-deutschland.de [95.90.202.63]) by lithium.8pit.net (OpenSMTPD) with ESMTPSA id 7d2937c1 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 4 Feb 2016 02:35:58 +0100 (CET) From: =?UTF-8?q?S=C3=B6ren=20Tempel?= To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH] main/ansible: backport play iteration context patch Date: Thu, 4 Feb 2016 02:35:54 +0100 Message-Id: <1454549754-24144-1-git-send-email-soeren+git@soeren-tempel.net> X-Mailer: git-send-email 2.7.0 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: The patch is already included upstream, but upstream didn't make a new stable release yet and since this bug is pretty annoying I suggest that we include this patch until upstream makes a new stable release. See: https://github.com/ansible/ansible/pull/13793 --- main/ansible/APKBUILD | 24 +++++++++++++++++++----- main/ansible/iteration-context.patch | 13 +++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 main/ansible/iteration-context.patch diff --git a/main/ansible/APKBUILD b/main/ansible/APKBUILD index 00afea0..517a405 100644 --- a/main/ansible/APKBUILD +++ b/main/ansible/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Fabian Affolter pkgname=ansible pkgver=2.0.0.2 -pkgrel=0 +pkgrel=1 pkgdesc="A configuration-management, deployment, task-execution, and multinode orchestration framework" url="http://ansible.com" arch="noarch" @@ -10,9 +10,20 @@ license="GPL3+" depends="python py-yaml py-paramiko py-jinja2 py-markupsafe" makedepends="python-dev py-setuptools" subpackages="$pkgname-doc" -source="$pkgname-$pkgver.tar.gz::http://releases.ansible.com/ansible/$pkgname-$pkgver.tar.gz" +source="$pkgname-$pkgver.tar.gz::http://releases.ansible.com/ansible/$pkgname-$pkgver.tar.gz + iteration-context.patch" _builddir="$srcdir"/$pkgname-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + build() { cd "$_builddir" python setup.py build || return 1 @@ -38,6 +49,9 @@ package() { "$pkgdir"/usr/share/doc/$pkgname/README.extras.md || return 1 } -md5sums="816d0c49e084383e47a725c761a0e413 ansible-2.0.0.2.tar.gz" -sha256sums="27db0b99113fab85b1430c361c7790a0aa7f5c614c9af13362e2adbba07e5828 ansible-2.0.0.2.tar.gz" -sha512sums="bf034384849d3f065ff77982e2e47a94727fc2982f0dac8d67efda2646dcdbd52ba9cc3ddfcdb9cd8210af0935f6f42946cc8ddc659d62cccd670e5d55c7dfa0 ansible-2.0.0.2.tar.gz" +md5sums="816d0c49e084383e47a725c761a0e413 ansible-2.0.0.2.tar.gz +e745fcea8520d23386d238d249742741 iteration-context.patch" +sha256sums="27db0b99113fab85b1430c361c7790a0aa7f5c614c9af13362e2adbba07e5828 ansible-2.0.0.2.tar.gz +bc11f3095ea9b00e2855a6969bce3764137f54114f979e519e299a5584dfde62 iteration-context.patch" +sha512sums="bf034384849d3f065ff77982e2e47a94727fc2982f0dac8d67efda2646dcdbd52ba9cc3ddfcdb9cd8210af0935f6f42946cc8ddc659d62cccd670e5d55c7dfa0 ansible-2.0.0.2.tar.gz +30cc45a485a1048b3e86dea8fc30b65095326e79c0b16ab4d9ab0c8362ec3cefe352500b215858c2b150b2d9a288d3e9bca05c1354969bb16ade2ad123b3df83 iteration-context.patch" diff --git a/main/ansible/iteration-context.patch b/main/ansible/iteration-context.patch new file mode 100644 index 0000000..db2ed31 --- /dev/null +++ b/main/ansible/iteration-context.patch @@ -0,0 +1,13 @@ +diff -upr ansible-2.0.0.2.orig/lib/ansible/executor/task_executor.py ansible-2.0.0.2/lib/ansible/executor/task_executor.py +--- ansible-2.0.0.2.orig/lib/ansible/executor/task_executor.py 2016-02-04 00:51:21.944735819 +0100 ++++ ansible-2.0.0.2/lib/ansible/executor/task_executor.py 2016-02-04 00:52:26.688134310 +0100 +@@ -365,6 +365,9 @@ class TaskExecutor: + if not self._connection or not getattr(self._connection, 'connected', False): + self._connection = self._get_connection(variables=variables, templar=templar) + self._connection.set_host_overrides(host=self._host) ++ # If connection is reused, its _play_context is no longer valid and needs to be replaced ++ # This fixes issues with tasks running sudo in a loop and having the success_key incorrect in the second iteration ++ self._connection._play_context = self._play_context + + self._handler = self._get_action_handler(connection=self._connection, templar=templar) + -- 2.7.0 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---