Skip to content

Instantly share code, notes, and snippets.

@novodinia
Created April 19, 2014 19:51
Show Gist options
  • Save novodinia/afa58be3c34dd600291f to your computer and use it in GitHub Desktop.
Save novodinia/afa58be3c34dd600291f to your computer and use it in GitHub Desktop.
$ pwd
/home/dan/foo
$ tree
.
|-group_vars
|-roles
|---foo
|-----meta
$ cat roles/foo/meta/main.yml
---
dependencies:
- { role: openjdk, java_version: 7 }
$ cat playbook
---
- hosts: all
vars:
foo_dir: /root/foo
bar_dir: /root/foo/bar
tasks:
- name: make foo directory
file: path={{ foo_dir }} state=directory
- name: download bar
get_url: dest={{ foo_dir }} url=https://example.com/bar.tar.gz
- name: extract bar
command: chdir={{ foo_dir }} tar xzf bar.tar.gz
- name: get conf file
get_url: dest={{ bar_dir }} url=https://gist.githubusercontent.com/novodinia/234mzdf/raw/ou34m34/file.conf
- name: launch bar
command: chdir={{ bar_dir }} ./bin/bar --conf file.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment