From b2b3c056ca70d61f394f7291b299701123ad8b7e Mon Sep 17 00:00:00 2001
From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com>
Date: Mon, 24 Oct 2022 20:59:45 +0200
Subject: [PATCH] clarify jc filter usage in the example (#5396) (#5419)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Update jc.py

##### SUMMARY
<!— Your description here –>

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update jc.py

* Update jc.py

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* change all of the tags to be FQMN

FQMN = fully qualified module name

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update jc.py

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update jc.py

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/filter/jc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 70c57dcb6afb02f48d57f558eb940df1ea6167b3)

Co-authored-by: Ron Green <11993626+georgettica@users.noreply.github.com>
---
 plugins/filter/jc.py | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/plugins/filter/jc.py b/plugins/filter/jc.py
index 094da26632..eb2d995d1e 100644
--- a/plugins/filter/jc.py
+++ b/plugins/filter/jc.py
@@ -51,10 +51,16 @@ DOCUMENTATION = '''
       type: boolean
       default: false
   requirements:
-    - jc (https://github.com/kellyjonbrazil/jc)
+    - jc installed as a Python library (U(https://pypi.org/project/jc/))
 '''
 
 EXAMPLES = '''
+- name: Install the prereqs of the jc filter (jc Python package) on the Ansible controller
+  delegate_to: localhost
+  ansible.builtin.pip:
+    name: jc
+    state: present
+
 - name: Run command
   ansible.builtin.command: uname -a
   register: result
@@ -107,15 +113,19 @@ def jc(data, parser, quiet=True, raw=False):
         dictionary or list of dictionaries
 
     Example:
-
         - name: run date command
           hosts: ubuntu
           tasks:
-          - shell: date
+          - name: install the prereqs of the jc filter (jc Python package) on the Ansible controller
+            delegate_to: localhost
+            ansible.builtin.pip:
+              name: jc
+              state: present
+          - ansible.builtin.shell: date
             register: result
-          - set_fact:
+          - ansible.builtin.set_fact:
               myvar: "{{ result.stdout | community.general.jc('date') }}"
-          - debug:
+          - ansible.builtin.debug:
               msg: "{{ myvar }}"
 
         produces:
@@ -137,7 +147,7 @@ def jc(data, parser, quiet=True, raw=False):
     """
 
     if not HAS_LIB:
-        raise AnsibleError('You need to install "jc" prior to running jc filter')
+        raise AnsibleError('You need to install "jc" as a Python library on the Ansible controller prior to running jc filter')
 
     try:
         jc_parser = importlib.import_module('jc.parsers.' + parser)