Working with Ansible playbooks in Atlas
Use Tanium™ Atlas to run your existing Ansible playbooks on Tanium-managed Linux endpoints. Atlas uses natural language prompts to start playbook runs, report the result for each endpoint, and return the Ansible output for a specific endpoint, so you can manage Ansible playbooks alongside other tasks on the same page. For more information about Atlas, see Tanium Atlas User Guide.
The Tanium™ Client delivers the playbook to each targeted endpoint, and Ansible runs it locally against that endpoint only. Results return through Tanium sensors, the same as any other endpoint data.
Atlas runs playbooks through a single automation operation, automate.ansible_playbook.run.v2, which appears by name in approval cards and run summaries. Every run requires your approval before it reaches an endpoint.
Before you begin
- You must have permission to deploy actions to the computer group that you target, and the Automate permissions to run automation operations. For more information, see Automate requirements.
- To upload a playbook archive, you must have the write package permission on a content set.
- Targeted endpoints must meet the requirements. For more information, see Endpoint requirements.
- Before your first run, Automate must have a platform token for your user. For more information, see Register an Automate platform token.
Endpoint requirements
Targeted endpoints must run Linux and have the Tanium Client installed. Automate does not install Ansible on endpoints. Make sure that each targeted endpoint meets the following requirements:
- Python 3.10 or later and
ansible-core2.11 or later, installed system-wide. The Tanium Client runs as root with the systemPATHand locates Ansible withcommand -v ansible-playbook, so an installation in/usr/binor/usr/local/binworks. A user-level installation, such aspip install --user, a virtual environment, orpipx, is not on that path. The run then fails before any task runs and returns the messageansible-playbook is not on PATH; install Python and ansible-core on this endpoint. - An
ansible-coreversion that the Python version on the endpoint supports. Any Ansible Galaxy collections that you vendor must support theansible-coreversion on the endpoint. setsid, which is part ofutil-linuxand is included in all mainstream Linux distributions.
The ansible-playbook binary runs under the Python version that it was installed with. Automate does not select or change this version. Tanium helper scripts on the endpoint use the Python version that is included with the Tanium Client, so the Python version on the endpoint does not need to match the Python version bundled with the Tanium Client.
To verify an endpoint before your first playbook run, run the following command on the endpoint as root:
command -v ansible-playbook && ansible-playbook --version
Register an Automate platform token
An Ansible playbook run uses the permissions of the user who starts the run, not those of a service account, so Automate must have a platform token for your user. Automate creates this token the first time that you save a playbook.
- From the Main menu, go to Automate as the same user and persona that you use for Atlas.
- Create and save any playbook. You can delete the playbook after you save it. For more information, see Building playbooks.
The token is valid for seven days and renews automatically while you continue to use Automate. If you have not used Automate for more than seven days, save a playbook again.
If Automate does not have a platform token for your user, the playbook run fails within seconds, returns the message the run-as user has no usable Automate platform token; register one from the Automate workbench, and does not reach any endpoint.
Configure Atlas for Ansible playbook runs
Include the automate.ansible_playbook.run.v2 operation in every prompt that starts a playbook run. In some cases, Atlas does not find the operation, asks you to confirm the request in the Chat pane instead of returning an approval card, or declines the request because the operation changes endpoints. If this happens, add the following instructions to the AI Agent Instructions field under User Preferences in Atlas. You need to add these instructions only one time.
Ansible playbook runs
- To run an Ansible playbook, use the automation operation automate.ansible_playbook.run.v2 through a composition run. The playbook steps, packages, and sensors behind it are internal to the operation.
- This operation writes to endpoints and is registered as destructive. Request the approval prompt rather than asking me to confirm first, and do not set require_read_only.
- Default to a one-off run. Register a composition only when I ask for one, which takes two approvals.
- Resolve a computer group name to its ID yourself. When I give an archive hash and an entry-point playbook, use the archive form of the source.
- Poll the run to a terminal state before reporting, then give the run ID, status, play statistics, and per-endpoint detail. For endpoint output, ask the Automate - Ansible Run Log sensor with the run ID.
Playbook source options for Atlas
You can provide a playbook to Atlas as inline YAML or as an uploaded archive.
|
Method |
Description |
When to use |
|---|---|---|
|
Inline YAML |
Paste the playbook into the Atlas prompt. Limited to a single playbook file with no roles, files, or collections. |
A single-task fix or a quick drift check, such as a package installed across a computer group, or a baseline configuration file with expected contents. |
|
Uploaded archive |
Archive your playbook repository, upload it to the Tanium Server, and provide the returned SHA-256 hash and the path of an entry-point playbook inside the archive. |
Playbooks that include roles, templates, files, or Ansible Galaxy collection dependencies. |
Automate does not connect to your Git repository or download Ansible content on your behalf, and endpoints do not connect to Ansible Galaxy or the internet. Because you build the upload in your own environment, repository credentials and internal repository content are not sent to Tanium.
To build and upload a playbook archive, see Build and upload a playbook archive.
Build and upload a playbook archive
Perform the following steps from the root of your playbook repository, on a machine that has ansible-galaxy installed and internet access.
Endpoint targeting for a playbook run
A playbook run targets endpoints by computer group or by computer name.
|
Method |
Description |
|---|---|
|
Computer group |
Include the name of an existing computer group in your prompt, such as All Linux or Web Servers - Prod. Atlas resolves the name to the computer group. The computer group must already exist in the Tanium Console. The playbook run does not create computer groups or evaluate ad hoc filters. |
|
List of computer names |
Include the endpoint names in your prompt. Use this method to remediate the specific endpoints that a check mode run reported as drifted. |
To target a set of endpoints that no existing computer group describes, create the computer group in the Tanium Console, and then include its name in your prompt.
hosts: selection within the playbook is not applied. The hosts: value of your play is rewritten to all at run time, and each endpoint runs the play against itself only.
Run an Ansible playbook in Atlas
Run an Ansible playbook on the endpoints in a computer group, or on a list of endpoints that you specify.
Check endpoints for configuration drift
Check mode is the Ansible dry run. The play reports the changes that it would make and does not write to the endpoint. If the playbook would change any endpoint, the playbook run returns DRIFTED and lists each of those endpoints.
Ansible playbook run results
A playbook run reports its status, the Ansible play statistics, and the detail for each endpoint that reported an issue.
Ansible counts tasks, not endpoints. The ok count includes every task that completed, and the changed count includes only the tasks that modified the endpoint. An idempotent playbook reports changed=0 when you run it again.
|
Status |
Description |
|---|---|
|
SUCCEEDED |
Every endpoint completed the play with no failures. In check mode, no endpoint would change. |
|
DRIFTED |
A check mode run found at least one endpoint that the playbook would change. |
|
FAILED |
An endpoint failed or was unreachable, an endpoint did not report a result, or the playbook run could not start. |
|
CANCELED |
The playbook run was stopped. Endpoints that had not started the play do not start it. Endpoints that are running the play complete it. |
For more information, see Endpoint-level results. To review the full Ansible output from an endpoint, see Ansible output from an endpoint.
Endpoint-level results
An endpoint is listed in the run results only if it reported an issue. Each listed endpoint includes a result kind, and a failed endpoint also includes the task that ended the play and the message that Ansible returned.
|
Kind |
Description |
Recommended action |
|---|---|---|
|
FAILED |
At least one Ansible task failed on the endpoint. |
Review the detail for the endpoint, and then ask Atlas for the run log. |
|
DRIFTED |
In check mode, the playbook would change the endpoint. |
Run the playbook in run mode to remediate the endpoint, or investigate the cause of the drift. |
|
LAUNCH_FAILED |
The endpoint received the playbook run, but the run ended before Ansible started. This result usually indicates that Python 3 or |
For more information, see Endpoint requirements. A playbook run ends on these endpoints without waiting for the deadline. |
|
UNREACHABLE |
Ansible could not act on the endpoint. |
Review the Ansible installation on the endpoint. |
|
STILL_RUNNING |
The play was still running when the playbook run reached its deadline. |
Review the endpoint later, or reduce the number of tasks in the play. |
|
NO_RESPONSE |
The playbook run started on the endpoint, but the endpoint did not report a result before the deadline. |
Review the endpoint later. An endpoint without Python or Ansible installed returns LAUNCH_FAILED instead. |
Ansible output from an endpoint
Two sensors return Ansible playbook run data.
|
Sensor |
Description |
|---|---|
|
Automate - Ansible Run Recap |
The playbook run asks this sensor once a minute. The sensor returns the state, the mode, and the play statistics. For a failed endpoint, it also returns the failing task and its message. Atlas uses these results for the endpoint detail in the run summary, so you do not need to ask this sensor. |
|
Automate - Ansible Run Log |
Ask this sensor to review the full Ansible output from an endpoint. The sensor takes the playbook run ID as a parameter and returns up to the last 1000 lines of the |
To review the full Ansible output for a specific endpoint, enter a prompt that asks for the run log sensor. For example:
Run the Tanium sensor Automate - Ansible Run Log with run_id <id> against <host>
Atlas adds the sensor results to the display pane.
Troubleshoot Ansible playbook runs
If an Ansible playbook run does not perform as expected, review the following issues and resolutions.
|
Issue |
Cause |
Resolution |
|---|---|---|
|
Atlas reports that it cannot run an Ansible playbook, or that the Ansible package and sensors are not intended for direct use. |
Atlas searched the Automate playbook steps instead of the automation operation. |
Include |
|
Atlas declines the request because the run must be read-only, or because the run is not permitted to write. |
Atlas applied general composition guidance that does not cover Ansible playbook runs. |
To configure Atlas for Ansible playbook runs, see Configure Atlas for Ansible playbook runs. If the issue continues, see Contact Tanium Support. |
|
The playbook run fails within seconds and returns a message about an unusable Automate platform token. |
Your user has not saved an Automate playbook, or has not used Automate in the last seven days. |
For more information, see Register an Automate platform token. |
|
Endpoints return LAUNCH_FAILED soon after the playbook run starts. |
Python 3 or |
For more information, see Endpoint requirements. |
|
Atlas returns two approval cards for one request. |
A prompt that asks Atlas to create and run a composition performs two actions: it registers the composition, and then runs it. |
Ask for a one-off run to start a single playbook run with a single approval. |
|
The run log reports that a collection does not support the Ansible version on the endpoint. |
The vendored collection requires a later |
This message is a warning, and the play continues to run. To resolve the warning, specify an earlier collection version in |
|
Some endpoints fail with a package manager error, and other endpoints complete the play. |
The package name or the repository differs by Linux distribution. |
Ask Atlas for the run log of a failed endpoint to identify the expected package name. Update the Ansible playbook with the correct package name, or target a different computer group. |
|
A run that uses a newly uploaded archive fails before reaching any endpoint. |
The Tanium Server has not finished caching the archive. |
Wait a few minutes and run the playbook again. |
|
The run is rejected with |
A vendored collection declares that it does not support the ansible-core version that Automate targets. |
Update the collection to a version that supports current ansible-core releases and build the archive again. |
|
An archive upload fails or is rejected. |
The archive exceeds the 64 MB limit, or it was uploaded as a raw request body instead of |
Confirm the archive is under 64 MB and upload it as |
Ansible playbook run limitations
Note the following limitations for Ansible playbook runs:
- Playbooks must run against the local endpoint only. Automate rejects plays that batch across endpoints with
serial, delegate tasks to another host, or use a non-local connection. Automate also does not apply theansible.cfgfile from your repository. - Cross-host orchestration, such as a rolling restart in which tasks on one endpoint depend on another endpoint, is not supported.
- Windows endpoints, macOS endpoints, and devices without the Tanium Client are not supported.
- Ansible Vault passwords, direct Git integration, and scheduled drift checks are not supported.
- Atlas is the only interface for Ansible playbook runs. The Automate workbench does not include a page for them.
- Automate does not prevent two playbook runs from targeting the same endpoint at the same time.