summaryrefslogtreecommitdiffstats
path: root/docker/docker_tools/chef-solo/cookbooks
diff options
context:
space:
mode:
authorStone, Avi (as206k) <as206k@att.com>2018-05-17 10:25:42 +0300
committerStone, Avi (as206k) <as206k@att.com>2018-05-17 10:25:42 +0300
commit530230e2299a1c78a79779ac03b0bbcf58260480 (patch)
tree45c1f52f85e618905cc4e9d27f3673e74302a699 /docker/docker_tools/chef-solo/cookbooks
parentc2a0c564d29df7f09e83e53ba9252dfab0db59f9 (diff)
Add docker files
Adding docker files so the docker job would run Change-Id: I7db917d261d480e28a51ff222f12422803b395e8 Issue-ID: SDC-1339 Signed-off-by: Stone, Avi (as206k) <as206k@att.com>
Diffstat (limited to 'docker/docker_tools/chef-solo/cookbooks')
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.gitignore20
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.kitchen.yml16
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/README.md4
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/attributes/default.rb7
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/files/default/config.json207
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/metadata.rb7
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/recipes/dcae_tools_setup.rb47
-rw-r--r--docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/templates/default/environment.json.erb12
8 files changed, 320 insertions, 0 deletions
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.gitignore b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.gitignore
new file mode 100644
index 0000000..b31c0d3
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.gitignore
@@ -0,0 +1,20 @@
+.vagrant
+Berksfile.lock
+*~
+*#
+.#*
+\#*#
+.*.sw[a-z]
+*.un~
+
+# Bundler
+Gemfile.lock
+bin/*
+.bundle/*
+
+.kitchen/
+.kitchen.local.yml
+
+######### Private
+run.me
+DCAE-CI01.json
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.kitchen.yml b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.kitchen.yml
new file mode 100644
index 0000000..37d2844
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/.kitchen.yml
@@ -0,0 +1,16 @@
+---
+driver:
+ name: vagrant
+
+provisioner:
+ name: chef_zero
+
+platforms:
+ - name: ubuntu-16.04
+ - name: centos-7.1
+
+suites:
+ - name: default
+ run_list:
+ - recipe[Deploy-DCAE::default]
+ attributes:
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/README.md b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/README.md
new file mode 100644
index 0000000..27aba53
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/README.md
@@ -0,0 +1,4 @@
+# Deploy-DCAE
+
+TODO: Enter the cookbook description here.
+
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/attributes/default.rb b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/attributes/default.rb
new file mode 100644
index 0000000..b774969
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/attributes/default.rb
@@ -0,0 +1,7 @@
+default['WORKSPACE_DIR'] = "/var/opt/dcae-tools/app"
+
+default['DCAE']['BE'][:http_port] = 8082
+default['DCAE']['BE'][:https_port] = 8444
+
+default['disableHttp'] = true
+
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/files/default/config.json b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/files/default/config.json
new file mode 100644
index 0000000..a243dc7
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/files/default/config.json
@@ -0,0 +1,207 @@
+{
+ "templateInfo": [{
+ "name": "Syslog Collector Template",
+ "flowType": "Syslog Collector",
+ "description": "Syslog Collector",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "SyslogCollector",
+ "alias": "Syslog"
+ }, {
+ "type": "Existing Topic",
+ "alias": "eTopic"
+ }],
+ "relations": [{
+ "fromComponent": "Syslog.SyslogCollector",
+ "fromRequirement": "stream_publish_0",
+ "toComponent": "eTopic.topic",
+ "toCapability": "topic"
+ }],
+ "nodesToDelete": [
+ {
+ "type": "SyslogCollector",
+ "nodeName": "topic0"
+ }]
+ },{
+ "name": "Syslog MSEA Template",
+ "flowType": "Syslog MSEA",
+ "description": "Syslog MSEA",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "Map",
+ "alias": "Map"
+ }, {
+ "type": "Supplement",
+ "alias": "Sup"
+ }, {
+ "type": "Enrich",
+ "alias": "Enr"
+ }, {
+ "type": "Alert",
+ "alias": "Ale"
+ }],
+ "relations": [{
+ "fromComponent": "Sup.Supplement",
+ "fromRequirement": "dependency",
+ "toComponent": "Map.Map",
+ "toCapability": "feature"
+ },{
+ "fromComponent": "Enr.Enrich",
+ "fromRequirement": "dependency",
+ "toComponent": "Sup.Supplement",
+ "toCapability": "feature"
+ },{
+ "fromComponent": "Ale.Alert",
+ "fromRequirement": "dependency",
+ "toComponent": "Enr.Enrich",
+ "toCapability": "feature"
+ }]
+ },{
+ "name": "Status Poller Collector Template",
+ "flowType": "Status Poller Collector",
+ "description": "Status Poller Collector",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "StatusPoller",
+ "alias": "sPoller"
+ }, {
+ "type": "Existing Topic",
+ "alias": "eTopic0"
+ }],
+ "relations": [{
+ "fromComponent": "sPoller.StatusPoller",
+ "fromRequirement": "stream_publish_0",
+ "toComponent": "eTopic0.topic",
+ "toCapability": "topic"
+ }],
+ "nodesToDelete": [
+ {
+ "type": "StatusPoller",
+ "nodeName": "topic0"
+ }]
+ }, {
+ "name": "Status Poller MSE Template",
+ "flowType": "Status Poller MSE",
+ "description": "Status Poller MSE",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "Map",
+ "alias": "Map"
+ }, {
+ "type": "Supplement",
+ "alias": "Sup"
+ }, {
+ "type": "Enrich",
+ "alias": "Enr"
+ }],
+ "relations": [{
+ "fromComponent": "Sup.Supplement",
+ "fromRequirement": "dependency",
+ "toComponent": "Map.Map",
+ "toCapability": "feature"
+ },{
+ "fromComponent": "Enr.Enrich",
+ "fromRequirement": "dependency",
+ "toComponent": "Sup.Supplement",
+ "toCapability": "feature"
+ }]
+ }, {
+ "name": "FOI Collector Template",
+ "flowType": "FOI Collector",
+ "description": "FOI Collector",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "FOICollector",
+ "alias": "fCollector"
+ }, {
+ "type": "Existing Feed",
+ "alias": "eFeed"
+ }],
+ "relations": [{
+ "fromComponent": "fCollector.FoiSftp",
+ "fromRequirement": "stream_publish_0",
+ "toComponent": "eFeed.feed",
+ "toCapability": "feed"
+ }],
+ "nodesToDelete": [
+ {
+ "type": "FOICollector",
+ "nodeName": "feed0"
+ }]
+ }, {
+ "name": "SNMP MSE Template",
+ "flowType": "SNMP MSE",
+ "description": "SNMP MSE",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "Map",
+ "alias": "Map"
+ }, {
+ "type": "Supplement",
+ "alias": "Sup"
+ }, {
+ "type": "Enrich",
+ "alias": "Enr"
+ }],
+ "relations": [{
+ "fromComponent": "Sup.Supplement",
+ "fromRequirement": "dependency",
+ "toComponent": "Map.Map",
+ "toCapability": "feature"
+ },{
+ "fromComponent": "Enr.Enrich",
+ "fromRequirement": "dependency",
+ "toComponent": "Sup.Supplement",
+ "toCapability": "feature"
+ }]
+ }, {
+ "name": "Docker Map Template",
+ "flowType": "Docker Map",
+ "description": "Docker Map",
+ "category": "Template",
+ "subCategory":"Base Monitoring Template",
+ "updateIfExist": "false",
+ "composition": [{
+ "type": "DockerMap",
+ "alias": "dMp"
+ }, {
+ "type": "Existing Feed",
+ "alias": "eFeed"
+ }, {
+ "type": "Existing Topic",
+ "alias": "eTopic"
+ }],
+ "relations": [{
+ "fromComponent": "dMp.DockerMap",
+ "fromRequirement": "stream_subscribe_0",
+ "toComponent": "eFeed.feed",
+ "toCapability": "feed"
+ }, {
+ "fromComponent": "dMp.DockerMap",
+ "fromRequirement": "stream_publish_0",
+ "toComponent": "eTopic.topic",
+ "toCapability": "topic"
+ }],
+ "nodesToDelete": [
+ {
+ "type": "DockerMap",
+ "nodeName": "feed0"
+ },
+ {
+ "type": "DockerMap",
+ "nodeName": "topic0"
+ }]
+ }]
+} \ No newline at end of file
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/metadata.rb b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/metadata.rb
new file mode 100644
index 0000000..7935c22
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/metadata.rb
@@ -0,0 +1,7 @@
+name 'Deploy-DCAE'
+maintainer 'The Authors'
+maintainer_email 'you@example.com'
+license 'all_rights'
+description 'Installs/Configures Deploy-DCAE'
+long_description 'Installs/Configures Deploy-DCAE'
+version '1.0.0'
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/recipes/dcae_tools_setup.rb b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/recipes/dcae_tools_setup.rb
new file mode 100644
index 0000000..152def2
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/recipes/dcae_tools_setup.rb
@@ -0,0 +1,47 @@
+workspace_dir = "#{node['WORKSPACE_DIR']}"
+
+dcae_be_host = node['DCAE_BE_VIP']
+
+if node['disableHttp']
+ protocol = "https"
+ dcae_be_port = node['DCAE']['BE'][:https_port]
+else
+ protocol = "http"
+ dcae_be_port = node['DCAE']['BE'][:http_port]
+end
+
+printf("DEBUG: [%s]:[%s] disableHttp=[%s], protocol=[%s], dcae_be_vip=[%s], dcae_be_port=[%s] !!! \n", cookbook_name, recipe_name, node['disableHttp'], protocol, dcae_be_host ,dcae_be_port )
+
+
+directory "#{workspace_dir}/conf" do
+ mode '0755'
+ owner "dcae"
+ group "dcae"
+ recursive true
+ action :create
+end
+
+
+template "dcae-tools-config-yaml" do
+ sensitive true
+ path "/#{workspace_dir}/conf/environment.json"
+ source "environment.json.erb"
+ mode "0755"
+ owner "dcae"
+ group "dcae"
+ variables ({
+ :dcae_be_host => dcae_be_host,
+ :dcae_be_port => dcae_be_port,
+ :protocol => protocol
+ })
+end
+
+
+cookbook_file "/#{workspace_dir}/conf/config.json" do
+ sensitive true
+ source "config.json"
+ owner "dcae"
+ group "dcae"
+ mode "0755"
+ action :create
+end
diff --git a/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/templates/default/environment.json.erb b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/templates/default/environment.json.erb
new file mode 100644
index 0000000..a792cf9
--- /dev/null
+++ b/docker/docker_tools/chef-solo/cookbooks/Deploy-DCAE/templates/default/environment.json.erb
@@ -0,0 +1,12 @@
+{
+ "dcaeBeHost": "<%= @protocol %>://<%= @dcae_be_host %>",
+ "dcaeBePort": "<%= @dcae_be_port %>",
+ "apiPath": "/dcae",
+ "credential" :{
+ "editor": "Carlos_Santana",
+ "username": "cs0008",
+ "password": "",
+ "firstName": "",
+ "lastName": ""
+ }
+} \ No newline at end of file