From cc0d7c2ed25ed04a1a724aa47eae4c740294473d Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 5 Sep 2019 12:44:04 +0200 Subject: [PATCH] copr: drop 'stage' variable Since the 'env' by design (see comments in inventory/group_vars/all) can only contain 'production' or 'staging', we still need to have a way to to detect 'staging' vs 'development'. There already was 'devel' variable in copr, but it was set to 'true' also on staging. So let's change this. --- inventory/group_vars/copr_stg | 3 +-- roles/copr/backend/templates/resalloc/pools.yaml | 6 ++++-- roles/copr/frontend-cloud/templates/copr.conf | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/inventory/group_vars/copr_stg b/inventory/group_vars/copr_stg index 60c4bf3025..6dccbfe094 100644 --- a/inventory/group_vars/copr_stg +++ b/inventory/group_vars/copr_stg @@ -1,6 +1,5 @@ --- -devel: true -stage: true +devel: false #_forward-src: "{{ files }}/copr/forward-dev" _forward_src: "forward_dev" diff --git a/roles/copr/backend/templates/resalloc/pools.yaml b/roles/copr/backend/templates/resalloc/pools.yaml index 26d096aea0..75d99801d3 100644 --- a/roles/copr/backend/templates/resalloc/pools.yaml +++ b/roles/copr/backend/templates/resalloc/pools.yaml @@ -1,4 +1,4 @@ -{% if not devel %} +{% if env == "production" %} # Production configuration. On each aarch64 host we have # 2 guests VMs of # - 10 VCPUs @@ -22,7 +22,7 @@ aarch64_02_prod: cmd_delete: "/var/lib/resallocserver/resalloc_provision/vm-aarch64-delete" tags: - aarch64 -{% elif stage is not defined %} +{% elif devel %} # Development configuration. On each aarch64 host we have # 2 guests vms of # - 2 VCPUs (default) @@ -46,4 +46,6 @@ aarch64_02_dev: cmd_delete: "/var/lib/resallocserver/resalloc_provision/vm-aarch64-delete" tags: - aarch64 +{% else %} +# No aarch64 hosts on staging for now. {% endif %} diff --git a/roles/copr/frontend-cloud/templates/copr.conf b/roles/copr/frontend-cloud/templates/copr.conf index 1ab33ce136..e1a3f10965 100644 --- a/roles/copr/frontend-cloud/templates/copr.conf +++ b/roles/copr/frontend-cloud/templates/copr.conf @@ -1,6 +1,6 @@ # Purpose of this instance # Use "production", "devel", "local" or "test" -ENV={% if devel %}"devel"{% else %}"production"{% endif %} +ENV={% if devel %}"devel"{% else %}{{ env }}{% endif %} # Directory and files where is stored Copr database files DATA_DIR = '/var/lib/copr/data'