diff options
author | bhoopender.singh@t-systems.com <bhoopender.singh@t-systems.com> | 2025-01-19 21:56:17 +0100 |
---|---|---|
committer | Bhoopender singh <bhoopender.singh@t-systems.com> | 2025-01-20 11:00:47 +0000 |
commit | 7529a63846644ae84d33b8c0588f24fb258f27d5 (patch) | |
tree | 93384362a0c2b8f057254a66bc0b5a06352ed3d4 /catalog-be/sdc-backend-init/chef-repo | |
parent | 1ae1d02db27d1971162d162468614fec8017ce69 (diff) |
- Removal of Chef recipes in the module.
- Introduction of shell scripts in the module to replace some recipes.
- Generation of module configuration using Charts.
- Introduction of config files in integration tests to simulate files generated by Charts in the module.
Issue-ID: SDC-4697
Change-Id: Ib7e1e3432437d1857403dfb5d16dd95187934129
Signed-off-by: bhoopender.singh@t-systems.com <bhoopender.singh@t-systems.com>
Diffstat (limited to 'catalog-be/sdc-backend-init/chef-repo')
4 files changed, 0 insertions, 133 deletions
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/attributes/default.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/attributes/default.rb deleted file mode 100644 index 682885312e..0000000000 --- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/attributes/default.rb +++ /dev/null @@ -1,5 +0,0 @@ -#BasicAuth -default['basic_auth']['enabled'] = true -default['basic_auth'][:user_name] = "testName" -default['basic_auth'][:user_pass] = "testPass" - diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb deleted file mode 100644 index 5de3453bf0..0000000000 --- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'base64' -if node['disableHttp'] - protocol = "https" - https_flag = "--https" - be_port = node['BE']['https_port'] - if node['BE-init']['tls_cert'] && node['BE-init']['tls_key'] - tls_key = "--tls_key " + node['BE-init']['tls_key'] - tls_cert = "--tls_cert " + node['BE-init']['tls_cert'] - if node['BE-init']['tls_password'] - tls_key_pw = "--tls_key_pw " + node['BE-init']['tls_password'] - end - end - if node['BE-init']['ca_cert'] - ca_cert = "--ca_cert " + node['BE-init']['ca_cert'] - end -else - protocol = "http" - https_flag = "" - be_port = node['BE']['http_port'] -end - -if node['BE']['user_conf'] - user_conf_dir = "--conf " + node['BE']['user_conf'] -else - # set default user configuration file - user_conf_dir = "" -end - -if node['basic_auth'] - basic_auth_enabled = node['basic_auth']['enabled'] - basic_auth_user = node['basic_auth']['user_name'] - basic_auth_pass = node['basic_auth']['user_pass'] - if basic_auth_enabled - basic_auth_config = "--header " + Base64.strict_encode64(basic_auth_user + ":" + basic_auth_pass) - else - # set default user configuration file - basic_auth_config = "" - end -end - -execute "executing-create_users" do - command "sdcuserinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{user_conf_dir} #{https_flag} #{tls_cert} #{tls_key} #{tls_key_pw} #{ca_cert}" - action :run -end -execute "executing-create_consumers" do - command "sdcconsumerinit -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag} #{tls_cert} #{tls_key} #{tls_key_pw} #{ca_cert}" - action :run -end diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb deleted file mode 100644 index 72686111f5..0000000000 --- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'base64' -if node['disableHttp'] - protocol = "https" - https_flag = "--https" - be_port = node['BE']['https_port'] - if node['BE-init']['tls_cert'] && node['BE-init']['tls_key'] - tls_key = "--tls_key " + node['BE-init']['tls_key'] - tls_cert = "--tls_cert " + node['BE-init']['tls_cert'] - if node['BE-init']['tls_password'] - tls_key_pw = "--tls_key_pw " + node['BE-init']['tls_password'] - end - end - if node['BE-init']['ca_cert'] - ca_cert = "--ca_cert " + node['BE-init']['ca_cert'] - end -else - protocol = "http" - https_flag = "" - be_port = node['BE']['http_port'] -end - -if node['basic_auth'] - basic_auth_enabled = node['basic_auth']['enabled'] - basic_auth_user = node['basic_auth']['user_name'] - basic_auth_pass = node['basic_auth']['user_pass'] - if basic_auth_enabled - basic_auth_config = "--header " + Base64.strict_encode64(basic_auth_user + ":" + basic_auth_pass) - else - # set default user configuration file - basic_auth_config = "" - end -end - -execute "executing-check_backend_health" do - command "sdccheckbackend -i #{node['Nodes']['BE']} -p #{be_port} #{basic_auth_config} #{https_flag} #{tls_cert} #{tls_key} #{tls_key_pw} #{ca_cert}" - action :run -end diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb deleted file mode 100644 index cb36ffdc3d..0000000000 --- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb +++ /dev/null @@ -1,43 +0,0 @@ -require 'base64' -be_ip=node['Nodes'][:BE] - -if node['disableHttp'] - protocol = "https" - be_port = node['BE']['https_port'] - param="-i #{be_ip} -p #{be_port} --https" - if node['BE-init']['tls_cert'] && node['BE-init']['tls_key'] - tls_key = "--tls_key " + node['BE-init']['tls_key'] - tls_cert = "--tls_cert " + node['BE-init']['tls_cert'] - if node['BE-init']['tls_password'] - tls_key_pw = "--tls_key_pw " + node['BE-init']['tls_password'] - end - end - if node['BE-init']['ca_cert'] - ca_cert = "--ca_cert " + node['BE-init']['ca_cert'] - end -else - protocol = "http" - be_port = node['BE']['http_port'] - param="-i #{be_ip} -p #{be_port}" -end - -if node['basic_auth'] - basic_auth_enabled = node['basic_auth']['enabled'] - basic_auth_user = node['basic_auth']['user_name'] - basic_auth_pass = node['basic_auth']['user_pass'] - if basic_auth_enabled - basic_auth_config = "--header " + Base64.strict_encode64(basic_auth_user + ":" + basic_auth_pass) - else - # set default user configuration file - basic_auth_config = "" - end -end -cookbook_file "/var/tmp/normatives.tar.gz" do - source "normatives.tar.gz" -end - -execute "create-jetty-modules" do - command "set -ex && tar -xvf normatives.tar.gz && cd /var/tmp/normatives/import/tosca && sdcinit #{param} #{basic_auth_config} #{tls_cert} #{tls_key} #{tls_key_pw} #{ca_cert} > #{ENV['ONAP_LOG']}/init.log" - cwd "/var/tmp/" - action :run -end |