community.general.aerospike_migrations – Check or wait for migrations between nodes¶
This plugin is part of the community.general collection.
To install it use:
ansible-galaxy collection install community.general.
To use it in a playbook, specify:
This can be used to check for migrations in a cluster. This makes it easy to do a rolling upgrade/update on Aerospike nodes.
If waiting for migrations is not desired, simply just poll until port 3000 if available or asinfo -v status returns ok
# check for migrations on local node - name: Wait for migrations on local node before proceeding community.general.aerospike_migrations: host: "localhost" connect_timeout: 2000 consecutive_good_checks: 5 sleep_between_checks: 15 tries_limit: 600 local_only: False # example playbook: --- - name: Upgrade aerospike hosts: all become: true serial: 1 tasks: - name: Install dependencies ansible.builtin.apt: name: - python - python-pip - python-setuptools state: latest - name: Setup aerospike ansible.builtin.pip: name: aerospike # check for migrations every (sleep_between_checks) # If at least (consecutive_good_checks) checks come back OK in a row, then return OK. # Will exit if any exception, which can be caused by bad nodes, # nodes not returning data, or other reasons. # Maximum runtime before giving up in this case will be: # Tries Limit * Sleep Between Checks * delay * retries - name: Wait for aerospike migrations community.general.aerospike_migrations: local_only: True sleep_between_checks: 1 tries_limit: 5 consecutive_good_checks: 3 fail_on_cluster_change: true min_cluster_size: 3 target_cluster_size: 4 register: migrations_check until: migrations_check is succeeded changed_when: false delay: 60 retries: 120 - name: Another thing ansible.builtin.shell: | echo foo - name: Reboot ansible.builtin.reboot: