set_fact

Collection: builtin

Full Name: set_fact

Controller module — runs on the local controller, not on remote hosts.

Synopsis

Define variables for the current host during a play

Parameters

NameTypeRequiredDefaultDescription
cacheableboolfalseThis boolean converts the variable into an actual ‘fact’ which will also be added to the fact cache

Example

- name: Derive the release directory from the version
  set_fact:
    release_dir: "/srv/releases/{{ app_version }}"
    cacheable: true