Last active
September 7, 2016 16:41
-
-
Save lanky/878c41af4aee90769541d5ef4cb39900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: create a list and use it for something | |
hosts: all | |
vars: | |
ip_list: [] | |
gather_facts: no | |
tasks: | |
- name: loop over hosts and create list of IP:PORT entries | |
set_fact: | |
ip_list: "{{ ip_list }} + [ '{{ '%s:6379' | format(item) }}' ]" | |
with_items: "{{ groups['tag_Deployment_asdf_redis_pc'] }}" | |
delegate_to: localhost | |
run_once: yes | |
- name: use list for something | |
debug: | |
msg: "source /etc/profile; echo yes | redis-trib.rb create --replicas 0 {{ip_list|join(',')}}" | |
run_once: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inventory:
output: