Skip to content

Instantly share code, notes, and snippets.

@hvisage
Last active December 25, 2017 21:22
Show Gist options
  • Save hvisage/3ed9393ee57972983e9b to your computer and use it in GitHub Desktop.
Save hvisage/3ed9393ee57972983e9b to your computer and use it in GitHub Desktop.

Revisions

  1. hvisage revised this gist Sep 9, 2015. 2 changed files with 1 addition and 0 deletions.
    File renamed without changes.
    1 change: 1 addition & 0 deletions intersecting host groups
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ansible "qa:&apps" -m ping
  2. hvisage revised this gist Sep 9, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,8 @@ and then, note the | @csv

    for i in setup/*; do echo $if; jq '[.ansible_facts.ansible_hostname,.ansible_facts.ansible_devices.sda.size , .ansible_facts.ansible_all_ipv4_addresses[0]] | @csv' -r $i;done

    "pssa-qa-pgdb01","120.00 GB","10.100.13.70"
    "qa-pgdb01","120.00 GB","10.100.13.70"

    for i in setup/*; do jq '[ .ansible_facts.ansible_hostname, .ansible_facts.ansible_all_ipv4_addresses[0] ] | join(", ")' -j $i;echo;done
    qa-pgdb01, 10.100.13.70

  3. hvisage revised this gist Sep 9, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,7 @@
    for i in setup/*; do echo $if; jq '[.ansible_facts.ansible_hostname,.ansible_facts.ansible_devices.sda.size , .ansible_facts.ansible_all_ipv4_addresses[0]]' -c $i;done >list
    for i in setup/*; do echo $if; jq '[.ansible_facts.ansible_hostname,.ansible_facts.ansible_devices.sda.size , .ansible_facts.ansible_all_ipv4_addresses[0]]' -c $i;done >list

    and then, note the | @csv

    for i in setup/*; do echo $if; jq '[.ansible_facts.ansible_hostname,.ansible_facts.ansible_devices.sda.size , .ansible_facts.ansible_all_ipv4_addresses[0]] | @csv' -r $i;done

    "pssa-qa-pgdb01","120.00 GB","10.100.13.70"
  4. hvisage created this gist Sep 9, 2015.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    for i in setup/*; do echo $if; jq '[.ansible_facts.ansible_hostname,.ansible_facts.ansible_devices.sda.size , .ansible_facts.ansible_all_ipv4_addresses[0]]' -c $i;done >list