summaryrefslogtreecommitdiffstats
path: root/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes
diff options
context:
space:
mode:
Diffstat (limited to 'asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes')
-rw-r--r--asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb11
-rw-r--r--asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb25
-rw-r--r--asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb31
-rw-r--r--asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb17
4 files changed, 29 insertions, 55 deletions
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
index 84b0cb2b40..3c67715922 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb
@@ -11,9 +11,8 @@ template "/tmp/create_cassandra_user.sh" do
})
end
-
-bash "create-sdc-user" do
- code <<-EOH
- cd /tmp ; /tmp/create_cassandra_user.sh
- EOH
-end
+execute "create-sdc-user" do
+ command "/tmp/create_cassandra_user.sh"
+ cwd "/tmp/"
+ action :run
+end \ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
index 38de1e8844..5f740a8909 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
@@ -19,21 +19,16 @@ remote_directory '/tmp/tools' do
action :create
end
-
-bash "onboard-db-schema-creation" do
+execute "onboard-db-schema-creation" do
ignore_failure true
- code <<-EOH
- cd /tmp/tools/build/scripts
- chmod +x onboard-db-schema-creation.sh
- bash /tmp/tools/build/scripts/onboard-db-schema-creation.sh
- EOH
+ command "chmod +x onboard-db-schema-creation.sh && sh -x /tmp/tools/build/scripts/onboard-db-schema-creation.sh"
+ cwd "/tmp/tools/build/scripts"
+ action :run
end
-
-bash "create-DOX-schema" do
+
+execute "create-DOX-schema" do
ignore_failure true
- code <<-EOH
- cd /tmp
- chmod +x /tmp/create_dox_keyspace.sh
- /tmp/create_dox_keyspace.sh
- EOH
-end
+ command "chmod +x /tmp/create_dox_keyspace.sh && /tmp/create_dox_keyspace.sh"
+ cwd "/tmp"
+ action :run
+end \ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
index a62550eeae..e60740fb3d 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb
@@ -3,15 +3,12 @@ cookbook_file "/tmp/sdctool.tar" do
mode 0755
end
-## extract sdctool.tar
-bash "install tar" do
+execute "install tar" do
+ command "/bin/tar xf /tmp/sdctool.tar -C /tmp"
cwd "/tmp"
- code <<-EOH
- /bin/tar xf /tmp/sdctool.tar -C /tmp
- EOH
+ action :run
end
-
template "janusgraph.properties" do
sensitive true
path "/tmp/sdctool/config/janusgraph.properties"
@@ -49,19 +46,13 @@ template "/tmp/sdctool/config/configuration.yaml" do
})
end
-
-
-bash "executing-schema-creation" do
- code <<-EOH
- cd /tmp
- chmod +x /tmp/sdctool/scripts/schemaCreation.sh
- /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
- EOH
+execute "executing-schema-creation" do
+ command "chmod +x /tmp/sdctool/scripts/schemaCreation.sh && /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config"
+ cwd "/tmp"
+ action :run
end
-bash "executing-janusGraphSchemaCreation.sh" do
- code <<-EOH
- chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh
- /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config
- EOH
-end
+execute "executing-janusGraphSchemaCreation.sh" do
+ command "chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh && /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config"
+ action :run
+end \ No newline at end of file
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
index 0490c89668..8c2ee505be 100644
--- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
+++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importConformance.rb
@@ -2,19 +2,8 @@ working_directory = "/tmp"
cl_release=node['version'].split('.')[0..2].join('.').split('-')[0]
printf("\033[33mcl_release=[%s]\n\033[0m", cl_release)
-
-
-bash "import-Conformance" do
+execute "import-Conformance" do
+ command "conf_dir=/tmp/sdctool/config && tosca_dir=/tmp/sdctool/tosca && cl_version=`grep 'toscaConformanceLevel:' $conf_dir/configuration.yaml |awk '{print $2}'` && cd /tmp/sdctool/scripts && /bin/chmod +x sdcSchemaFileImport.sh && echo \"execute /tmp/sdctool/scripts/sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap\" && ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap"
cwd "#{working_directory}"
- code <<-EOH
- conf_dir=/tmp/sdctool/config
- tosca_dir=/tmp/sdctool/tosca
-
- cl_version=`grep 'toscaConformanceLevel:' $conf_dir/configuration.yaml |awk '{print $2}'`
-
- cd /tmp/sdctool/scripts
- /bin/chmod +x sdcSchemaFileImport.sh
- echo "execute /tmp/sdctool/scripts/sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap"
- ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} onap
- EOH
+ action :run
end \ No newline at end of file