Template tasks based on OS version...

26 views
Skip to first unread message

Andy Speagle

unread,
May 26, 2021, 4:01:16 PM5/26/21
to Ansible Project
Hi Folks,

I'm busy converting some puppet modules to ansible... and I'm trying to figure out how best to lay down some files based on the host os version... I'm trying to lay down one set of files if os_version x... another set of files if os_version y... etc.

I don't see how in the template or file modules to do something simple like this... 

Anyone can clue me in on proper technique for this?

Thanks!

Andy

Wei-Yen Tan

unread,
May 26, 2021, 4:04:16 PM5/26/21
to ansible...@googlegroups.com
Using ansible facts and when in the play. have done this before. Am on my phone so can send you an example later. 


From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Andy Speagle <sid...@gmail.com>
Sent: Thursday, May 27, 2021 8:01:16 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: [ansible-project] Template tasks based on OS version...
 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4bd500a-7a91-4a89-bdd1-a7911ad53ba0n%40googlegroups.com.

Andy Speagle

unread,
May 26, 2021, 9:19:25 PM5/26/21
to ansible...@googlegroups.com
Okay, yeah... I reasoned this out. I was making it harder than required. 

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/nml0XwNTfK0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/SYBPR01MB561661EEF76F78F26D7ABE15AD249%40SYBPR01MB5616.ausprd01.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages