LoginSignup
0
0

More than 1 year has passed since last update.

ansible magic variable snippet

Last updated at Posted at 2021-12-13

Overview

  • to know magic variables
- hosts: all
  gather_facts: no

  tasks:
    - name: show Magic | group_names
      debug: var=group_names

    - name: show Magic | groups
      debug: var=groups

    - name: show Magic | inventory_hostname
      debug: var=inventory_hostname

    - name: show Magic | inventory_hostname_short
      debug: var=inventory_hostname_short

    - name: show Magic | play_hosts
      debug: var=play_hosts

    - name: show Magic | inventory_dir
      debug: var=inventory_dir

    - name: show Magic | inventory_file
      debug: var=inventory_file

    # Reserved magic variable
    - name: show Reserved magic | environment
      debug: var=environment
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0