Skip to content

Instantly share code, notes, and snippets.

@bcoca
Created March 11, 2013 20:01
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 bcoca/5137216 to your computer and use it in GitHub Desktop.
Save bcoca/5137216 to your computer and use it in GitHub Desktop.
rewritten
- hosts:
- karen.dragonfear
- paola.dragonfear
- mathilda.dragonfear
user: root
vars:
backupserver: mathilda.dragonfear
tasks:
- name: get zpool data
action: shell zpool list -H -o name
register: zpools
- name: print out info
debug: msg="$item"
with_items: ${zpools.stdout_lines}
- name: generate Jenkins configuration file
action: template src=../backupserver/job.xml.j2 dest="/var/lib/jenkins/jobs/Backup $item from $inventory_hostname/config.xml" owner=jenkins group=jenkins
with_items: ${zpools.stdout_lines}
delegate_to: $backupserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment