initial_token: {{ token }}
$ ./tokenbuilder.py 6{"0": {"0": 0,"1": 28356863910078205288614550619314017621,"2": 56713727820156410577229101238628035242,"3": 85070591730234615865843651857942052864,"4": 113427455640312821154458202477256070485,"5": 141784319550391026443072753096570088106}}
vars:tokens:0: 01: 283568639100782052886145506193140176212: 56713727820156410577229101238628035242
...
tasks:- name: Copy over the templated cassandra.yaml config filetemplate: src=templates/cassandra.yaml.j2 dest=/etc/cassandra/cassandra.yaml
host1 has token = tokens[0] = 0host2 has token = tokens[1] = 28356863910078205288614550619314017621host3 has token = tokens[2] = 56713727820156410577229101238628035242host4 has token = tokens[3] = 85070591730234615865843651857942052864host5 has token = tokens[4] = 113427455640312821154458202477256070485host6 has token = tokens[5] = 141784319550391026443072753096570088106
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
# Cassandra storage config YAML{% set seeds = [] %}{% for host in groups['tag_Name_cassandra'] -%}{# This is in an if block even though it is just a variable assignment becausethe only other way to append to an array is with the 'do' Jinja2 extension-#}{% if seeds.append(hostvars[host]['ansible_eth0']['ipv4']['address']) -%}{% endif -%}{% endfor -%}{% set num_hosts = seeds|length -%}...{% for ip in seeds|sort -%}{% if ansible_eth0["ipv4"]["address"] == ip -%}initial_token: {{ initial_tokens[num_hosts][loop.index0] }}{% endif -%}{% endfor -%}
[mysqld]
{% set ip_list = [] %}
{% for host in groups['db'] -%}
{# This is in an if block even though it is just a variable assignment because
the only other way to append to an array is with the 'do' Jinja2 extension
-#}
{% if ip_list.append(hostvars[host]['ansible_eth0']['ipv4']['address']) -%}{% endif -%}
{% endfor -%}
datadir=/var/lib/mysql
user=mysql
# Path to Galera library
wsrep_provider=/usr/lib/libgalera_smm.so
# Cluster connection URL contains the IPs of all nodes
wsrep_cluster_address=gcomm://{{ ip_list|join(',') }}