From deb612b013eef0080be403c8cec817688ef34b20 Mon Sep 17 00:00:00 2001 From: Joseph Benden Date: Mon, 27 Apr 2020 14:30:45 -0700 Subject: [PATCH] ansible: update to 2.9.7. Signed-off-by: Joseph Benden --- ...f5e4b300aa8ce6c88a967298fc26ee471e42.patch | 94 +++++++++++++++++++ srcpkgs/ansible/template | 6 +- 2 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/ansible/patches/e74cf5e4b300aa8ce6c88a967298fc26ee471e42.patch diff --git a/srcpkgs/ansible/patches/e74cf5e4b300aa8ce6c88a967298fc26ee471e42.patch b/srcpkgs/ansible/patches/e74cf5e4b300aa8ce6c88a967298fc26ee471e42.patch new file mode 100644 index 00000000000..8ce65ae9bd2 --- /dev/null +++ b/srcpkgs/ansible/patches/e74cf5e4b300aa8ce6c88a967298fc26ee471e42.patch @@ -0,0 +1,94 @@ +From e74cf5e4b300aa8ce6c88a967298fc26ee471e42 Mon Sep 17 00:00:00 2001 +From: Andrew Klaus +Date: Sun, 24 Nov 2019 21:15:15 -0700 +Subject: [PATCH] Fix: OpenBSD syspatch module bug (#57259) + +* Append is not a list + +* Adding new example. Renaming reboot var to match other modules + +* syspatch: Fixing if statement logic issue to properly compare integer + +* Syspatch: Using get_bin_path to find path. Revert to reboot_needed instead of reboot_required. + +* syspatch: Fix wording in playbook example +--- + lib/ansible/modules/system/syspatch.py | 28 +++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/lib/ansible/modules/system/syspatch.py b/lib/ansible/modules/system/syspatch.py +index 017cfbc7d603f..3c75f2f2c0b7c 100644 +--- a/lib/ansible/modules/system/syspatch.py ++++ b/lib/ansible/modules/system/syspatch.py +@@ -52,6 +52,16 @@ + - name: Revert all patches + syspatch: + revert: all ++ ++# NOTE: You can reboot automatically if a patch requires it: ++- name: Apply all patches and store result ++ syspatch: ++ apply: true ++ register: syspatch ++ ++- name: Reboot if patch requires it ++ reboot: ++ when: syspatch.reboot_needed + ''' + + RETURN = r''' +@@ -82,7 +92,7 @@ + def run_module(): + # define available arguments/parameters a user can pass to the module + module_args = dict( +- apply=dict(type='bool', default=False), ++ apply=dict(type='bool'), + revert=dict(type='str', choices=['all', 'one']) + ) + +@@ -98,7 +108,7 @@ def run_module(): + + + def syspatch_run(module): +- cmd = ['/usr/sbin/syspatch'] ++ cmd = module.get_bin_path('syspatch', True) + changed = False + reboot_needed = False + warnings = [] +@@ -116,7 +126,7 @@ def syspatch_run(module): + run_flag = [] + + # Run check command +- rc, out, err = module.run_command(cmd + check_flag) ++ rc, out, err = module.run_command([cmd] + check_flag) + + if rc != 0: + module.fail_json(msg="Command %s failed rc=%d, out=%s, err=%s" % (cmd, rc, out, err)) +@@ -131,21 +141,21 @@ def syspatch_run(module): + if module.check_mode: + changed = change_pending + elif change_pending: +- rc, out, err = module.run_command(cmd + run_flag) ++ rc, out, err = module.run_command([cmd] + run_flag) + + # Workaround syspatch ln bug: + # http://openbsd-archive.7691.n7.nabble.com/Warning-applying-latest-syspatch-td354250.html + if rc != 0 and err != 'ln: /usr/X11R6/bin/X: No such file or directory\n': + module.fail_json(msg="Command %s failed rc=%d, out=%s, err=%s" % (cmd, rc, out, err)) +- elif out.lower().find('create unique kernel'): ++ elif out.lower().find('create unique kernel') > 0: + # Kernel update applied + reboot_needed = True +- elif out.lower().find('syspatch updated itself'): +- warnings.append['Syspatch was updated. Please run syspatch again.'] ++ elif out.lower().find('syspatch updated itself') > 0: ++ warnings.append('Syspatch was updated. Please run syspatch again.') + + # If no stdout, then warn user +- if len(out) > 0: +- warnings.append['syspatch had suggested changes, but stdout was empty.'] ++ if len(out) == 0: ++ warnings.append('syspatch had suggested changes, but stdout was empty.') + + changed = True + else: diff --git a/srcpkgs/ansible/template b/srcpkgs/ansible/template index f29aca6789b..c34b6874426 100644 --- a/srcpkgs/ansible/template +++ b/srcpkgs/ansible/template @@ -1,10 +1,9 @@ # Template file for 'ansible' pkgname=ansible -version=2.9.3 +version=2.9.7 revision=1 archs=noarch build_style=python3-module -pycompile_module="ansible" hostmakedepends="python3-setuptools" depends="${hostmakedepends} python3-cryptography python3-Jinja2 python3-paramiko python3-yaml" @@ -14,7 +13,8 @@ maintainer="Michael Aldridge " license="GPL-3.0-or-later" homepage="https://www.ansible.com/" distfiles="https://releases.ansible.com/ansible/${pkgname}-${version}.tar.gz" -checksum=36f501a17fb15d210722b649d53582acf47835ea0bbda7eab79e13c945e4eac2 +checksum=7222ce925536a25b2912364e13b03a3e21dbf2f96799ebff304f48509324de7b +patch_args="-Np1" post_install() { vsconf examples/ansible.cfg