Skip to content

Set Ansible related facts

License

Notifications You must be signed in to change notification settings

idi-ops/ansible-facts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Facts Ansible Role

This role sets custom Ansible facts that other roles or playbooks can utilize with conditionals. It should be applied before any other roles or playbooks that depend on these custom facts.

Facts

Please refer to the defaults/main.yml file for a list of variables and the facts that they set.

Examples

Here are two examples of tasks using custom platform-specific facts. If a Fedora environment is detected the dnf module will be used to install a package:

- name: Install Node.js on Fedora
  dnf:
    name: nodejs
    state: present
  when: is_fedora

If a CentOS environment is detected the yum module will be used to install a package:

- name: Install Node.js on CentOS
  yum:
    name: nodejs
    state: present
  when: is_centos

Releases

No releases published

Packages

No packages published