Need help in using set_fact , playbook runs fine , facts not set , no errors

Hi Group,

I am trying to add some basic facts to a system but nothing seems to work.
My goal is to add a simple fact like the type of the server and the main application running on it to be set
Type of server can be webserver (apache/tomcat)/ database server (mysql/postgress … etc)
And I would like to do this from the commandline with -e at initial deployment of a server.

My main.yml looks like this

First, set_fact is ephemeral (only lasts for the current ansible run), your first 2 attempts were succeeding, to see the results you can run:

  • debug: msg=“systemtype:{{system_type}}”

second, the - denotes a task, so - name + - action doen’t work, name is a property of the task and has to be in the same grouping.

  • name:
    action:

or

  • action:
    name: