| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- - block:
- - name: generate clickhouse spec conf
- template:
- src: clickhouse.spec.j2
- dest: /tmp/clickhouse.spec.yaml
- - name: Apply modifications for clickhouse
- environment:
- KUBECONFIG: "{{ ENV_KUBECONFIG }}"
- shell: |
- {{ K3S_CMDLINE_PREFIX }} kubectl patch onecloudclusters -n onecloud default --patch "$(cat /tmp/clickhouse.spec.yaml)" --type merge
- for i in autoupdate cloudevent glance keystone region kubeserver logger meter monitor notify webconsole
- do
- {{ K3S_CMDLINE_PREFIX }} kubectl delete configmap -n onecloud default-$i
- {{ K3S_CMDLINE_PREFIX }} kubectl rollout restart deployment -n onecloud default-$i
- done
- sleep 30
- # check all services that use clickhouse
- for i in autoupdate cloudevent glance keystone region kubeserver logger meter monitor notify webconsole
- do
- {{ K3S_CMDLINE_PREFIX }} kubectl -n onecloud get configmap default-$i -o yaml | grep -qP '^\s+clickhouse: tcp'
- done
- args:
- executable: /bin/bash
- retries: 10
- register: clickhouse_result
- delay: 30
- ignore_errors: true
- become: yes
- until: clickhouse_result.rc == 0
- - name: clean tmp files
- shell: |
- rm -f /tmp/clickhouse.spec.yaml
- when:
- - offline_data_path is defined
- - offline_data_path | length > 0
- - ch_password | default('') | length > 0
|