• 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 test – does the path reference existing symbolic link
  • Edit on GitHub

ansible.builtin.link test – does the path reference existing symbolic link

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. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.link 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).

Aliases: is_link, islink

Input

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

Parameter

Comments

Input

path

A path.

Examples

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

Return Value

Key

Description

Return value

boolean

Returns True if the path corresponds to an existing symlink on the filesystem 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.