### Plugin Entrypoint Declaration Source: https://github.com/ansible/ansible-runner/blob/devel/docs/external_interface.md Example of how to declare a plugin as a Runner entrypoint in a setup file. ```python entry_points=("ansible_runner.plugins": 'modname = your_python_package_name'), ``` -------------------------------- ### Example CPU Profiling Data Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md An example of the JSON content for a CPU profiling data file. ```json ==> 0-525400c9-c704-29a6-4107-00000000000c-cpu.json <==\n{"timestamp": 1568977988.6844425, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 97.12799768097156}\n{"timestamp": 1568977988.9394386, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 94.17538298892688}\n{"timestamp": 1568977989.1901696, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 64.38272588006255}\n{"timestamp": 1568977989.4594045, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 83.77387744259856} ``` -------------------------------- ### Getting the list of installed plugins locally Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of retrieving a list of Ansible plugins installed on the local system. ```python # get plugin list installed on local system out, err = ansible_runner.get_plugin_list() print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Runner Artifact Job Event Example (Task Start) Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This JSON snippet shows an example of a 'playbook_on_task_start' event captured by Ansible Runner. ```json {\n "uuid": "8c164553-8573-b1e0-76e1-000000000008",\n "parent_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",\n "counter": 5,\n "stdout": "\r\nTASK [debug] *******************************************************************",\n "start_line": 5,\n "end_line": 7,\n "event": "playbook_on_task_start",\n "event_data": {\n "playbook": "test.yml",\n "playbook_uuid": "34437b34-addd-45ae-819a-4d8c9711e191",\n "play": "all",\n "play_uuid": "8c164553-8573-b1e0-76e1-000000000006",\n "play_pattern": "all",\n "task": "debug",\n "task_uuid": "8c164553-8573-b1e0-76e1-000000000008",\n "task_action": "debug",\n "task_path": "\/home\/mjones\/ansible\/ansible-runner\/demo\/project\/test.yml:3",\n "task_args": "msg=Test!",\n "name": "debug",\n "is_conditional": false,\n "pid": 10640\n },\n "pid": 10640,\n "created": "2018-06-07T14:54:58.410605"\n} ``` -------------------------------- ### env/passwords Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md Example of the env/passwords file format (JSON or YAML) for matching prompts with passwords. ```yaml --- "^SSH password:\s*?$": "some_password" "^BECOME password.*:\s*?$": "become_password" ``` -------------------------------- ### Example PID Profiling Data Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md An example of the JSON content for a PID profiling data file. ```json ==> 0-525400c9-c704-29a6-4107-00000000000c-pids.json <==\n{"timestamp": 1568977988.4284189, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 5}\n{"timestamp": 1568977988.6845856, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 6}\n{"timestamp": 1568977988.939547, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 8}\n{"timestamp": 1568977989.1902773, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 13}\n{"timestamp": 1568977989.4593227, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 6} ``` -------------------------------- ### Example Memory Profiling Data Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md An example of the JSON content for a memory profiling data file. ```json ==> 0-525400c9-c704-29a6-4107-00000000000c-memory.json <==\n{"timestamp": 1568977988.4281094, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 36.21484375}\n{"timestamp": 1568977988.6842303, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 57.87109375}\n{"timestamp": 1568977988.939303, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 66.60546875}\n{"timestamp": 1568977989.1900482, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 71.4609375}\n{"timestamp": 1568977989.4592078, "task_name": "Gathering Facts", "task_uuid": "525400c9-c704-29a6-4107-00000000000c", "value": 38.25390625} ``` -------------------------------- ### Ansible Runner Command Line Arguments Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md Example of command line arguments that can be provided to Ansible Runner. ```bash --tags one,two --skip-tags three -u ansible --become ``` -------------------------------- ### env/envvars Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md Example of the env/envvars file format (JSON or YAML) for runtime environment variables. ```yaml --- TESTVAR: exampleval ``` -------------------------------- ### Install from source Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Installs Ansible Runner in editable mode after cloning the source code and setting up a virtual environment. ```bash cd ansible-runner pip install -e . ``` -------------------------------- ### Example Playbook Usage Source: https://github.com/ansible/ansible-runner/blob/devel/demo/project/roles/testrole/README.md An example of how to include and use the role in a playbook, demonstrating variable passing. ```yaml - hosts: servers roles: - { role: username.rolename, x: 42 } ``` -------------------------------- ### Setting up development environment with virtualenvwrapper Source: https://github.com/ansible/ansible-runner/blob/devel/CONTRIBUTING.md Steps to install virtualenvwrapper, create a virtual environment for Ansible Runner, and install the project in editable mode. ```bash (host)$ pip install virtualenvwrapper (host)$ mkvirtualenv ansible-runner (host)$ pip install -e . ``` -------------------------------- ### Build only wheel distribution Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Produces only an installable wheel distribution for Ansible Runner. ```bash python3 -m build --wheel ``` -------------------------------- ### Specifying an Alternate Inventory Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Examples of how to specify an alternate inventory file or directory using the --inventory option. ```bash # Use inventory /inventory/hosts.backup $ ansible-runner run demo -p test.yml --inventory hosts.backup ``` ```bash # Use inventory in the /path/to/alternate-inventory directory (outside of ) $ ansible-runner run demo -p test.yml --inventory /path/to/alternate-inventory ``` ```bash # Use inventory in the inventory2 subdirectory, relative to current directory $ ansible-runner run demo -p test.yml --inventory inventory2 ``` -------------------------------- ### Install from Fedora repositories Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Installs Ansible Runner from the Fedora repositories. ```bash dnf install python3-ansible-runner ``` -------------------------------- ### SSH Config Symlink Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/execution_environments.md Demonstrates how to handle symlinked SSH configuration files by mounting the target directory into the container using the `--container-volume-mount` option. ```bash $ ls -l ~/.ssh/config lrwxrwxrwx. 1 myuser myuser 34 Jul 15 19:27 /home/myuser/.ssh/config -> /home/myuser/dotfiles/ssh_config $ ansible-runner run \ --container-volume-mount /home/myuser/dotfiles/:/home/myuser/dotfiles/ \ --process-isolation --process-isolation-executable podman \ /tmp/private --playbook my_playbook.yml -i my_inventory.ini ``` -------------------------------- ### Get all roles with an arg spec installed locally Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Retrieves a list of all locally installed roles that have an argument specification. ```python # get all roles with an arg spec installed locally out, err = ansible_runner.get_role_list() print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Create and activate virtual environment Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Creates a virtual environment named 'env' and activates it. ```bash virtualenv env source env/bin/activate ``` -------------------------------- ### Running linters and unit tests with tox Source: https://github.com/ansible/ansible-runner/blob/devel/CONTRIBUTING.md Instructions to install tox and run linters (flake8, yamllint) and tests. ```bash pip install tox tox ``` -------------------------------- ### Starting a Receptor Node Source: https://github.com/ansible/ansible-runner/blob/devel/docs/remote_jobs.md Command to start a local Receptor node with the specified configuration. ```bash $ receptor --config ./receptor.yml ``` -------------------------------- ### Get the arg spec for a role from a locally installed collection Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Retrieves the argument specification for a specific role from a locally installed collection. ```python # get the arg spec for role `baz` from the locally installed `foo.bar` collection out, err = ansible_runner.get_role_argspec('baz', collection='foo.bar') print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Install using pip Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Installs the latest version of Ansible Runner from the Python Package Index. ```bash pip install ansible-runner ``` -------------------------------- ### Status handler example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Illustrates how to define and use a custom status handler function that gets called whenever the runner's status changes. ```python import ansible_runner def my_status_handler(data, runner_config): # Do something here print(data) r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml', status_handler=my_status_handler) ``` -------------------------------- ### Ansible Event Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/external_interface.md An example of an Ansible event emitted during playbook execution. ```json {"runner_ident": "XXXX", } ``` -------------------------------- ### Running playbooks with demo private directory Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Example of running a playbook named 'test.yml' using 'demo' as the private data directory. ```bash $ ansible-runner run demo --playbook test.yml ``` -------------------------------- ### Runner Input Directory Hierarchy Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This is a visual representation of the directory structure for Ansible Runner inputs. ```none . ├── env │ ├── envvars │ ├── extravars │ ├── passwords │ ├── cmdline │ ├── settings │ └── ssh_key ├── inventory │ └── hosts └── project ├── test.yml └── roles └── testrole ├── defaults ├── handlers ├── meta ├── README.md ├── tasks ├── tests └── vars ``` -------------------------------- ### env/extravars Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md Example of the env/extravars file format (JSON or YAML) for extra variables passed to the Ansible Process. ```yaml --- ansible_connection: local test: val ``` -------------------------------- ### Getting changed Ansible configuration values Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of retrieving a dump of Ansible configuration values, filtered to show only those that have been changed from their defaults. ```python # get list of changed ansible configuration values out, err = ansible_runner.get_ansible_config(action='dump', config_file='/home/demo/ansible.cfg', only_changed=True) print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Get the arg spec for a role from a collection in a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Retrieves the argument specification for a specific role from a collection installed in a container. ```python # get the arg spec for role `baz` from the `foo.bar` collection installed in a container out, err = ansible_runner.get_role_argspec('baz', collection='foo.bar', process_isolation=True, container_image='network-ee') print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Outputting JSON event data Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Example of how to enable JSON output for event data using the -j argument. ```bash $ ansible-runner ... -j ... ``` -------------------------------- ### Running modules directly Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Example of invoking the 'debug' module directly with 'demo' as the private data directory and 'localhost' as the host. ```bash $ ansible-runner run demo -m debug --hosts localhost -a msg=hello ``` -------------------------------- ### Example invocation of standalone ansible-runner Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md A basic example of how to invoke the ansible-runner utility to run a playbook. ```bash $ ansible-runner run /tmp/private -p playbook.yml ``` -------------------------------- ### Build distribution (wheel and sdist) Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Produces both a wheel and a source distribution (sdist) for Ansible Runner. ```bash python3 -m pip install build python3 -m build ``` -------------------------------- ### Status Event Example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/external_interface.md An example of a status event emitted by Ansible Runner. ```json {"status": "running", "runner_ident": "XXXX" } ``` -------------------------------- ### Clone source code from GitHub Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Clones the Ansible Runner source code from its GitHub repository. ```bash git clone git://github.com/ansible/ansible-runner ``` -------------------------------- ### Build only sdist distribution Source: https://github.com/ansible/ansible-runner/blob/devel/docs/install.md Produces only a source distribution (sdist) for Ansible Runner. ```bash python3 -m build --sdist ``` -------------------------------- ### Running roles directly Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Example of invoking a role named 'testrole' directly with 'demo' as the private data directory and 'localhost' as the target host. ```bash $ ansible-runner run demo --role testrole --hosts localhost ``` -------------------------------- ### Ansible Runner Execution with Container Image Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md Example command to run Ansible Runner with a specified container image and process isolation enabled. ```bash ansible-runner run --container-image my-execution-environment:latest --process-isolation -p playbook.yml . ``` -------------------------------- ### Running with directory isolation Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Example of using directory isolation to ensure parallel task execution does not conflict and to prevent playbook content pollution. ```bash $ ansible-runner --directory-isolation-base-path /tmp/runner ``` -------------------------------- ### Running a specific role Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of executing a specific Ansible role by name. ```python # run the role named 'myrole' contained in the '/project/roles' directory r = ansible_runner.run(private_data_dir='/tmp/demo', role='myrole') print("{}: {}".format(r.status, r.rc)) print(r.stats) ``` -------------------------------- ### Getting plugin documentation from within a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Demonstrates how to retrieve documentation for specific Ansible plugins (modules, etc.) from within a containerized environment. ```python # get plugin docs from within container out, err = ansible_runner.get_plugin_docs( plugin_names=['vyos.vyos.vyos_command'], plugin_type='module', response_format='json', process_isolation=True, container_image='network-ee' ) print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Artifacts handler example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Shows how to use a custom function to handle artifacts after a playbook run completes. ```python import ansible_runner def my_artifacts_handler(artifacts_dir): # Do something here print(artifacts_dir) # Do something with artifact directory after the run is complete r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml', artifacts_handler=my_artifacts_handler) ``` -------------------------------- ### Event handler example Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Demonstrates how to use a custom event handler function to process events generated during the Ansible run. ```python import ansible_runner def my_event_handler(data): # Do something here print(data) r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml', event_handler=my_event_handler) ``` -------------------------------- ### Running generic commands locally Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of executing generic Ansible commands interactively on the local system, redirecting stdin, stdout, and stderr. ```python # run ansible/generic commands in interactive mode locally out, err, rc = ansible_runner.run_command( executable_cmd='ansible-playbook', cmdline_args=['gather.yaml', '-i', 'inventory', '-vvvv', '-k'], input_fd=sys.stdin, output_fd=sys.stdout, error_fd=sys.stderr, ) print("rc: {}".format(rc)) print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Getting the list of plugins with file details from within a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Demonstrates how to retrieve a list of Ansible plugins, including their file paths, from within a containerized environment. ```python # get plugins with file list from within container out, err = ansible_runner.get_plugin_list(list_files=True, process_isolation=True, container_image='network-ee') print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Runner Artifact Job Event Example (Stats) Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This JSON snippet shows the final 'playbook_on_stats' event when a playbook runs to completion. ```json {\n "uuid": "01c7090a-e202-4fb4-9ac7-079965729c86",\n "counter": 7,\n "stdout": "\r\nPLAY RECAP *********************************************************************\r\n\u001b[0;32mlocalhost,\u001b[0m : \u001b[0;32mok=2 \u001b[0m changed=0 unreachable=0 failed=0 \r\n",\n "start_line": 10,\n "end_line": 14,\n "event": "playbook_on_stats",\n "event_data": {\n "playbook": "test.yml",\n "playbook_uuid": "34437b34-addd-45ae-819a-4d8c9711e191",\n "changed": {\n\n },\n "dark": {\n\n },\n "failures": {\n\n },\n "ok": {\n "localhost,": 2\n },\n "processed": {\n "localhost,": 1\n },\n "skipped": {\n\n },\n "artifact_data": {\n\n },\n "pid": 10640\n },\n "pid": 10640,\n "created": "2018-06-07T14:54:58.424603"\n} ``` -------------------------------- ### Get ansible inventory information Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Retrieves inventory information using ansible_runner.get_inventory with specified parameters. ```python out, err = ansible_runner.get_inventory( action='list', inventories=['/home/demo/inventory1', '/home/demo/inventory2'], response_format='json', process_isolation=True, container_image='network-ee' ) print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Sending Job to Receptor Node Source: https://github.com/ansible/ansible-runner/blob/devel/docs/remote_jobs.md Example of sending a job to a running Receptor node using receptorctl. ```bash $ ansible-runner transmit ./demo -p test.yml | receptorctl --socket ./control.sock work submit -f --node primary -p - ansible-runner | ansible-runner process ./demo ``` -------------------------------- ### Getting plugin documentation asynchronously from within a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Shows how to fetch Ansible plugin documentation asynchronously from within a container, allowing for non-blocking operations. ```python # get plugin docs from within container in async mode thread_obj, runner_obj = ansible_runner.get_plugin_docs_async( plugin_names=['ansible.netcommon.cli_config', 'ansible.netcommon.cli_command'], plugin_type='module', response_format='json', process_isolation=True, container_image='network-ee' ) while runner_obj.status not in ['canceled', 'successful', 'timeout', 'failed']: time.sleep(0.01) continue print("out: {}".format(runner_obj.stdout.read())) print("err: {}".format(runner_obj.stderr.read())) ``` -------------------------------- ### Running a module and checking results Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of executing a specific Ansible module (e.g., 'shell') with host pattern and printing the status, return code, events, and stats. ```python import ansible_runner r = ansible_runner.run(private_data_dir='/tmp/demo', host_pattern='localhost', module='shell', module_args='whoami') print("{}: {}".format(r.status, r.rc)) # successful: 0 for each_host_event in r.events: print(each_host_event['event']) print("Final status:") print(r.stats) ``` -------------------------------- ### Get roles with an arg spec from a collection in a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Retrieves roles with an argument specification from a specified collection within a container. ```python # get roles with an arg spec from the `foo.bar` collection in a container out, err = ansible_runner.get_role_list(collection='foo.bar', process_isolation=True, container_image='network-ee') print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### Running generic commands within a container Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Example of executing generic Ansible commands (like `ansible-playbook`) interactively within a specified container image, redirecting stdin, stdout, and stderr. ```python # run ansible/generic commands in interactive mode within container out, err, rc = ansible_runner.run_command( executable_cmd='ansible-playbook', cmdline_args=['gather.yaml', '-i', 'inventory', '-vvvv', '-k'], input_fd=sys.stdin, output_fd=sys.stdout, error_fd=sys.stderr, host_cwd='/home/demo', process_isolation=True, container_image='network-ee' ) print("rc: {}".format(rc)) print("out: {}".format(out)) print("err: {}".format(err)) ``` -------------------------------- ### View parameters accepted by ansible-runner Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Command to display all available parameters for the ansible-runner utility. ```bash $ ansible-runner --help ``` -------------------------------- ### Basic playbook execution and status check Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Demonstrates how to run a playbook, print its status and return code, iterate through host events, and display final statistics. ```python import ansible_runner r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml') print("{}: {}".format(r.status, r.rc)) # successful: 0 for each_host_event in r.events: print(each_host_event['event']) print("Final status:") print(r.stats) ``` -------------------------------- ### Using RunnerConfig for playbook execution Source: https://github.com/ansible/ansible-runner/blob/devel/docs/python_interface.md Shows how to configure and run a playbook using the `RunnerConfig` class, including setting tags. ```python from ansible_runner import Runner, RunnerConfig # Using tag using RunnerConfig rc = RunnerConfig( private_data_dir="project", playbook="main.yml", tags='my_tag', ) rc.prepare() r = Runner(config=rc) r.run() ``` -------------------------------- ### pip-compile command Source: https://github.com/ansible/ansible-runner/blob/devel/docs/requirements.txt The command used to generate this requirements.txt file. ```bash pip-compile requirements.in ``` -------------------------------- ### Profiling Data Directory Structure Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This shows the typical directory structure and file naming convention for profiling data. ```shell .\n├── profiling_data\n│   ├── 0-34437b34-addd-45ae-819a-4d8c9711e191-cpu.json\n│   ├── 0-34437b34-addd-45ae-819a-4d8c9711e191-memory.json\n│   ├── 0-34437b34-addd-45ae-819a-4d8c9711e191-pids.json\n│   ├── 1-8c164553-8573-b1e0-76e1-000000000006-cpu.json\n│   ├── 1-8c164553-8573-b1e0-76e1-000000000006-memory.json\n│   └── 1-8c164553-8573-b1e0-76e1-000000000006-pids.json ``` -------------------------------- ### Detailed Artifact Directory Structure Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This snippet provides a more detailed view of the contents within an artifact identifier directory. ```default .\n├── artifacts\n│   └── 37f639a3-1f4f-4acb-abee-ea1898013a25\n│   ├── fact_cache\n│   │   └── localhost\n│   ├── job_events\n│   │   ├── 1-34437b34-addd-45ae-819a-4d8c9711e191.json\n│   │   ├── 2-8c164553-8573-b1e0-76e1-000000000006.json\n│   │   ├── 3-8c164553-8573-b1e0-76e1-00000000000d.json\n│   │   ├── 4-f16be0cd-99e1-4568-a599-546ab80b2799.json\n│   │   ├── 5-8c164553-8573-b1e0-76e1-000000000008.json\n│   │   ├── 6-981fd563-ec25-45cb-84f6-e9dc4e6449cb.json\n│   │   └── 7-01c7090a-e202-4fb4-9ac7-079965729c86.json\n│   ├── rc\n│   ├── status\n│   └── stdout ``` -------------------------------- ### Enabling process isolation Source: https://github.com/ansible/ansible-runner/blob/devel/docs/standalone.md Command to enable process isolation for ansible-runner. ```bash $ ansible-runner --process-isolation ... ``` -------------------------------- ### Deactivating and Reactivating virtual environment Source: https://github.com/ansible/ansible-runner/blob/devel/CONTRIBUTING.md Commands to deactivate the current virtual environment and reactivate the 'ansible-runner' environment. ```bash (host)$ deactivate (host)$ workon ansible-runner ``` -------------------------------- ### Three-Phase Remote Job Execution Source: https://github.com/ansible/ansible-runner/blob/devel/docs/remote_jobs.md Illustrates the transmit, worker, and process phases for remote job execution. ```bash $ ansible-runner transmit ./demo -p test.yml | ansible-runner worker | ansible-runner process ./demo ``` -------------------------------- ### Runner Artifacts Directory Hierarchy Source: https://github.com/ansible/ansible-runner/blob/devel/docs/intro.md This snippet shows the top-level directory structure for Ansible Runner artifacts. ```default .\n├── artifacts\n│   └── identifier\n├── env\n├── inventory\n├── profiling_data\n├── project\n└── roles ``` -------------------------------- ### Receptor Node Configuration Source: https://github.com/ansible/ansible-runner/blob/devel/docs/remote_jobs.md Basic configuration for a local Receptor node to handle Ansible Runner work. ```yaml --- - node: id: primary - log-level: level: Debug - local-only: - control-service: service: control filename: ./control.sock - work-command: worktype: ansible-runner command: ansible-runner params: worker allowruntimeparams: true ``` -------------------------------- ### Worker Cleanup Command Source: https://github.com/ansible/ansible-runner/blob/devel/docs/remote_jobs.md Command to clean up old directories matching a file pattern, potentially created by ansible-runner worker. ```bash $ ansible-runner worker cleanup --file-pattern=/tmp/foo_* ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.