on-internet
← Community

Getting full name of the OS using Ansible facts

Stack Overflow ·

I used gather_facts to get the OS details of each instance that I'm dealing with. For Amazon Linux OS, it just says Amazon 2 or Amazon 2018. Use case: I'm dynamically constructing the file name for a task. The file name is nothing but the name of the OS. When I see the contents of /etc/os-release, it says Amazon Linux only but Ansible facts returns: "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python2.7", "distribution": "Amazon", "distribution_file_parsed": true, "distribution_file_path": "/etc/os-release", "distribution_file_variety": "Amazon", "distribution_major_version":

Comments

Sign in or sign up to comment and upvote.

No comments yet.