Skip to content

Instantly share code, notes, and snippets.

@Rudd-O
Last active December 14, 2015 19:29
Show Gist options
  • Save Rudd-O/5137196 to your computer and use it in GitHub Desktop.
Save Rudd-O/5137196 to your computer and use it in GitHub Desktop.
- 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
action: shell echo "$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 $host/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