Answer the question
In order to leave comments, you need to log in
How to set default values of a variable?
The idea is this: depending on the ip of the host, throw a certain file (not yet implemented) into a specific folder (they differ on all hosts).
---
- hosts: test
tasks:
- include: tasks.yml
- name: Include vars
include_vars:
file: vars.yml
- name: Debug
debug: msg={{ console_path }}
---
- set_fact:
console_path = "/var/www/folder1"
when:
ansible_default_ipv4.address == "1.2.3.4"
---
console_path: "/var/www/folder"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question