%global _empty_manifest_terminate_build 0 Name: python-ansible-cached-lookup Version: 1.0.0 Release: 1 Summary: An Ansible lookup plugin that caches the result of any other lookup License: MIT URL: https://pypi.org/project/ansible-cached-lookup/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b5/7c/19665493a4f7637a413ff15a1b981bbbd847886c168b6844d9cb0d96fe8d/ansible-cached-lookup-1.0.0.tar.gz BuildArch: noarch Requires: python3-ansible Requires: python3-diskcache %description # ansible-cached-lookup An Ansible lookup plugin that caches the results of any other lookup, most useful in group/host vars. By default, Ansible evaluates any lookups in a group/host var whenever the var is accessed. For example, given a group/host var: ```yaml content: "{{ lookup('pipe', 'a-very-slow-command' }}" ``` any tasks that access `content` (e.g. in a template) will re-evaluate the lookup, which adds up very quickly. See [ansible/ansible#9263](https://github.com/ansible/ansible/issues/9623). ## Installation 1. Pick a name that you want to use to call this plugin in Ansible playbooks. This documentation assumes you're using the name `cached`. ``` pip install ansible-cached-lookup ``` 2. Create a `lookup_plugins` directory in the directory in which you run Ansible. By default, Ansible will look for lookup plugins in an `lookup_plugins` folder adjacent to the running playbook. For more information on this, or to change the location where Ansible looks for lookup plugins, see the [Ansible docs](https://docs.ansible.com/ansible/dev_guide/developing_plugins.html#distributing-plugins). 3. Create a file called `cached.py` (or whatever name you picked) in the `lookup_plugins` directory, with one line: ```py from ansible_cached_lookup import LookupModule ``` ## Contributing To run the tests, run `tox`. To format code to pass `tox -e lint`, run `tox -e format`. %package -n python3-ansible-cached-lookup Summary: An Ansible lookup plugin that caches the result of any other lookup Provides: python-ansible-cached-lookup BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-ansible-cached-lookup # ansible-cached-lookup An Ansible lookup plugin that caches the results of any other lookup, most useful in group/host vars. By default, Ansible evaluates any lookups in a group/host var whenever the var is accessed. For example, given a group/host var: ```yaml content: "{{ lookup('pipe', 'a-very-slow-command' }}" ``` any tasks that access `content` (e.g. in a template) will re-evaluate the lookup, which adds up very quickly. See [ansible/ansible#9263](https://github.com/ansible/ansible/issues/9623). ## Installation 1. Pick a name that you want to use to call this plugin in Ansible playbooks. This documentation assumes you're using the name `cached`. ``` pip install ansible-cached-lookup ``` 2. Create a `lookup_plugins` directory in the directory in which you run Ansible. By default, Ansible will look for lookup plugins in an `lookup_plugins` folder adjacent to the running playbook. For more information on this, or to change the location where Ansible looks for lookup plugins, see the [Ansible docs](https://docs.ansible.com/ansible/dev_guide/developing_plugins.html#distributing-plugins). 3. Create a file called `cached.py` (or whatever name you picked) in the `lookup_plugins` directory, with one line: ```py from ansible_cached_lookup import LookupModule ``` ## Contributing To run the tests, run `tox`. To format code to pass `tox -e lint`, run `tox -e format`. %package help Summary: Development documents and examples for ansible-cached-lookup Provides: python3-ansible-cached-lookup-doc %description help # ansible-cached-lookup An Ansible lookup plugin that caches the results of any other lookup, most useful in group/host vars. By default, Ansible evaluates any lookups in a group/host var whenever the var is accessed. For example, given a group/host var: ```yaml content: "{{ lookup('pipe', 'a-very-slow-command' }}" ``` any tasks that access `content` (e.g. in a template) will re-evaluate the lookup, which adds up very quickly. See [ansible/ansible#9263](https://github.com/ansible/ansible/issues/9623). ## Installation 1. Pick a name that you want to use to call this plugin in Ansible playbooks. This documentation assumes you're using the name `cached`. ``` pip install ansible-cached-lookup ``` 2. Create a `lookup_plugins` directory in the directory in which you run Ansible. By default, Ansible will look for lookup plugins in an `lookup_plugins` folder adjacent to the running playbook. For more information on this, or to change the location where Ansible looks for lookup plugins, see the [Ansible docs](https://docs.ansible.com/ansible/dev_guide/developing_plugins.html#distributing-plugins). 3. Create a file called `cached.py` (or whatever name you picked) in the `lookup_plugins` directory, with one line: ```py from ansible_cached_lookup import LookupModule ``` ## Contributing To run the tests, run `tox`. To format code to pass `tox -e lint`, run `tox -e format`. %prep %autosetup -n ansible-cached-lookup-1.0.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-ansible-cached-lookup -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 1.0.0-1 - Package Spec generated