diff --git a/molecule/default/tasks/awx_replicas_test.yml b/molecule/default/tasks/awx_replicas_test.yml index 674c723d3..ec4f88de0 100644 --- a/molecule/default/tasks/awx_replicas_test.yml +++ b/molecule/default/tasks/awx_replicas_test.yml @@ -12,8 +12,8 @@ - include_tasks: _test_case_replicas.yml vars: - expected_web_replicas: 0 - expected_task_replicas: 0 + expected_web_replicas: 1 + expected_task_replicas: 1 #### @@ -43,8 +43,8 @@ - include_tasks: _test_case_replicas.yml vars: - expected_web_replicas: 0 - expected_task_replicas: 0 + expected_web_replicas: 1 + expected_task_replicas: 1 #### diff --git a/roles/installer/templates/deployments/task.yaml.j2 b/roles/installer/templates/deployments/task.yaml.j2 index 93c1cd130..3baecad2d 100644 --- a/roles/installer/templates/deployments/task.yaml.j2 +++ b/roles/installer/templates/deployments/task.yaml.j2 @@ -8,9 +8,9 @@ metadata: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} {{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=4) | trim }} spec: -{% if task_replicas != '' and task_manage_replicas | bool %} +{% if task_replicas != '' and task_replicas|int != 0 and task_manage_replicas | bool %} replicas: {{ task_replicas }} -{% elif replicas != '' and task_manage_replicas | bool %} +{% elif replicas != '' and replicas|int != 0 and task_manage_replicas | bool %} replicas: {{ replicas }} {% endif %} selector: diff --git a/roles/installer/templates/deployments/web.yaml.j2 b/roles/installer/templates/deployments/web.yaml.j2 index a131a3910..1449fe5e8 100644 --- a/roles/installer/templates/deployments/web.yaml.j2 +++ b/roles/installer/templates/deployments/web.yaml.j2 @@ -9,9 +9,9 @@ metadata: {{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }} {{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=4) | trim }} spec: -{% if web_replicas != '' and web_manage_replicas | bool %} +{% if web_replicas != '' and web_replicas|int != 0 and web_manage_replicas | bool %} replicas: {{ web_replicas }} -{% elif replicas != '' and web_manage_replicas | bool %} +{% elif replicas != '' and replicas|int != 0 and web_manage_replicas | bool %} replicas: {{ replicas }} {% endif %} selector: