Browse Source

Merge pull request #769 from Lakshmi-Patneedi/devel

AWX Pod going to CrashLoopBackoff state
Sujit Jadhav 3 years ago
parent
commit
34252d1f0d

+ 21 - 3
control_plane/roles/webui_awx/tasks/install_awx.yml

@@ -26,11 +26,29 @@
     state: directory
     mode: "{{ file_perm }}"
 
+- name: Check for awx-operator status
+  stat:
+    path: "{{ awx_manager_file }}"
+  register: awx_operator_repo
+
 - name: Cloning awx-operator from github
   git:
     repo: "{{ awx_operator_link }}"
     dest: "{{ awx_operator_folder }}"
     version: "{{ awx_tag }}"
+  when: not awx_operator_repo.stat.exists
+
+- name: Modifying livenessprobe value
+  replace:
+    path: "{{ awx_manager_file }}"
+    regexp: "{{ liveness_probe_initial }}"
+    replace: "{{ liveness_probe_final }}"
+
+- name: Modifying readinessprobe value
+  replace:
+    path: "{{ awx_manager_file }}"
+    regexp: "{{ readiness_probe_initial }}"
+    replace: "{{ readiness_probe_final }}"
 
 - name: Create namespace
   command: "kubectl create namespace {{ awx_namespace }}"
@@ -86,7 +104,7 @@
   retries: "{{ min_retries }}"
 
 - name: Waiting for awx-operator deployment to be up and running
-  command: kubectl wait --for=condition=available deployment awx-operator-controller-manager -n {{ awx_namespace }} --timeout=600s
+  command: kubectl wait --for=condition=available deployment awx-operator-controller-manager -n {{ awx_namespace }} --timeout={{ awx_operator_time }}
   changed_when: false
 
 - name: Deploy awx
@@ -112,10 +130,10 @@
 - name: Fails if the pods go into ImagePullBackOff state
   block:
     - name: Waiting for awx deployment to be up and running
-      command: kubectl wait --for=condition=available deployment awx -n {{ awx_namespace }} --timeout=1200s
+      command: kubectl wait --for=condition=available deployment awx -n {{ awx_namespace }} --timeout={{ awx_deployment_time }}
       changed_when: false
 
   rescue:
     - name: Display failure message
       debug:
-        msg: "{{ deployment_failure_msg }}"
+        msg: "{{ deployment_failure_msg }}"

+ 7 - 0
control_plane/roles/webui_awx/vars/main.yml

@@ -29,6 +29,13 @@ file_perm: '0644'
 awx_wait_time: 90
 deployment_failure_msg: "Deployment failed due to docker pull rate limit"
 awx_operator_link: "https://github.com/ansible/awx-operator.git"
+awx_manager_file: '/root/awx-operator/config/manager/manager.yaml'
+liveness_probe_initial: "initialDelaySeconds: 15"
+liveness_probe_final: "initialDelaySeconds: 600"
+readiness_probe_initial: "initialDelaySeconds: 5"
+readiness_probe_final: "initialDelaySeconds: 300"
+awx_operator_time: 900s
+awx_deployment_time: 1500s
 
 # Usage: configure_settings.yml
 awx_port: 8052