From 99b7ffea51706c3a1449486e90a81911f624e493 Mon Sep 17 00:00:00 2001 From: Vasily Kleschov Date: Mon, 20 Nov 2023 15:07:18 +0100 Subject: [PATCH] Refined build system dev deploy Related: https://github.com/AlmaLinux/build-system/issues/136 --- .../dev_deploy/templates/alts_config.yaml.j2 | 19 ++++----------- roles/dev_deploy/templates/build_node.yml.j2 | 19 +++++++-------- .../separate_build_node/tasks/create_env.yml | 2 +- roles/separate_build_node/tasks/dnf.yml | 3 ++- .../templates/build_node.j2 | 24 +++++++++---------- .../templates/sign_node.yml.j2 | 19 +++++++-------- 6 files changed, 35 insertions(+), 51 deletions(-) diff --git a/roles/dev_deploy/templates/alts_config.yaml.j2 b/roles/dev_deploy/templates/alts_config.yaml.j2 index 45ca2a8..5e48069 100644 --- a/roles/dev_deploy/templates/alts_config.yaml.j2 +++ b/roles/dev_deploy/templates/alts_config.yaml.j2 @@ -5,25 +5,16 @@ ssl_config: security_certificate: "" broker_ca_certificates: "" broker_config: - use_ssl: false rabbitmq_host: "rabbitmq-ts" rabbitmq_port: 5672 rabbitmq_ssl_port: 5671 rabbitmq_user: "{{ rabbitmq_user }}" rabbitmq_password: "{{ rabbitmq_pass }}" rabbitmq_vhost: "{{ rabbitmq_vhost }}" -result_backend_config: - s3_access_key_id: - s3_secret_access_key: - s3_bucket: - s3_base_path: 'celery_result_backend/' - s3_region: - s3_endpoint_url: - azureblockblob_container_name: "" - azureblockblob_base_path: "" - # deprecated - azure_connection_string: "blockblob://" -result_backend: "{{ result_backend }}" + result_backend: "{{ result_backend }}" +results_backend_config: + redis_host: "{{ container_name_prefix }}_redis_1" + redis_db_number: 1 task_default_queue: "default" task_acks_late: true task_track_started: true @@ -36,5 +27,3 @@ logs_uploader_config: pulp_host: "http://{{ container_name_prefix }}_pulp_1" pulp_user: "{{ pulp_user }}" pulp_password: "{{ pulp_password }}" - # deprecated - azure_logs_container: "testsys-mqdata" diff --git a/roles/dev_deploy/templates/build_node.yml.j2 b/roles/dev_deploy/templates/build_node.yml.j2 index 2f3387b..af03972 100644 --- a/roles/dev_deploy/templates/build_node.yml.j2 +++ b/roles/dev_deploy/templates/build_node.yml.j2 @@ -5,18 +5,15 @@ jwt_token: "{{ albs_jwt_token }}" pulp_host: "http://pulp" pulp_user: "{{ pulp_user }}" pulp_password: "{{ pulp_password }}" -{% if immudb_username is defined %} -immudb_username: {{ immudb_username }} +{% if immudb_address is defined and immudb_address %} +immudb_address: "{{ immudb_address }}" {% endif %} -{% if immudb_password is defined %} -immudb_password: {{ immudb_password }} +{% if immudb_database is defined and immudb_database %} +immudb_database: "{{ immudb_database }}" {% endif %} -{% if immudb_database is defined %} -immudb_database: {{ immudb_database }} +{% if immudb_username is defined and immudb_username %} +immudb_username: "{{ immudb_username }}" {% endif %} -{% if immudb_address is defined %} -immudb_address: {{ immudb_address }} -{% endif %} -{% if immudb_public_key_file is defined %} -immudb_public_key_file: {{ immudb_public_key_file }} +{% if immudb_password is defined and immudb_password %} +immudb_password: "{{ immudb_password }}" {% endif %} diff --git a/roles/separate_build_node/tasks/create_env.yml b/roles/separate_build_node/tasks/create_env.yml index f057752..74524b9 100644 --- a/roles/separate_build_node/tasks/create_env.yml +++ b/roles/separate_build_node/tasks/create_env.yml @@ -3,7 +3,7 @@ - name: Create service user user: name: "{{ service_user }}" - groups: wheel + groups: wheel, mock append: yes state: present create_home: yes diff --git a/roles/separate_build_node/tasks/dnf.yml b/roles/separate_build_node/tasks/dnf.yml index 08878f3..721024f 100644 --- a/roles/separate_build_node/tasks/dnf.yml +++ b/roles/separate_build_node/tasks/dnf.yml @@ -1,4 +1,5 @@ --- + - name: Update system packages dnf: name: "*" @@ -31,6 +32,6 @@ enablerepo: - "epel" - "buildnode" - - "powertools" + - "{{ powertools_repository_name }}" update_cache: yes ... diff --git a/roles/separate_build_node/templates/build_node.j2 b/roles/separate_build_node/templates/build_node.j2 index 6607d07..59ff254 100644 --- a/roles/separate_build_node/templates/build_node.j2 +++ b/roles/separate_build_node/templates/build_node.j2 @@ -1,20 +1,20 @@ --- +master_url: "{{ albs_api_url }}" +base_arch: "{{ machine_arch }}" threads_count: {{ threads_count | default(4) }} jwt_token: "{{ albs_jwt_token }}" +pulp_host: "{{ pulp_host }}" pulp_user: "{{ pulp_user }}" pulp_password: "{{ pulp_password }}" -{% if immudb_username is defined %} -immudb_username: {{ immudb_username }} +{% if immudb_address is defined and immudb_address %} +immudb_address: "{{ immudb_address }}" {% endif %} -{% if immudb_password is defined %} -immudb_password: {{ immudb_password }} +{% if immudb_database is defined and immudb_database %} +immudb_database: "{{ immudb_database }}" {% endif %} -{% if immudb_database is defined %} -immudb_database: {{ immudb_database }} -{% endif %} -{% if immudb_address is defined %} -immudb_address: {{ immudb_address }} -{% endif %} -{% if immudb_public_key_file is defined %} -immudb_public_key_file: {{ immudb_public_key_file }} +{% if immudb_username is defined and immudb_username %} +immudb_username: "{{ immudb_username }}" {% endif %} +{% if immudb_password is defined and immudb_password %} +immudb_password: "{{ immudb_password }}" +{% endif %} \ No newline at end of file diff --git a/roles/separate_sign_node/templates/sign_node.yml.j2 b/roles/separate_sign_node/templates/sign_node.yml.j2 index 0eb0434..05af570 100644 --- a/roles/separate_sign_node/templates/sign_node.yml.j2 +++ b/roles/separate_sign_node/templates/sign_node.yml.j2 @@ -8,18 +8,15 @@ development_mode: true dev_pgp_key_password: "{{ gpg_default_password }}" master_url: "http://{{ albs_address }}:8080/api/v1/" ws_master_url: "ws://{{ albs_address }}:8080/api/v1/" -{% if immudb_username is defined %} -immudb_username: {{ immudb_username }} +{% if immudb_address is defined and immudb_address %} +immudb_address: "{{ immudb_address }}" {% endif %} -{% if immudb_password is defined %} -immudb_password: {{ immudb_password }} +{% if immudb_database is defined and immudb_database %} +immudb_database: "{{ immudb_database }}" {% endif %} -{% if immudb_database is defined %} -immudb_database: {{ immudb_database }} +{% if immudb_username is defined and immudb_username %} +immudb_username: "{{ immudb_username }}" {% endif %} -{% if immudb_address is defined %} -immudb_address: {{ immudb_address }} -{% endif %} -{% if immudb_public_key_file is defined %} -immudb_public_key_file: {{ immudb_public_key_file }} +{% if immudb_password is defined and immudb_password %} +immudb_password: "{{ immudb_password }}" {% endif %}