diff --git a/src/ansible_navigator/actions/collections.py b/src/ansible_navigator/actions/collections.py index b6683587d..c407ddcb4 100644 --- a/src/ansible_navigator/actions/collections.py +++ b/src/ansible_navigator/actions/collections.py @@ -207,7 +207,7 @@ def run_stdout(self) -> RunStdoutReturn: print_to_stdout( content=collections_info, - content_format=ContentFormat.YAML, + content_format=getattr(ContentFormat, self._args.format.upper()), use_color=self._args.display_color, ) return RunStdoutReturn(message="", return_code=0) diff --git a/src/ansible_navigator/configuration_subsystem/navigator_configuration.py b/src/ansible_navigator/configuration_subsystem/navigator_configuration.py index 56ea7c0fb..ec58a2f39 100644 --- a/src/ansible_navigator/configuration_subsystem/navigator_configuration.py +++ b/src/ansible_navigator/configuration_subsystem/navigator_configuration.py @@ -383,6 +383,15 @@ class Internals: value=SettingsEntryValue(), version_added="v1.0", ), + SettingsEntry( + name="format", + choices=["json", "yaml"], + cli_parameters=CliParameters(short="--fmt"), + short_description="Specify the format for stdout output.", + subcommands=["collections"], + value=SettingsEntryValue(default="yaml"), + version_added="v2.3", + ), SettingsEntry( name="help_builder", choices=[True, False], diff --git a/src/ansible_navigator/data/settings-sample.template.yml b/src/ansible_navigator/data/settings-sample.template.yml index f0a56d3d0..4a085ec4f 100644 --- a/src/ansible_navigator/data/settings-sample.template.yml +++ b/src/ansible_navigator/data/settings-sample.template.yml @@ -103,12 +103,14 @@ ansible-navigator: - src: "/tmp/directory" dest: "/tmp/directory" options: "Z" - # {{ inventory-columns }} + # {{ format }} + format: json images: # {{ images.details }} details: - ansible_collections - ansible_version + # {{ inventory-columns }} inventory-columns: - ansible_network_os - ansible_network_cli_ssh_type diff --git a/src/ansible_navigator/data/settings-schema.partial.json b/src/ansible_navigator/data/settings-schema.partial.json index 5609966d2..9e5dadb02 100644 --- a/src/ansible_navigator/data/settings-schema.partial.json +++ b/src/ansible_navigator/data/settings-schema.partial.json @@ -221,6 +221,9 @@ }, "type": "object" }, + "format": { + "type": "string" + }, "images": { "additionalProperties": false, "properties": { diff --git a/tests/fixtures/integration/actions/collections/test_stdout_tmux.py/test/2.json b/tests/fixtures/integration/actions/collections/test_stdout_tmux.py/test/2.json new file mode 100644 index 000000000..42063746b --- /dev/null +++ b/tests/fixtures/integration/actions/collections/test_stdout_tmux.py/test/2.json @@ -0,0 +1,611 @@ +{ + "name": "test[collections json output ansible-navigator collections --ee False --ll debug --mode stdout --format json]", + "index": 2, + "comment": "collections json output", + "additional_information": { + "present": [ + "\"name\": \"coll_2\"" + ], + "absent": [], + "compared_fixture": false + }, + "output": [ + " \"full_name\": \"ansible.builtin.url\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/lookup/url.py\",", + " \"short_description\": \"return contents from URL\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.varnames\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/lookup/varnames.py\",", + " \"short_description\": \"Lookup matching variable names\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.vars\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/lookup/vars.py\",", + " \"short_description\": \"Lookup templated value of variables\"", + " }", + " ],", + " \"module\": [", + " {", + " \"full_name\": \"ansible.builtin.include\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/_include.py\",", + " \"short_description\": \"Include a task list\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.add_host\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/add_host.py\",", + " \"short_description\": \"Add a host (and alternatively a group) to the ansible-playbook in-memory inventory\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.apt\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/apt.py\",", + " \"short_description\": \"Manages apt-packages\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.apt_key\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/apt_key.py\",", + " \"short_description\": \"Add or remove an apt key\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.apt_repository\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/apt_repository.py\",", + " \"short_description\": \"Add and remove APT repositories\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.assemble\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/assemble.py\",", + " \"short_description\": \"Assemble configuration files from fragments\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.assert\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/assert.py\",", + " \"short_description\": \"Asserts given expressions are true\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.async_status\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/async_status.py\",", + " \"short_description\": \"Obtain status of asynchronous task\"", + " },", + " {", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/async_wrapper.py\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.blockinfile\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/blockinfile.py\",", + " \"short_description\": \"Insert/update/remove a text block surrounded by marker lines\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.command\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/command.py\",", + " \"short_description\": \"Execute commands on targets\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.copy\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/copy.py\",", + " \"short_description\": \"Copy files to remote locations\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.cron\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/cron.py\",", + " \"short_description\": \"Manage cron.d and crontab entries\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.debconf\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/debconf.py\",", + " \"short_description\": \"Configure a .deb package\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.debug\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/debug.py\",", + " \"short_description\": \"Print statements during execution\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.dnf\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/dnf.py\",", + " \"short_description\": \"Manages packages with the I(dnf) package manager\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.dpkg_selections\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/dpkg_selections.py\",", + " \"short_description\": \"Dpkg package selection selections\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.expect\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/expect.py\",", + " \"short_description\": \"Executes a command and responds to prompts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.fail\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/fail.py\",", + " \"short_description\": \"Fail with custom message\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.fetch\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/fetch.py\",", + " \"short_description\": \"Fetch files from remote nodes\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.file\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/file.py\",", + " \"short_description\": \"Manage files and file properties\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.find\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/find.py\",", + " \"short_description\": \"Return a list of files based on specific criteria\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.gather_facts\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/gather_facts.py\",", + " \"short_description\": \"Gathers facts about remote hosts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.get_url\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/get_url.py\",", + " \"short_description\": \"Downloads files from HTTP, HTTPS, or FTP to node\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.getent\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/getent.py\",", + " \"short_description\": \"A wrapper to the unix getent utility\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.git\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/git.py\",", + " \"short_description\": \"Deploy software (or files) from git checkouts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.group\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/group.py\",", + " \"short_description\": \"Add or remove groups\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.group_by\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/group_by.py\",", + " \"short_description\": \"Create Ansible groups based on facts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.hostname\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/hostname.py\",", + " \"short_description\": \"Manage hostname\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.import_playbook\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/import_playbook.py\",", + " \"short_description\": \"Import a playbook\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.import_role\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/import_role.py\",", + " \"short_description\": \"Import a role into a play\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.import_tasks\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/import_tasks.py\",", + " \"short_description\": \"Import a task list\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.include_role\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/include_role.py\",", + " \"short_description\": \"Load and execute a role\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.include_tasks\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/include_tasks.py\",", + " \"short_description\": \"Dynamically include a task list\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.include_vars\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/include_vars.py\",", + " \"short_description\": \"Load variables from files, dynamically within a task\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.iptables\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/iptables.py\",", + " \"short_description\": \"Modify iptables rules\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.known_hosts\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/known_hosts.py\",", + " \"short_description\": \"Add or remove a host from the C(known_hosts) file\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.lineinfile\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/lineinfile.py\",", + " \"short_description\": \"Manage lines in text files\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.meta\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/meta.py\",", + " \"short_description\": \"Execute Ansible 'actions'\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.package\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/package.py\",", + " \"short_description\": \"Generic OS package manager\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.package_facts\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/package_facts.py\",", + " \"short_description\": \"Package information as facts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.pause\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/pause.py\",", + " \"short_description\": \"Pause playbook execution\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.ping\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/ping.py\",", + " \"short_description\": \"Try to connect to host, verify a usable python and return C(pong) on success\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.pip\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/pip.py\",", + " \"short_description\": \"Manages Python library dependencies\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.raw\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/raw.py\",", + " \"short_description\": \"Executes a low-down and dirty command\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.reboot\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/reboot.py\",", + " \"short_description\": \"Reboot a machine\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.replace\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/replace.py\",", + " \"short_description\": \"Replace all instances of a particular string in a file using a back-referenced regular expression\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.rpm_key\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/rpm_key.py\",", + " \"short_description\": \"Adds or removes a gpg key from the rpm db\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.script\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/script.py\",", + " \"short_description\": \"Runs a local script on a remote node after transferring it\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.service\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/service.py\",", + " \"short_description\": \"Manage services\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.service_facts\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/service_facts.py\",", + " \"short_description\": \"Return service state information as fact data\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.set_fact\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/set_fact.py\",", + " \"short_description\": \"Set host variable(s) and fact(s).\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.set_stats\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/set_stats.py\",", + " \"short_description\": \"Define and display stats for the current ansible run\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.setup\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/setup.py\",", + " \"short_description\": \"Gathers facts about remote hosts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.shell\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/shell.py\",", + " \"short_description\": \"Execute shell commands on targets\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.slurp\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/slurp.py\",", + " \"short_description\": \"Slurps a file from remote nodes\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.stat\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/stat.py\",", + " \"short_description\": \"Retrieve file or file system status\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.subversion\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/subversion.py\",", + " \"short_description\": \"Deploys a subversion repository\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.systemd\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/systemd.py\",", + " \"short_description\": \"Manage systemd units\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.sysvinit\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/sysvinit.py\",", + " \"short_description\": \"Manage SysV services.\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.tempfile\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/tempfile.py\",", + " \"short_description\": \"Creates temporary files and directories\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.template\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/template.py\",", + " \"short_description\": \"Template a file out to a target host\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.unarchive\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/unarchive.py\",", + " \"short_description\": \"Unpacks an archive after (optionally) copying it from the local machine\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.uri\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/uri.py\",", + " \"short_description\": \"Interacts with webservices\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.user\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/user.py\",", + " \"short_description\": \"Manage user accounts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.validate_argument_spec\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/validate_argument_spec.py\",", + " \"short_description\": \"Validate role argument specs.\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.wait_for\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/wait_for.py\",", + " \"short_description\": \"Waits for a condition before continuing\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.wait_for_connection\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/wait_for_connection.py\",", + " \"short_description\": \"Waits until remote system is reachable/usable\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.yum\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/yum.py\",", + " \"short_description\": \"Manages packages with the I(yum) package manager\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.yum_repository\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/modules/yum_repository.py\",", + " \"short_description\": \"Add or remove YUM repositories\"", + " }", + " ],", + " \"shell\": [", + " {", + " \"full_name\": \"ansible.builtin.cmd\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/shell/cmd.py\",", + " \"short_description\": \"Windows Command Prompt\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.powershell\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/shell/powershell.py\",", + " \"short_description\": \"Windows PowerShell\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.sh\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/shell/sh.py\",", + " \"short_description\": \"POSIX shell (/bin/sh)\"", + " }", + " ],", + " \"strategy\": [", + " {", + " \"full_name\": \"ansible.builtin.debug\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/strategy/debug.py\",", + " \"short_description\": \"Executes tasks in interactive debug session.\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.free\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/strategy/free.py\",", + " \"short_description\": \"Executes tasks without waiting for all hosts\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.host_pinned\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/strategy/host_pinned.py\",", + " \"short_description\": \"Executes tasks on each host without interruption\"", + " },", + " {", + " \"full_name\": \"ansible.builtin.linear\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/strategy/linear.py\",", + " \"short_description\": \"Executes tasks in a linear fashion\"", + " }", + " ],", + " \"test\": [", + " {", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/test/core.py\"", + " },", + " {", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/test/files.py\"", + " },", + " {", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/test/mathstuff.py\"", + " }", + " ],", + " \"vars\": [", + " {", + " \"full_name\": \"ansible.builtin.host_group_vars\",", + " \"path\": \"/home/user/github/ansible-navigator/venv/lib64/python3.XX/site-packages/ansible/plugins/vars/host_group_vars.py\",", + " \"short_description\": \"In charge of loading group_vars and host_vars\"", + " }", + " ]", + " },", + " \"roles\": [],", + " \"shadowed\": false,", + " \"version\": \"2.13.4\"", + " },", + " {", + " \"collection_info\": {", + " \"authors\": [", + " \"Ansible team (ansible-navigator)\"", + " ],", + " \"license_file\": \"LICENSE\",", + " \"name\": \"coll_1\",", + " \"namespace\": \"company_name\",", + " \"readme\": \"README.md\",", + " \"version\": \"1.0.0\"", + " },", + " \"hidden_by\": [],", + " \"known_as\": \"company_name.coll_1\",", + " \"name\": \"company_name.coll_1\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1\",", + " \"plugins\": {", + " \"lookup\": [", + " {", + " \"full_name\": \"company_name.coll_1.lookup_1\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/plugins/lookup/lookup_1.py\",", + " \"short_description\": \"This is test lookup plugin\"", + " }", + " ],", + " \"module\": [", + " {", + " \"full_name\": \"company_name.coll_1.mod_1\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/plugins/modules/mod_1.py\",", + " \"short_description\": \"This is a test module\"", + " }", + " ]", + " },", + " \"roles\": [", + " {", + " \"argument_specs\": {},", + " \"argument_specs_path\": \"\",", + " \"defaults\": {},", + " \"defaults_path\": \"\",", + " \"full_name\": \"company_name.coll_1.role_minimum\",", + " \"info\": {", + " \"dependencies\": [],", + " \"galaxy_info\": {", + " \"author\": \"Ansible team (ansible-navigator)\",", + " \"company\": \"Ansible\",", + " \"description\": \"Minimal sample role.\",", + " \"galaxy_tags\": [", + " \"tag_1\",", + " \"tag_2\"", + " ],", + " \"license\": \"LICENSE\",", + " \"min_ansible_version\": \"2.9.0\",", + " \"platforms\": [", + " {", + " \"name\": \"eos\",", + " \"versions\": [", + " \"all\"", + " ]", + " }", + " ]", + " }", + " },", + " \"info_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_minimum/meta/main.yml\",", + " \"readme_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_minimum/README.md\",", + " \"short_name\": \"role_minimum\"", + " },", + " {", + " \"argument_specs\": {", + " \"alternate\": {", + " \"options\": {", + " \"role_full_int\": {", + " \"default\": 1024,", + " \"description\": \"The integer value, defaulting to 1024.\",", + " \"required\": false,", + " \"type\": \"int\"", + " }", + " },", + " \"short_description\": \"The alternate entry point for the role_full role.\"", + " },", + " \"main\": {", + " \"options\": {", + " \"role_full_int\": {", + " \"default\": 42,", + " \"description\": \"The integer value, defaulting to 42.\",", + " \"required\": false,", + " \"type\": \"int\"", + " },", + " \"role_full_str\": {", + " \"description\": \"The string value\",", + " \"required\": true,", + " \"type\": \"str\"", + " }", + " },", + " \"short_description\": \"The main entry point for the role_full role.\"", + " }", + " },", + " \"argument_specs_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_full/meta/argument_specs.yml\",", + " \"defaults\": {", + " \"role_full_bool\": true,", + " \"role_full_int\": 42,", + " \"role_full_str\": \"Test string\"", + " },", + " \"defaults_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_full/defaults/main.yml\",", + " \"full_name\": \"company_name.coll_1.role_full\",", + " \"info\": {", + " \"dependencies\": [],", + " \"galaxy_info\": {", + " \"author\": \"Ansible team (ansible-navigator)\",", + " \"company\": \"Ansible\",", + " \"description\": \"Complete sample role.\",", + " \"galaxy_tags\": [", + " \"tag_1\",", + " \"tag_2\"", + " ],", + " \"license\": \"LICENSE\",", + " \"min_ansible_version\": \"2.9.0\",", + " \"platforms\": [", + " {", + " \"name\": \"eos\",", + " \"versions\": [", + " \"all\"", + " ]", + " }", + " ]", + " }", + " },", + " \"info_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_full/meta/main.yml\",", + " \"readme_path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_1/roles/role_full/README.md\",", + " \"short_name\": \"role_full\"", + " }", + " ],", + " \"shadowed\": false,", + " \"version\": \"1.0.0\"", + " },", + " {", + " \"collection_info\": {", + " \"authors\": [", + " \"Ansible team (ansible-navigator)\"", + " ],", + " \"license_file\": \"LICENSE\",", + " \"name\": \"coll_2\",", + " \"namespace\": \"company_name\",", + " \"readme\": \"README.md\",", + " \"version\": \"2.0.0\"", + " },", + " \"hidden_by\": [],", + " \"known_as\": \"company_name.coll_2\",", + " \"name\": \"company_name.coll_2\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_2\",", + " \"plugins\": {", + " \"lookup\": [", + " {", + " \"full_name\": \"company_name.coll_2.lookup_2\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_2/plugins/lookup/lookup_2.py\",", + " \"short_description\": \"This is test lookup plugin\"", + " }", + " ],", + " \"module\": [", + " {", + " \"full_name\": \"company_name.coll_2.mod_2\",", + " \"path\": \"FIXTURES_COLLECTION_DIR/test_stdout_tmux.py/collections/ansible_collections/company_name/coll_2/plugins/modules/mod_2.py\",", + " \"short_description\": \"This is a test module\"", + " }", + " ]", + " },", + " \"roles\": [],", + " \"shadowed\": false,", + " \"version\": \"2.0.0\"", + " }", + " ]", + "}", + "(venv) bash$" + ] +} diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/0.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/0.json index 2cf0f42a7..d44293761 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/0.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/0.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/4.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/4.json index 9db9af980..6f998995a 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/4.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/4.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/8.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/8.json index 3984e6b8c..6b1e17139 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/8.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_ee.py/test/8.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/0.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/0.json index fe8719edf..6c5d53aff 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/0.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/0.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/4.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/4.json index 007743799..d3dcd7c37 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/4.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/4.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/8.json b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/8.json index 94134341b..94664082a 100644 --- a/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/8.json +++ b/tests/fixtures/integration/actions/settings/test_direct_interactive_noee.py/test/8.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/2.json b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/2.json index f33babbcf..1ba13473a 100644 --- a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/2.json +++ b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/2.json @@ -10,15 +10,6 @@ "compared_fixture": false }, "output": [ - " }", - " },", - " \"type\": \"object\"", - " },", - " \"image\": {", - " \"description\": \"Specify the name of the execution environment image\",", - " \"type\": \"string\"", - " },", - " \"pull\": {", " \"additionalProperties\": false,", " \"properties\": {", " \"arguments\": {", @@ -68,6 +59,15 @@ " },", " \"type\": \"object\"", " },", + " \"format\": {", + " \"default\": \"yaml\",", + " \"description\": \"Specify the format for stdout output.\",", + " \"enum\": [", + " \"json\",", + " \"yaml\"", + " ],", + " \"type\": \"string\"", + " },", " \"images\": {", " \"additionalProperties\": false,", " \"properties\": {", diff --git a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/3.json b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/3.json index a6b483578..3fd5906c6 100644 --- a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/3.json +++ b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/3.json @@ -10,15 +10,6 @@ "compared_fixture": false }, "output": [ - " }", - " },", - " \"type\": \"object\"", - " },", - " \"image\": {", - " \"description\": \"Specify the name of the execution environment image\",", - " \"type\": \"string\"", - " },", - " \"pull\": {", " \"additionalProperties\": false,", " \"properties\": {", " \"arguments\": {", @@ -68,6 +59,15 @@ " },", " \"type\": \"object\"", " },", + " \"format\": {", + " \"default\": \"yaml\",", + " \"description\": \"Specify the format for stdout output.\",", + " \"enum\": [", + " \"json\",", + " \"yaml\"", + " ],", + " \"type\": \"string\"", + " },", " \"images\": {", " \"additionalProperties\": false,", " \"properties\": {", diff --git a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/4.json b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/4.json index 175084c26..bc2d6f385 100644 --- a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/4.json +++ b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/4.json @@ -121,13 +121,15 @@ "# - src: \"/tmp/directory\"", "# dest: \"/tmp/directory\"", "# options: \"Z\"", - "# # Specify a host attribute to show in the inventory view", + "# # Specify the format for stdout output.", + "# format: json", "# images:", "# # Provide detailed information about the selected execution environment", "# # image", "# details:", "# - ansible_collections", "# - ansible_version", + "# # Specify a host attribute to show in the inventory view", "# inventory-columns:", "# - ansible_network_os", "# - ansible_network_cli_ssh_type", diff --git a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/5.json b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/5.json index 61d72b6d2..a830c853a 100644 --- a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/5.json +++ b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/5.json @@ -45,6 +45,7 @@ " image: ghcr.io/ansible/creator-ee:v0.13.0", " pull:", " policy: never", + " format: yaml", " images:", " details:", " - everything", diff --git a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/6.json b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/6.json index 50a09fabe..429c2de0b 100644 --- a/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/6.json +++ b/tests/fixtures/integration/actions/settings/test_stdout_tmux.py/test/6.json @@ -45,6 +45,7 @@ "ansible-navigator.execution-environment.pull.arguments: Not set", "ansible-navigator.execution-environment.pull.policy: Environment variable", "ansible-navigator.execution-environment.volume-mounts: Not set", + "ansible-navigator.format: Defaults", "ansible-navigator.images.details: Defaults", "ansible-navigator.inventory-columns: Not set", "ansible-navigator.logging.append: Defaults", diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/1.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/1.json index 58936e701..0ba7a369e 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/1.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/1.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/5.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/5.json index 3ef43dba0..3c713895f 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/5.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/5.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/9.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/9.json index 0e1ab23f8..0c9d0f8be 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/9.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_ee.py/test/9.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment True Command line True", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/1.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/1.json index d0d3d6ade..f2a277759 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/1.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/1.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/5.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/5.json index 20ceeefc7..1f0b7063a 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/5.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/5.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/9.json b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/9.json index d06fca1fd..15fb9a25a 100644 --- a/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/9.json +++ b/tests/fixtures/integration/actions/settings/test_welcome_interactive_noee.py/test/9.json @@ -5,7 +5,7 @@ "additional_information": { "present": [ "Ansible runner artifact dir", - "Help playbook" + "Help inventory" ], "absent": [], "compared_fixture": false @@ -30,11 +30,11 @@ "15│Execution environment False Command line False", "16│Execution environment image True Defaults ghcr.io/ansible/creator-ee:v0.13.0", "17│Execution environment volume mounts True Not set Not set", - "18│Help builder True Defaults False", - "19│Help config True Defaults False", - "20│Help doc True Defaults False", - "21│Help inventory True Defaults False", - "22│Help playbook True Defaults False", + "18│Format True Defaults yaml", + "19│Help builder True Defaults False", + "20│Help config True Defaults False", + "21│Help doc True Defaults False", + "22│Help inventory True Defaults False", "^b/PgUp page up ^f/PgDn page down ↑↓ scroll esc back [0-9] goto :help help" ] } diff --git a/tests/fixtures/unit/configuration_subsystem/ansible-navigator.yml b/tests/fixtures/unit/configuration_subsystem/ansible-navigator.yml index 6cbe31cb4..d1161712d 100644 --- a/tests/fixtures/unit/configuration_subsystem/ansible-navigator.yml +++ b/tests/fixtures/unit/configuration_subsystem/ansible-navigator.yml @@ -62,6 +62,7 @@ ansible-navigator: options: "Z" container-options: - "--net=host" + format: json images: details: - ansible_version diff --git a/tests/integration/_interactions.py b/tests/integration/_interactions.py index 9111d8026..a908ed8e0 100644 --- a/tests/integration/_interactions.py +++ b/tests/integration/_interactions.py @@ -21,6 +21,7 @@ class Command(NamedTuple): execution_environment: bool cmdline: str | None = None command: str = "ansible-navigator" + format: str | None = None log_level: str = "debug" mode: str = "interactive" pass_environment_variables: list = [] @@ -40,6 +41,8 @@ def join(self): args.extend(["--ee", self.execution_environment]) args.extend(["--ll", self.log_level]) args.extend(["--mode", self.mode]) + if self.format: + args.extend(["--format", self.format]) if self.pass_environment_variables: for env_var in self.pass_environment_variables: args.extend(["--penv", env_var]) diff --git a/tests/integration/actions/collections/test_stdout_tmux.py b/tests/integration/actions/collections/test_stdout_tmux.py index b1271fb9c..939af9aa9 100644 --- a/tests/integration/actions/collections/test_stdout_tmux.py +++ b/tests/integration/actions/collections/test_stdout_tmux.py @@ -37,6 +37,15 @@ class ShellCommand(UiTestStep): ).join(), present=["- collection_info:", " namespace: company_name", " roles:"], ), + ShellCommand( + comment="collections json output", + user_input=StdoutCommand( + format="json", + mode="stdout", + execution_environment=False, + ).join(), + present=['"name": "coll_2"'], + ), ) steps = add_indices(stdout_tests) diff --git a/tests/integration/actions/settings/base.py b/tests/integration/actions/settings/base.py index 7e6954016..45a9752cb 100644 --- a/tests/integration/actions/settings/base.py +++ b/tests/integration/actions/settings/base.py @@ -22,7 +22,7 @@ UiTestStep( user_input=":f", comment="clear filter, full list", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], mask=True, ), UiTestStep(user_input=":f Exec", comment="filter using a different index"), @@ -31,7 +31,7 @@ UiTestStep( user_input=":f", comment="clear filter, full list", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], mask=True, ), ) diff --git a/tests/integration/actions/settings/test_direct_interactive_ee.py b/tests/integration/actions/settings/test_direct_interactive_ee.py index 7227dabcf..5dc4c70af 100644 --- a/tests/integration/actions/settings/test_direct_interactive_ee.py +++ b/tests/integration/actions/settings/test_direct_interactive_ee.py @@ -16,7 +16,7 @@ UiTestStep( user_input=CLI, comment="ansible-navigator settings command top window", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], ), ) diff --git a/tests/integration/actions/settings/test_direct_interactive_noee.py b/tests/integration/actions/settings/test_direct_interactive_noee.py index 576435251..646be67c9 100644 --- a/tests/integration/actions/settings/test_direct_interactive_noee.py +++ b/tests/integration/actions/settings/test_direct_interactive_noee.py @@ -16,7 +16,7 @@ UiTestStep( user_input=CLI, comment="ansible-navigator settings command top window", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], ), ) diff --git a/tests/integration/actions/settings/test_welcome_interactive_ee.py b/tests/integration/actions/settings/test_welcome_interactive_ee.py index c8aa0782b..e75ff1d65 100644 --- a/tests/integration/actions/settings/test_welcome_interactive_ee.py +++ b/tests/integration/actions/settings/test_welcome_interactive_ee.py @@ -17,7 +17,7 @@ UiTestStep( user_input=":settings", comment="enter settings from welcome screen", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], ), ) diff --git a/tests/integration/actions/settings/test_welcome_interactive_noee.py b/tests/integration/actions/settings/test_welcome_interactive_noee.py index 3d7400f89..a94d4b376 100644 --- a/tests/integration/actions/settings/test_welcome_interactive_noee.py +++ b/tests/integration/actions/settings/test_welcome_interactive_noee.py @@ -17,7 +17,7 @@ UiTestStep( user_input=":settings", comment="enter settings from welcome screen", - present=["Ansible runner artifact dir", "Help playbook"], + present=["Ansible runner artifact dir", "Help inventory"], ), ) diff --git a/tests/unit/configuration_subsystem/data.py b/tests/unit/configuration_subsystem/data.py index 38ca7737d..88f93d106 100644 --- a/tests/unit/configuration_subsystem/data.py +++ b/tests/unit/configuration_subsystem/data.py @@ -233,6 +233,7 @@ def cli_data(): "/tmp:/test1:Z;/tmp:/test2:z", ["/tmp:/test1:Z", "/tmp:/test2:z"], ), + ("format", "json", "json"), ("help_builder", "false", False), ("help_config", "false", False), ("help_doc", "false", False),