0

I am trying to use Ansible playbooks to run a multi-arch cluster. Now, to do that I need to make arch specific decisions. Is there any ansible module that can help me do that? Or is there any way where I can know the arch and use that in "when" conditional statement?

techraf
  • 64,883
  • 27
  • 193
  • 198
Pensu
  • 3,263
  • 10
  • 46
  • 71

1 Answers1

3

Use the debug module to display your targets' facts and select the one that suits you best for your conditionals.

ansible_architecture for a start. ansible_os_family, ansible_distribution... Whatever works for you.

techraf
  • 64,883
  • 27
  • 193
  • 198
  • Thanks for the quick response. Any idea what is the difference between ansible_architecture and ansbile_machine, they both look similar and confusing at the same time! – Pensu Mar 21 '17 at 07:20
  • 1
    The code is not secret https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts.py – techraf Mar 21 '17 at 07:22
  • Got it! Can do that. – Pensu Mar 21 '17 at 09:06