Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimovnike/e59dc91080a6a985017b96fff8622ae5 to your computer and use it in GitHub Desktop.
Save dimovnike/e59dc91080a6a985017b96fff8622ae5 to your computer and use it in GitHub Desktop.
- name: Check if ballasts exist
stat:
path: "{{ item.path }}/BALLAST"
loop: "{{ cockroach_db_stores|selectattr('ballast_mb', 'defined')|list }}"
register: ballasts
- name: Create ballast files
command: dd if=/dev/zero of={{ item.path }}/BALLAST bs=1M count={{ item.ballast_mb }}
loop: |
{% set update=[] %}
{% for item in ballasts.results %}
{% if not item.stat.exists or item.stat.size/1048576!=item.item.ballast_mb %}
{{- update.append(item.item) -}}
{% endif %}
{% endfor -%}
{{ update }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment