|
| 1 | +tosca_definitions_version: cloudify_dsl_1_3 |
| 2 | + |
| 3 | +imports: |
| 4 | + - http://www.getcloudify.org/spec/cloudify/4.4/types.yaml |
| 5 | + - http://www.getcloudify.org/spec/openstack-plugin/2.9.6/plugin.yaml |
| 6 | + |
| 7 | +inputs: |
| 8 | + |
| 9 | + username: |
| 10 | + description: OS_USERNAME as specified in Openstack RC file. |
| 11 | + |
| 12 | + password: |
| 13 | + description: Openstack user password. |
| 14 | + |
| 15 | + tenant_name: |
| 16 | + description: OS_TENANT_NAME as specified in Openstack RC file. |
| 17 | + |
| 18 | + auth_url: |
| 19 | + description: OS_AUTH_URL as specified in Openstack RC file. |
| 20 | + |
| 21 | + region: |
| 22 | + description: OS_REGION_NAME as specified in Openstack RC file. |
| 23 | + |
| 24 | + external_network_name: |
| 25 | + description: Openstack tenant external network name. |
| 26 | + |
| 27 | + key_name: |
| 28 | + type: string |
| 29 | + |
| 30 | + ipv4_nameservers: |
| 31 | + default: |
| 32 | + - 8.8.4.4 |
| 33 | + - 8.8.8.8 |
| 34 | + |
| 35 | + ipv4_subnet_cidr: |
| 36 | + default: 192.168.120.0/24 |
| 37 | + |
| 38 | + ipv4_allocation_pools: |
| 39 | + default: |
| 40 | + - start: 192.168.120.2 |
| 41 | + end: 192.168.120.254 |
| 42 | + |
| 43 | + ipv6_nameservers: |
| 44 | + default: |
| 45 | + - 2001:4860:4860::8888 |
| 46 | + - 2001:4860:4860::8844 |
| 47 | + |
| 48 | + ipv6_subnet_cidr: |
| 49 | + default: 2605:1c00:50f2:2207::/64 |
| 50 | + |
| 51 | + ipv6_allocation_pools: |
| 52 | + default: |
| 53 | + - start: 2605:1c00:50f2:2207::64 |
| 54 | + end: 2605:1c00:50f2:2207:ffff:ffff:ffff:ff |
| 55 | + |
| 56 | + large_image_flavor: |
| 57 | + type: string |
| 58 | + |
| 59 | + cloudify_image_username: |
| 60 | + default: centos |
| 61 | + |
| 62 | + centos_core_image: |
| 63 | + type: string |
| 64 | + |
| 65 | +dsl_definitions: |
| 66 | + |
| 67 | + client_config: &client_config |
| 68 | + username: { get_input: username } |
| 69 | + password: { get_input: password } |
| 70 | + tenant_name: { get_input: tenant_name } |
| 71 | + auth_url: { get_input: auth_url } |
| 72 | + region: { get_input: region } |
| 73 | + |
| 74 | +node_templates: |
| 75 | + |
| 76 | + external_network: |
| 77 | + type: cloudify.openstack.nodes.Network |
| 78 | + properties: |
| 79 | + openstack_config: *client_config |
| 80 | + use_external_resource: true |
| 81 | + resource_id: { get_input: external_network_name } |
| 82 | + |
| 83 | + router: |
| 84 | + type: cloudify.openstack.nodes.Router |
| 85 | + properties: |
| 86 | + openstack_config: *client_config |
| 87 | + relationships: |
| 88 | + - type: cloudify.relationships.connected_to |
| 89 | + target: external_network |
| 90 | + |
| 91 | + network: |
| 92 | + type: cloudify.openstack.nodes.Network |
| 93 | + properties: |
| 94 | + openstack_config: *client_config |
| 95 | + |
| 96 | + ipv4_subnet: |
| 97 | + type: cloudify.openstack.nodes.Subnet |
| 98 | + properties: |
| 99 | + openstack_config: *client_config |
| 100 | + subnet: |
| 101 | + ip_version: 4 |
| 102 | + cidr: { get_input: ipv4_subnet_cidr } |
| 103 | + dns_nameservers: { get_input: ipv4_nameservers } |
| 104 | + allocation_pools: { get_input: ipv4_allocation_pools } |
| 105 | + relationships: |
| 106 | + - type: cloudify.relationships.contained_in |
| 107 | + target: network |
| 108 | + - type: cloudify.openstack.subnet_connected_to_router |
| 109 | + target: router |
| 110 | + |
| 111 | + ipv6_subnet: |
| 112 | + type: cloudify.openstack.nodes.Subnet |
| 113 | + properties: |
| 114 | + openstack_config: *client_config |
| 115 | + subnet: |
| 116 | + ip_version: 6 |
| 117 | + cidr: { get_input: ipv6_subnet_cidr } |
| 118 | + dns_nameservers: { get_input: ipv6_nameservers } |
| 119 | + allocation_pools: { get_input: ipv6_allocation_pools } |
| 120 | + relationships: |
| 121 | + - type: cloudify.relationships.contained_in |
| 122 | + target: network |
| 123 | + |
| 124 | + cloudify_security_group: |
| 125 | + type: cloudify.openstack.nodes.SecurityGroup |
| 126 | + properties: |
| 127 | + openstack_config: *client_config |
| 128 | + rules: |
| 129 | + - remote_ip_prefix: 0.0.0.0/0 |
| 130 | + port_range_min: null |
| 131 | + port_range_max: null |
| 132 | + protocol: icmp |
| 133 | + - remote_ip_prefix: 0.0.0.0/0 |
| 134 | + port_range_min: 22 |
| 135 | + port_range_max: 22 |
| 136 | + protocol: tcp |
| 137 | + |
| 138 | + ipv4_port: |
| 139 | + type: cloudify.openstack.nodes.Port |
| 140 | + properties: |
| 141 | + openstack_config: *client_config |
| 142 | + relationships: |
| 143 | + - type: cloudify.relationships.contained_in |
| 144 | + target: network |
| 145 | + - type: cloudify.relationships.depends_on |
| 146 | + target: ipv4_subnet |
| 147 | + - type: cloudify.openstack.port_connected_to_security_group |
| 148 | + target: cloudify_security_group |
| 149 | + |
| 150 | + ipv6_port: |
| 151 | + type: cloudify.openstack.nodes.Port |
| 152 | + properties: |
| 153 | + openstack_config: *client_config |
| 154 | + relationships: |
| 155 | + - type: cloudify.relationships.contained_in |
| 156 | + target: network |
| 157 | + - type: cloudify.relationships.depends_on |
| 158 | + target: ipv6_subnet |
| 159 | + - type: cloudify.openstack.port_connected_to_security_group |
| 160 | + target: cloudify_security_group |
| 161 | + |
| 162 | + host: |
| 163 | + type: cloudify.openstack.nodes.Server |
| 164 | + properties: |
| 165 | + openstack_config: *client_config |
| 166 | + agent_config: |
| 167 | + install_method: none |
| 168 | + server: |
| 169 | + key_name: { get_input: key_name } |
| 170 | + image: { get_input: centos_core_image } |
| 171 | + flavor: { get_input: large_image_flavor } |
| 172 | + relationships: |
| 173 | + - type: cloudify.openstack.server_connected_to_port |
| 174 | + target: ipv4_port |
| 175 | + - type: cloudify.openstack.server_connected_to_port |
| 176 | + target: ipv6_port |
0 commit comments