Index: sysutils/ansible29/Makefile =================================================================== --- sysutils/ansible29/Makefile (nonexistent) +++ sysutils/ansible29/Makefile (copie de travail) @@ -0,0 +1,127 @@ +# $FreeBSD$ + +PORTNAME= ansible +PORTVERSION?= 2.9.14 +PORTREVISION?= 0 +CATEGORIES= sysutils python +MASTER_SITES= http://releases.ansible.com/ansible/ +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +PKGNAMESUFFIX?= 29 + +MAINTAINER= lifanov@FreeBSD.org +COMMENT= Radically simple IT automation + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/COPYING + +RUN_DEPENDS?= ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}cryptography>0:security/py-cryptography@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}jmespath>0:devel/py-jmespath@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}netaddr>0:net/py-netaddr@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}paramiko>0:security/py-paramiko@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} +TEST_DEPENDS?= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-mock>0:devel/py-pytest-mock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}nose>0:devel/py-nose@${PY_FLAVOR} + +USES?= cpe python shebangfix +USE_PYTHON= distutils autoplist concurrent + +OPTIONS_DEFINE= DOCS EXAMPLES + +NO_ARCH= yes +CPE_VENDOR= ansibleworks + +CONFLICTS?= *ansible-2* \ + *ansible1-* \ + *ansible23-* \ + *ansible24-* \ + *ansible25-* \ + *ansible27-* \ + *ansible26-* \ + *ansible27-* \ + *ansible28-* + +EXTRA_PATCHES?= + +SHEBANG_FILES?= \ + test/lib/ansible_test/_data/injector/python.py \ + test/lib/ansible_test/_data/versions.py \ + test/lib/ansible_test/_data/virtualenvcheck.py \ + test/lib/ansible_test/_data/yamlcheck.py \ + test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py \ + test/lib/ansible_test/_data/sanity/import/importer.py \ + test/lib/ansible_test/_data/sanity/code-smell/metaclass-boilerplate.py \ + test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py \ + test/lib/ansible_test/_data/sanity/code-smell/use-argspec-type-path.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-dict-iterkeys.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-smart-quotes.py \ + test/lib/ansible_test/_data/sanity/code-smell/replace-urlopen.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-unicode-literals.py \ + test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-main-display.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-dict-itervalues.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-dict-iteritems.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-assert.py \ + test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py \ + test/lib/ansible_test/_data/sanity/code-smell/line-endings.py \ + test/lib/ansible_test/_data/sanity/code-smell/symlinks.py \ + test/lib/ansible_test/_data/sanity/code-smell/shebang.py \ + test/lib/ansible_test/_data/sanity/code-smell/empty-init.py \ + test/lib/ansible_test/_data/sanity/code-smell/no-basestring.py \ + test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py \ + test/lib/ansible_test/_data/sanity/compile/compile.py \ + test/lib/ansible_test/_data/sanity/validate-modules/main.py + +SUB_FILES= pkg-message +SUB_LIST+= PYTHON_CMD=${PYTHON_CMD} + +PLIST_FILES?= man/man1/ansible-config.1.gz \ + man/man1/ansible-console.1.gz \ + man/man1/ansible-doc.1.gz \ + man/man1/ansible-galaxy.1.gz \ + man/man1/ansible-inventory.1.gz \ + man/man1/ansible-playbook.1.gz \ + man/man1/ansible-pull.1.gz \ + man/man1/ansible-vault.1.gz \ + man/man1/ansible.1.gz + +PORTEXAMPLES= ansible.cfg hosts + +post-patch: + ${FIND} ${WRKSRC} -type f -print0 | ${XARGS} -0 ${REINPLACE_CMD} \ + -e 's|/etc/ansible|${ETCDIR:S/${PY_FLAVOR}-//}|g' \ + -e 's|/usr/share/ansible|${DATADIR}|g' + ${FIND} ${WRKSRC} -type f -name "*.bak" -delete + +post-install: + @${MKDIR} ${STAGEDIR}${MAN1PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/docs/man/man1/*.1 \ + ${STAGEDIR}${MAN1PREFIX}/man/man1 + +post-install-EXAMPLES-on: + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/examples/ansible.cfg ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/examples/hosts ${STAGEDIR}${EXAMPLESDIR} + +post-stage: + ${FIND} ${STAGEDIR}${PREFIX}/bin -type l -name ansible-\* -lname ansible \ + -execdir ${RLN} ansible-${PYTHON_VER} {} \; + # python autoplist doesn't add this file in plist + ${RM} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ansible_test/_data/injector/ansible-inventory + +# TEST_WRKSRC=${WRKSRC}/test +# +#do-test: +# ${PYTHON_CMD} ${TEST_WRKSRC}/runner/ansible-test sanity --python ${PYTHON_VER} -v +# ${RM} ${TEST_WRKSRC}/units/modules/net_tools/test_nmcli.py # not conditional/doesn't work with nose +# ${PYTHON_CMD} ${TEST_WRKSRC}/runner/ansible-test units --python ${PYTHON_VER} -v + +.include Property changes on: sysutils/ansible29/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: sysutils/ansible29/distinfo =================================================================== --- sysutils/ansible29/distinfo (nonexistent) +++ sysutils/ansible29/distinfo (copie de travail) @@ -0,0 +1,3 @@ +TIMESTAMP = 1603206359 +SHA256 (ansible-2.9.14.tar.gz) = efe7183e08f0c9dd9efd9124efa8978be62851b1e8eb856593a073538bfc6fb5 +SIZE (ansible-2.9.14.tar.gz) = 14272261 Property changes on: sysutils/ansible29/distinfo ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: sysutils/ansible29/files/extra-patch-27 =================================================================== --- sysutils/ansible29/files/extra-patch-27 (nonexistent) +++ sysutils/ansible29/files/extra-patch-27 (copie de travail) @@ -0,0 +1,84 @@ +--- lib/ansible/module_utils/facts/virtual/freebsd.py.orig 2020-04-17 14:07:09 UTC ++++ lib/ansible/module_utils/facts/virtual/freebsd.py +@@ -19,9 +19,11 @@ __metaclass__ = type + import os + + from ansible.module_utils.facts.virtual.base import Virtual, VirtualCollector ++# Rudimentary detection of the virtual platforms, more through version is coming. Catches VMWare at minimum. ++from ansible.module_utils.facts.virtual.sysctl import VirtualSysctlDetectionMixin + + +-class FreeBSDVirtual(Virtual): ++class FreeBSDVirtual(Virtual, VirtualSysctlDetectionMixin): + """ + This is a FreeBSD-specific subclass of Virtual. It defines + - virtualization_type +@@ -34,6 +36,9 @@ class FreeBSDVirtual(Virtual): + # Set empty values as default + virtual_facts['virtualization_type'] = '' + virtual_facts['virtualization_role'] = '' ++ ++ virtual_product_facts = self.detect_virt_product('hw.hv_vendor') ++ virtual_facts.update(virtual_product_facts) + + if os.path.exists('/dev/xen/xenstore'): + virtual_facts['virtualization_type'] = 'xen' +--- lib/ansible/modules/packaging/os/pkgng.py.orig 2020-04-17 14:07:10 UTC ++++ lib/ansible/modules/packaging/os/pkgng.py +@@ -201,13 +201,17 @@ def install_packages(module, pkgng_path, packages, cac + + # This environment variable skips mid-install prompts, + # setting them to their default values. +- batch_var = 'env BATCH=yes' ++ # There is at least one case, when upgrading from 11.1 to 11.2 when pkg asks extra ++ # question about OS version mismatch in the repository. As this isn't handled, playbook ++ # hangs forever. Adding ASSUME_ALWAYS_YES to the environment addresses that, and ++ # possibly other potential issues. ++ batch_var = 'env BATCH=yes ASSUME_ALWAYS_YES=yes' + + if not module.check_mode and not cached: + if old_pkgng: +- rc, out, err = module.run_command("%s %s update" % (pkgsite, pkgng_path)) ++ rc, out, err = module.run_command("%s %s %s update" % (batch_var, pkgsite, pkgng_path)) + else: +- rc, out, err = module.run_command("%s %s update" % (pkgng_path, dir_arg)) ++ rc, out, err = module.run_command("%s %s %s update" % (batch_var, pkgng_path, dir_arg)) + if rc != 0: + module.fail_json(msg="Could not update catalogue") + +--- lib/ansible/modules/storage/zfs/zfs.py.orig 2020-04-17 14:07:11 UTC ++++ lib/ansible/modules/storage/zfs/zfs.py +@@ -102,7 +102,15 @@ class Zfs(object): + self.changed = False + self.zfs_cmd = module.get_bin_path('zfs', True) + self.zpool_cmd = module.get_bin_path('zpool', True) +- self.pool = name.split('/')[0] ++ # - name: Create a new file system by cloning a snapshot ++ # zfs: ++ # name: rpool/cloned_fs ++ # state: present ++ # origin: rpool@mysnapshot ++ # ++ # doesn't work properly, as code assumes that there is at least one level of hierarchy ++ # in zpool. But that's not always the case - pool may be dataset as well and have a snapshot. ++ self.pool = name.split('@')[0].split('/')[0] + self.is_solaris = os.uname()[0] == 'SunOS' + self.is_openzfs = self.check_openzfs() + self.enhanced_sharing = self.check_enhanced_sharing() +--- lib/ansible/playbook/play_context.py.orig 2020-04-17 14:07:10 UTC ++++ lib/ansible/playbook/play_context.py +@@ -528,8 +528,13 @@ class PlayContext(Base): + becomecmd = cmd + + elif self.become_method == 'doas': ++ # `doas` support in ansible is broken ATM, doesn't handle password ++ # authentication properly, cause assumes only challenge-respond auth. ++ # This patch should handle both ways properly. ++ def detect_doas_prompt(b_data): ++ return re.match(b"[Pp]assword:", b_data) + +- prompt = 'doas (%s@' % self.remote_user ++ prompt = detect_doas_prompt + exe = self.become_exe or 'doas' + + if not self.become_pass: Property changes on: sysutils/ansible29/files/extra-patch-27 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: sysutils/ansible29/files/extra-patch-sesu =================================================================== --- sysutils/ansible29/files/extra-patch-sesu (nonexistent) +++ sysutils/ansible29/files/extra-patch-sesu (copie de travail) @@ -0,0 +1,59 @@ +--- lib/ansible/constants.py.orig 2018-06-28 23:30:34 UTC ++++ lib/ansible/constants.py +@@ -59,8 +59,9 @@ def set_constant(name, value, export=var + + + # CONSTANTS ### yes, actual ones +-BECOME_METHODS = ['sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun', 'enable', 'machinectl'] ++BECOME_METHODS = ['sesu', 'sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun', 'enable', 'machinectl'] + BECOME_ERROR_STRINGS = { ++ 'sesu': '', + 'sudo': 'Sorry, try again.', + 'su': 'Authentication failure', + 'pbrun': '', +@@ -73,6 +74,7 @@ BECOME_ERROR_STRINGS = { + 'machinectl': '', + } # FIXME: deal with i18n + BECOME_MISSING_STRINGS = { ++ 'sesu': '', + 'sudo': 'sorry, a password is required to run sudo', + 'su': '', + 'pbrun': '', +--- lib/ansible/modules/commands/command.py.orig 2018-06-28 23:30:34 UTC ++++ lib/ansible/modules/commands/command.py +@@ -142,7 +142,7 @@ def check_command(module, commandline): + 'mount': 'mount', 'rpm': 'yum, dnf or zypper', 'yum': 'yum', 'apt-get': 'apt', + 'tar': 'unarchive', 'unzip': 'unarchive', 'sed': 'replace, lineinfile or template', + 'dnf': 'dnf', 'zypper': 'zypper'} +- become = ['sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun', 'machinectl'] ++ become = ['sesu', 'sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun', 'machinectl'] + if isinstance(commandline, list): + command = commandline[0] + else: +--- lib/ansible/modules/web_infrastructure/ansible_tower/tower_credential.py.orig 2018-06-28 23:30:34 UTC ++++ lib/ansible/modules/web_infrastructure/ansible_tower/tower_credential.py +@@ -96,7 +96,7 @@ options: + become_method: + description: + - Become method to Use for privledge escalation. +- choices: ["None", "sudo", "su", "pbrun", "pfexec", "pmrun"] ++ choices: ["None", "sesu", "sudo", "su", "pbrun", "pfexec", "pmrun"] + become_username: + description: + - Become username. Use ASK for prompting. +--- lib/ansible/playbook/play_context.py.orig 2018-06-28 23:30:34 UTC ++++ lib/ansible/playbook/play_context.py +@@ -562,6 +562,13 @@ class PlayContext(Base): + exe = self.become_exe or 'machinectl' + becomecmd = '%s shell -q %s %s@ %s' % (exe, flags, self.become_user, command) + ++ elif self.become_method == 'sesu': ++ ++ exe = self.become_exe or 'sesu' ++ ++ prompt = 'Please enter your password:' ++ becomecmd = '%s %s %s -c %s' % (exe, flags, self.become_user, shlex_quote(command)) ++ + else: + raise AnsibleError("Privilege escalation method not found: %s" % self.become_method) + Property changes on: sysutils/ansible29/files/extra-patch-sesu ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: sysutils/ansible29/files/pkg-message.in =================================================================== --- sysutils/ansible29/files/pkg-message.in (nonexistent) +++ sysutils/ansible29/files/pkg-message.in (copie de travail) @@ -0,0 +1,30 @@ +[ +{ +message: <