Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster config update : error on enable maintenance mode task #115

Open
oaitmoulid opened this issue Oct 16, 2024 · 0 comments
Open

Cluster config update : error on enable maintenance mode task #115

oaitmoulid opened this issue Oct 16, 2024 · 0 comments

Comments

@oaitmoulid
Copy link

When adding a custom cluster configuration like this :

redpanda:
  cluster:
    auto_create_topics_enabled: true
    data_transforms_enabled: true
    default_topic_replications: 3

playbook fails at enabling the maintenance mode :

TASK [redpanda.cluster.redpanda_broker : Enable Maintenance Mode] ***********************************************************************************************************************************************
task path: /opt/ansible_core/add-ons/collections/ansible_collections/redpanda/cluster/roles/redpanda_broker/tasks/safe-restart.yml:6
fatal: [vm-redpanda-dif-prod-pau-01]: FAILED! => {"msg": "The conditional check 'ansible_play_hosts > 1' failed. The error was: Unexpected templating type error occurred on ({% if ansible_play_hosts > 1 %} True {% else %} False {% endif %}): '>' not supported between instances of 'list' and 'int'. '>' not supported between instances of 'list' and 'int'\n\nThe error appears to be in '/opt/ansible_core/add-ons/collections/ansible_collections/redpanda/cluster/roles/redpanda_broker/tasks/safe-restart.yml': line 6, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n#\n- name: Enable Maintenance Mode\n  ^ here\n"}

Suggested correction : just add " | length " to get the correct value of number of nodes, for example :

- name: Enable Maintenance Mode
  ansible.builtin.command:
    cmd: rpk cluster maintenance enable {{ node_id }} --wait {{ redpanda_rpk_opts }}
  no_log: "{{ redpanda_broker_no_log }}"
  when:
    - restart_required
    - inventory_hostname == cluster_host
    - ansible_play_hosts | length > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant