Skip to content

Instantly share code, notes, and snippets.

@gamename
Last active May 28, 2020 14:22
Show Gist options
  • Save gamename/a819dcaf9dc7afc7f6153536c04cb038 to your computer and use it in GitHub Desktop.
Save gamename/a819dcaf9dc7afc7f6153536c04cb038 to your computer and use it in GitHub Desktop.
- name: get our bricks
shell: gluster volume info {{ item }} | grep 'Brick1:' | awk 'BEGIN { FS = ":" } ; { print $3 }'
register: gluster_bricks
with_items: "{{ gluster_volumes.stdout_lines }}"
- name: show our gluster bricks
debug:
var: gluster_bricks.results
# How can I extract only 'stdout' from gluster_bricks.results and put those into the 'disks' fact?
- name: Save our gluster brick so a common fact
set_fact:
disks: "{{ gluster_bricks.results}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment