--- - name: Check Kafka Producer workload is running (note; error can be ignored) command: > oc rollout status DeploymentConfig/fraud-detection-pam-kafka-producer --watch=true -n {{ _namespace }} register: producerrollout ignore_errors: true - name: Check Kafka Aggregator workload is running (note; error can be ignored) command: > oc rollout status DeploymentConfig/fraud-detection-pam-kafka-aggregator --watch=true -n {{ _namespace }} register: aggregatorrollout ignore_errors: true - name: Get Kafka template uri: url: "https://{{ gitea_route.stdout }}/{{ _namespace }}/proactive-fraud-detection-kafka/raw/branch/master/.openshiftio/application.yaml" method: GET body_format: json validate_certs: false return_content: true register: kafkatemplate when: '"successfully rolled out" not in producerrollout.stdout or "successfully rolled out" not in aggregatorrollout.stdout' - name: Process Kafka Producer workload template command: > oc process -p APP_NAME=fraud-detection-pam-kafka-producer -p SOURCE_REPOSITORY_DIR=fraud-detection-pam-kafka-producer -p SOURCE_REPOSITORY_URL=http://mygitea.gitea.svc.cluster.local:3000/{{ _namespace }}/proactive-fraud-detection-kafka.git -p KAFKA_BROKERS={{ _namespace }}-cluster-kafka-bootstrap:9092 -n {{ _namespace }} -f - args: stdin: "{{ kafkatemplate.content | string }}" register: producerwork when: '"successfully rolled out" not in producerrollout.stdout' - name: Process Kafka Aggregator workload template command: > oc process -p APP_NAME=fraud-detection-pam-kafka-aggregator -p SOURCE_REPOSITORY_DIR=fraud-detection-pam-kafka-aggregator -p SOURCE_REPOSITORY_URL=http://mygitea.gitea.svc.cluster.local:3000/{{ _namespace }}/proactive-fraud-detection-kafka.git -p KAFKA_BROKERS={{ _namespace }}-cluster-kafka-bootstrap:9092 -n {{ _namespace }} -f - args: stdin: "{{ kafkatemplate.content | string }}" register: aggregatorwork when: '"successfully rolled out" not in aggregatorrollout.stdout' - name: Create Kafka Producer workload k8s: state: present namespace: "{{ _namespace }}" definition: "{{ producerwork.stdout | from_json }}" when: '"successfully rolled out" not in producerrollout.stdout' - name: Create Kafka Aggregator workload k8s: state: present namespace: "{{ _namespace }}" definition: "{{ aggregatorwork.stdout | from_json }}" when: '"successfully rolled out" not in aggregatorrollout.stdout'