summaryrefslogtreecommitdiffstats
path: root/TOSCA/VM/appc/appc.yaml
blob: ddc78f81d4d19d64f9d35d6efd2b99cae0ce7a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
###########################################################
# This Blueprint installs ONAP appc on Openstack
###########################################################
 
tosca_definitions_version: cloudify_dsl_1_3
 
description: >
  This blueprint creates a ONAP APP-C
 
imports:
  - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml
  - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml
  - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml
  - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml

inputs:
  nexus_repo:
    type: string
    default: https://nexus.onap.org/content/sites/raw
    
  docker_repo:
    type: string
    default: nexus3.onap.org:10001

  nexus_username:
    type: string
    default: docker

  nexus_password:
    type: string
    default: docker
  
  artifacts_version:  
    type: string
    default: 1.1.0-SNAPSHOT 

  dns_ip:
    type: string

  cloud_env:
    type: string
    default: openstack

  docker_version:
    type: string
    default: v1.2.0

  gerrit_branch:
    type: string
    default: master
   
  external_dns:
    type: string
    
  dmaap_topic:
    type: string
    default: AUTO   
    
  appc_repo:
    type: string
    default: http://gerrit.onap.org/r/appc/deployment.git  
    
  vm_instancename:
    type: string
    
  image:
    description: |
      A Ubuntu 14.04 image, along with the usual
    type:  string
    default: Ubuntu 14.04 LTS Generic
 
  flavor:
    description: >
      A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space.
      You might want to use 4 CPUs, 8192 MB RAM for the master.
    type:  string
    default: m1.xlarge
 
  ssh_user:
    description: |
      User for connecting to agent VM
    type:  string
    default: ubuntu

  security_group:
    description: openstack security_group
    type:  string
 
  keypair_name:
    description: | 
      OpenStack keypair name 
    type: string
  
  key_filename:
    type:  string
 
  external_network:
    type:  string
    
  app_subnet:
    type:  string
    
 
  openstack_username:
    type: string
    description: username to authenticate to OpenStack
 
  openstack_password:
    type: string
    description: OpenStack tenant password for openstack_username user
 
  openstack_tenant_name:
    type: string
    description: OpenStack tenant for VM deploy
 
  openstack_auth_url:
    type: string
    description: Authentication URL for OpenStack
 
  openstack_region:
    type: string
    description: OpenStack region
   
  dgbuilder_docker:
    type: string
    default: v0.1.0
  
dsl_definitions:
  openstack_credentials:  &openstack_credentials
    username:  { get_input: openstack_username }
    password:  { get_input: openstack_password }
    tenant_name:  { get_input: openstack_tenant_name }
    auth_url:  { get_input: openstack_auth_url }
    region:  { get_input: openstack_region }
 
node_templates:

  key_pair:
    type: cloudify.openstack.nodes.KeyPair
    properties:
      private_key_path: { get_input: key_filename }
      use_external_resource: true
      resource_id: { get_input:  keypair_name }
      openstack_config:  *openstack_credentials

  private_net:
    type: cloudify.openstack.nodes.Network
    properties:
      use_external_resource:  true
      resource_id: { get_input:  app_subnet }
      openstack_config: *openstack_credentials
      
  external_network:
    type: cloudify.openstack.nodes.Network
    properties:
      openstack_config: *openstack_credentials
      use_external_resource: true
      resource_id: { get_input: external_network}     

  app_security_group:
    type: cloudify.openstack.nodes.SecurityGroup
    properties:
      openstack_config: *openstack_credentials
      use_external_resource:  true
      resource_id: { get_input: security_group }

  VM_001_fixed_ip:
    type: cloudify.openstack.nodes.Port
    properties:
      openstack_config: *openstack_credentials
    relationships:
      - type: cloudify.relationships.contained_in
        target: private_net
      - type: cloudify.openstack.port_connected_to_security_group
        target: app_security_group

  VM_001_floating_ip:
    type: cloudify.openstack.nodes.FloatingIP
    properties:
      openstack_config: *openstack_credentials
    interfaces:
      cloudify.interfaces.lifecycle:
        create:
          inputs:
            args:
              floating_network_name: { get_input:  external_network }
 
  VM_001:
    type: cloudify.openstack.nodes.Server
    properties:
      openstack_config: *openstack_credentials
      install_agent:  false
      image: { get_input: image }
      flavor: { get_input: flavor }
      resource_id: { get_input: vm_instancename }
      management_network_name:  { get_input: app_subnet }
      ip:  { get_attribute: [VM_001_floating_ip, floating_ip_address]  }
    relationships:
      - type: cloudify.openstack.server_connected_to_floating_ip
        target: VM_001_floating_ip
      - type: cloudify.openstack.server_connected_to_keypair
        target: key_pair
      - type: cloudify.openstack.server_connected_to_port
        target:  VM_001_fixed_ip

 
  app_001:
    type: cloudify.nodes.SoftwareComponent
    properties:
    interfaces:
      cloudify.interfaces.lifecycle:
         start:
          implementation: fabric.fabric_plugin.tasks.run_script
          inputs:
            script_path: scripts/appc.sh
            use_sudo: true
            process:
              args: 
                [{ get_attribute: [VM_001_floating_ip, floating_ip_address]},
                 { get_attribute: [VM_001_fixed_ip, fixed_ip_address]},
                 { get_input: nexus_repo },
                 { get_input: docker_repo},
                 { get_input: nexus_username },
                 { get_input: nexus_password },
                 { get_input: artifacts_version },
                 { get_input: dns_ip},
                 { get_input: gerrit_branch },
                 openstack,
                 { get_input: external_dns},
                 { get_input: dmaap_topic},
                 { get_input: openstack_username},
                 { get_input: openstack_tenant_name},
                 { get_input: openstack_password},
                 { get_input: openstack_region},
                 { get_input: openstack_auth_url},
                 { get_input: appc_repo},
                 { get_input: docker_version },
                 { get_input: dgbuilder_docker}]
            fabric_env:
              host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]}
              user: { get_input: ssh_user }
              key_filename: { get_input: key_filename }
    relationships:
      - type: cloudify.relationships.contained_in
        target: VM_001
      - type: cloudify.relationships.depends_on
        target: VM_001_floating_ip

outputs:
  ONAP_Appc:
    description: informations about app-c
    value:
      ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] }