command: curl -XPUT "http://localhost:9200/_cluster/settings" -d'{ "transient" : { "cluster.routing.allocation.enable" : "none" } }'
command: 'curl -XPUT "http://localhost:9200/_cluster/settings" -d\'\{ "transient" : \{ "cluster.routing.allocation.enable" : "none" \} \}''
command: {{ 'curl -XPUT "http://localhost:9200/_cluster/settings" -d'{ "transient" : { "cluster.routing.allocation.enable" : "none" } }'' }}
--
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.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ef4f9432-a75e-4ab1-91f1-487c8e0a68a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- name: Set uri_body (workaround)
set_fact:
uri_body:
transient:
cluster.routing.allocation.enable: "none"
- name: Disable shard allocation to prevent es from rebalancing missing shards
uri: PUT
body: "{{ uri_body | to_json }}"
body_format: jsonfatal: [vm2.example.com]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible-tmp-1460491268.69-8119459959976/uri\", line 3363, in <module>\r\n main()\r\n File \"/tmp/ansible-tmp-1460491268.69-8119459959976/uri\", line 374, in main\r\n dict_headers['Content-Type'] = 'application/json'\r\nTypeError: 'NoneType' object does not support item assignment\r\n", "msg": "MODULE FAILURE", "parsed": false}- name: Set uri endpoints
set_fact:
es_disable_allocation:
transient:
cluster.routing.allocation.enable: "none"
- name: Disable shard allocation to prevent es from rebalancing missing shards
uri:
url: "http://localhost:9200/_cluster/settings"
method: PUT
body: "{{ es_disable_allocation|to_json }}"