Skip to content

Instantly share code, notes, and snippets.

View Kesin11's full-sized avatar

Kenta Kase Kesin11

View GitHub Profile
@JM1
JM1 / Ansible_Roles_with_OS-specific_Defaults.md
Last active March 14, 2024 20:50
Ansible Roles with OS-specific defaults

Ansible Roles with OS-specific Defaults

This Ansible guide discusses several approaches on how to set different role default variables based / depending on the host operating system aka ansible_distribution / ansible_facts.distribution or other variables. For example, a role variable image_uri should point to the latest cloud image for the host. For CentOS 8 or Red Hat Enterprise Linux (RHEL) 8 the default value should be: