• Blog
  • Ansible community forum
  • Documentation
Ansible Logo
Ansible Core Documentation
Ansible Core

Ansible getting started

  • Getting started with Ansible

Installation, Upgrade & Configuration

  • Installation Guide
  • Ansible Core Porting Guides

Using Ansible Core

  • Building Ansible inventories
  • Using Ansible command line tools
  • Using Ansible playbooks
  • Protecting sensitive data with Ansible vault
  • Using Ansible modules and plugins
  • Using Ansible collections
  • Using Ansible on Windows, BSD, and z/OS UNIX
  • Ansible tips and tricks

Contributing to Ansible Core

  • Ansible Community Guide
  • ansible-core Contributors Guide
  • Advanced Contributor Guide
  • Ansible documentation style guide

Extending Ansible

  • Developer Guide

Ansible Galaxy

  • Galaxy User Guide
  • Galaxy Developer Guide

Reference & Appendices

  • Collection Index
    • Collections in the Ansible Namespace
      • Ansible.Builtin
        • Description
        • Communication
        • Plugin Index
  • Indexes of all modules and plugins
  • Playbook Keywords
  • Return Values
  • Ansible Configuration Settings
  • Controlling how Ansible behaves: precedence rules
  • YAML Syntax
  • Python 3 Support
  • Interpreter Discovery
  • Releases and maintenance
  • Testing Strategies
  • Sanity Tests
  • Frequently Asked Questions
  • Glossary
  • Ansible Reference: Module Utilities
  • Special Variables
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • Logging Ansible output

Roadmaps

  • ansible-core Roadmaps




Ansible Core
  • Collection Index
  • Collections in the Ansible Namespace
  • Ansible.Builtin
  • ansible.builtin.link_exists test – does the path exist, no follow
  • Edit on GitHub

ansible.builtin.link_exists test – does the path exist, no follow

Note

This test plugin is part of ansible-core and included in all Ansible installations. In most cases, you can use the short plugin name link_exists. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.link_exists for easy linking to the plugin documentation and to avoid conflicting with other collections that may have the same test plugin name.

  • Synopsis

  • Input

  • Examples

  • Return Value

Synopsis

  • Check if the provided path maps to an existing symlink on the controller’s filesystem (localhost).

  • Does not follow symlinks, so it only verifies that the link itself exists.

Input

This describes the input of the test, the value before is ansible.builtin.link_exists or is not ansible.builtin.link_exists.

Parameter

Comments

Input

path

A path.

Examples

ismyhostsalink: "{{ '/etc/hosts' is link_exists}}"
list_of_symlinks: "{{ list_of_paths | select('link_exists') }}"

Return Value

Key

Description

Return value

boolean

Returns True if the path corresponds to an existing filesystem object on the controller, False if otherwise.

Returned: success

Authors

  • Ansible Core

Collection links

  • Issue Tracker
  • Repository (Sources)
  • Communication
Previous Next

© Copyright Ansible project contributors. Last updated on Oct 02, 2025.