Skip to content

Instantly share code, notes, and snippets.

@stevenhaddox
Created November 15, 2013 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenhaddox/7479598 to your computer and use it in GitHub Desktop.
Save stevenhaddox/7479598 to your computer and use it in GitHub Desktop.
Ansible file showing apt or yum logic
---
- name: Unpack JDK7
action: command creates=${jvm_folder}/jdk1.7.0 chdir=${jvm_folder} tar zxvf ${jvm_folder}/$jdk_archive --owner=root
register: jdk_installed
only_if: "'$ansible_pkg_mgr' == 'apt'"
- name: Install JDK7 RPM package
action: command creates=${jvm_folder}/latest chdir=${jvm_folder} rpm --force -Uvh ${jvm_folder}/$jdk_archive
register: jdk_installed
only_if: "'$ansible_pkg_mgr' == 'yum'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment