Repository: ansible/ansible-navigator (language: python)

Issue:
Add `settings --sample`
This add the ability to produce a sample settings file for the user.

`ansible-navigator settings --sample`

The switch to use it in the docs will happen in a future PR.



Discussion / hints:

Fix patch:
diff --git a/docs/changelog-fragments.d/1110.feature.md b/docs/changelog-fragments.d/1110.feature.md
new file mode 100644
index 000000000..a06e3e2ce
--- /dev/null
+++ b/docs/changelog-fragments.d/1110.feature.md
@@ -0,0 +1,3 @@
+Added basic support for mode `stdout` for the `images` subcommand.
+
+-- by {user}`cidrblock`
diff --git a/src/ansible_navigator/actions/images.py b/src/ansible_navigator/actions/images.py
index 0573dd03f..37754f594 100644
--- a/src/ansible_navigator/actions/images.py
+++ b/src/ansible_navigator/actions/images.py
@@ -11,8 +11,11 @@
 from typing import Tuple
 
 from ..action_base import ActionBase
+from ..action_defs import RunStdoutReturn
 from ..app_public import AppPublic
 from ..configuration_subsystem import ApplicationConfiguration
+from ..content_defs import ContentView
+from ..content_defs import SerializationFormat
 from ..image_manager import inspect_all
 from ..runner import Command
 from ..steps import Step
@@ -22,6 +25,7 @@
 from ..ui_framework import Interaction
 from ..ui_framework import nonblocking_notification
 from ..ui_framework import warning_notification
+from ..utils.serialize import serialize
 from . import _actions as actions
 from . import run_action
 
@@ -121,6 +125,32 @@ def generate_content_heading(self, obj: Dict, screen_w: int, name: str = "") ->
         )
         return CursesLines((CursesLine((line_part,)),))
 
+    def run_stdout(self) -> RunStdoutReturn:
+        """Handle settings in mode stdout.
+
+        :returns: RunStdoutReturn
+        """
+        self._logger.debug("images requested in stdout mode")
+        self._collect_image_list()
+        if not self._images.value:
+            msg = "No images were found, or the configured container engine was not available."
+            return RunStdoutReturn(message=msg, return_code=1)
+        filtered = []
+        for image in self._images.value:
+            if image["execution_environment"] is False:
+                continue
+            image["name_tag"] = image["__name_tag"]
+            image["full_name"] = image["__full_name"]
+            filtered.append(filter_content_keys(image))
+        print(
+            serialize(
+                content=filtered,
+                content_view=ContentView.NORMAL,
+                serialization_format=SerializationFormat.YAML,
+            ),
+        )
+        return RunStdoutReturn(message="", return_code=0)
+
     def run(self, interaction: Interaction, app: AppPublic) -> Optional[Interaction]:
         """Execute the ``images`` request for mode interactive.
 


Test patch:
diff --git a/tests/fixtures/integration/actions/images/test_stdout_tmux.py/test/0.json b/tests/fixtures/integration/actions/images/test_stdout_tmux.py/test/0.json
new file mode 100644
index 000000000..ae500afae
--- /dev/null
+++ b/tests/fixtures/integration/actions/images/test_stdout_tmux.py/test/0.json
@@ -0,0 +1,22 @@
+{
+    "name": "test[print image to stdout  clear && ansible-navigator images --ee True --ll debug --mode stdout  | grep creator]",
+    "index": 0,
+    "comment": "print image to stdout",
+    "additional_information": {
+        "present": [
+            "repository: quay.io/ansible/creator-ee"
+        ],
+        "absent": [],
+        "compared_fixture": false
+    },
+    "output": [
+        "  full_name: quay.io/ansible/creator-ee:v0.2.0",
+        "      - quay.io/ansible/creator-ee:v0.2.0",
+        "      - quay.io/ansible/creator-ee@sha256:2a20360ae5ee0c6a45d248babdeba3a1268ff7ffbc24ce22a76c8e1574ebcd49",
+        "      - quay.io/ansible/creator-ee:v0.2.0",
+        "  name: creator-ee",
+        "  name_tag: creator-ee:v0.2.0 (primary)",
+        "  repository: quay.io/ansible/creator-ee",
+        "(venv) bash-5.1$"
+    ]
+}
diff --git a/tests/integration/_interactions.py b/tests/integration/_interactions.py
index a723d51b7..c4e4f9005 100644
--- a/tests/integration/_interactions.py
+++ b/tests/integration/_interactions.py
@@ -72,6 +72,10 @@ class UiTestStep(NamedTuple):
     #: Find this before returning from the tmux session to the test
     search_within_response: Union[SearchFor, str, List] = SearchFor.HELP
 
+    def __str__(self):
+        """Produce a test id for this step."""
+        return f"{self.comment}  {self.user_input}"
+
 
 def add_indices(steps):
     """update the index of each"""
diff --git a/tests/integration/actions/images/test_stdout_tmux.py b/tests/integration/actions/images/test_stdout_tmux.py
new file mode 100644
index 000000000..ee7c4999f
--- /dev/null
+++ b/tests/integration/actions/images/test_stdout_tmux.py
@@ -0,0 +1,44 @@
+"""Tests for ``images`` from CLI, stdout."""
+import pytest
+
+from ..._interactions import Command
+from ..._interactions import SearchFor
+from ..._interactions import UiTestStep
+from ..._interactions import add_indices
+from .base import BaseClass
+
+
+class StdoutCommand(Command):
+    """Stdout command."""
+
+    subcommand = "images"
+    preclear = True
+
+
+class ShellCommand(UiTestStep):
+    """A shell command."""
+
+    search_within_response = SearchFor.PROMPT
+
+
+stdout_tests = (
+    ShellCommand(
+        comment="print image to stdout",
+        user_input=StdoutCommand(
+            cmdline="",
+            mode="stdout",
+            execution_environment=True,
+            raw_append=" | grep creator",
+        ).join(),
+        present=["repository: quay.io/ansible/creator-ee"],
+    ),
+)
+
+steps = add_indices(stdout_tests)
+
+
+@pytest.mark.parametrize("step", steps, ids=str)
+class Test(BaseClass):
+    """Run the tests for ``images`` from CLI, mode stdout."""
+
+    UPDATE_FIXTURES = False