+1 vote
in DevOps by
What is the distinction among set_fact and vars in ansible?

1 Answer

0 votes
by

Where a set_fact sets the incentive for a factor at one time and stays static, despite the fact that the esteem is very powerful and vars continue changing according to the esteem continues changing for the variable.

assignments:

set_fact:

fact_time: “Truth: ”

troubleshoot: var=fact_time

order: rest 2

troubleshoot: var=fact_time

assignments:

name: queries in factors versus queries in realities

has: localhost

vars:

var_time: “Var: ”

Despite the fact that the query for the date has been utilized in both the cases, wherein the vars are utilized it modifies dependent on an opportunity to time each time executed inside the playbook lifetime. Be that as it may, Fact dependably continues as before once query is finished

Related questions

0 votes
asked Mar 9, 2020 in DevOps by Hodge
0 votes
asked Aug 30, 2021 in DevOps by SakshiSharma
...