diff --git a/CFY524_OIB.yaml b/CFY524_OIB.yaml new file mode 100644 index 0000000..bd450d7 --- /dev/null +++ b/CFY524_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_CFY524_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + FirstName: { get_input: customer_name } + LastName: " " + Email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/CFYManager524/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/CFYManager524/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/CFY524_Training.yaml b/CFY524_Training.yaml new file mode 100644 index 0000000..e62ae77 --- /dev/null +++ b/CFY524_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - CFY524_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY524_Vanilla.yaml b/CFY524_Vanilla.yaml new file mode 100644 index 0000000..50f4183 --- /dev/null +++ b/CFY524_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - CFY524_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY610_OIB.yaml b/CFY610_OIB.yaml new file mode 100644 index 0000000..bae4ca1 --- /dev/null +++ b/CFY610_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_CFY610_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + FirstName: { get_input: customer_name } + LastName: " " + Email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/CFYManager610/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/CFYManager610/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/CFY610_Training.yaml b/CFY610_Training.yaml new file mode 100644 index 0000000..41933a2 --- /dev/null +++ b/CFY610_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - CFY610_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY610_Vanilla.yaml b/CFY610_Vanilla.yaml new file mode 100644 index 0000000..090f32e --- /dev/null +++ b/CFY610_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - CFY610_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY620_OIB.yaml b/CFY620_OIB.yaml new file mode 100644 index 0000000..01999b4 --- /dev/null +++ b/CFY620_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_CFY620_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + firstname: { get_input: customer_name } + lastname: " " + email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/CFYManager620/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/CFYManager620/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/CFY620_Training.yaml b/CFY620_Training.yaml new file mode 100644 index 0000000..d602ad8 --- /dev/null +++ b/CFY620_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - CFY620_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY620_Vanilla.yaml b/CFY620_Vanilla.yaml new file mode 100644 index 0000000..e455507 --- /dev/null +++ b/CFY620_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - CFY620_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY621_OIB.yaml b/CFY621_OIB.yaml new file mode 100644 index 0000000..1793a34 --- /dev/null +++ b/CFY621_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_CFY621_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + firstname: { get_input: customer_name } + lastname: " " + email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/CFYManager621/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/CFYManager621/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/CFY621_Training.yaml b/CFY621_Training.yaml new file mode 100644 index 0000000..949dc9b --- /dev/null +++ b/CFY621_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - CFY621_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY621_Vanilla.yaml b/CFY621_Vanilla.yaml new file mode 100644 index 0000000..6287f52 --- /dev/null +++ b/CFY621_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - CFY621_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY631_OIB.yaml b/CFY631_OIB.yaml new file mode 100644 index 0000000..c267ecc --- /dev/null +++ b/CFY631_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_CFY631_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + firstname: { get_input: customer_name } + lastname: " " + email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/CFYManager631/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/CFYManager631/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/CFY631_Training.yaml b/CFY631_Training.yaml new file mode 100644 index 0000000..ffaa93d --- /dev/null +++ b/CFY631_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - CFY631_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/CFY631_Vanilla.yaml b/CFY631_Vanilla.yaml new file mode 100644 index 0000000..b899e5f --- /dev/null +++ b/CFY631_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - CFY631_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/WR2105_OIB.yaml b/WR2105_OIB.yaml new file mode 100644 index 0000000..bba63aa --- /dev/null +++ b/WR2105_OIB.yaml @@ -0,0 +1,317 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +imports: +# - http://www.getcloudify.org/spec/cloudify/4.2/types.yaml +# - http://www.getcloudify.org/spec/openstack-plugin/2.4.1/plugin.yaml +# - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml +# - https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.9.0/plugin.yaml + + - http://cloudify.co/spec/cloudify/5.0.5/types.yaml + - plugin:cloudify-gcp-plugin + - plugin:cloudify-utilities-plugin + - components/ovs/types.yaml + - components/CentOS7/types.yaml + - components/HubSpot/types.yaml + +inputs: + +### GCP input + region: + type: string + description: The GCP region to deploy the application in, such as europe-west1. + default: 'europe-west2' + + zone: + type: string + description: The GCP zone to deploy the application in, such as europe-west1-b. + default: 'europe-west2-a' + + network_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + subnet_name: + type: string + description: The name of your GCP Virtual Network. + default: default + + CFY_image: + type: string + description: Centos image. + default: { get_secret: GCP_WR2105_image } + + OIB_image: + type: string + description: Centos image. + default: { get_secret: GCP_OIB_image } + + + instance_type: + type: string + description: A small GCP machine type. + default: n1-standard-8 + + cfy_instance_type: + type: string + default: n1-standard-2 + + +#### instance inputs + + agent_user: + description: > + The username of the agent running on the instance created from the image. + default: 'centos' + + agent_user_private_key: + type: string + default: { get_secret: training_key_private } + + agent_user_public_key: + type: string + default: { get_secret: training_key_public } + +#### Lab inputs + customer_token: + type: string + default: "AA" + + licence: + type: string + default: { get_secret: CFYTmpLicURL } + + customer_name: + type: string + default: 'MrCustomer' + + customer_email: + type: string + default: test@cloudify.co + + hubspot_portal: + type: string + default: "1918719" + + hubspot_form: + type: string + default: 74f1a2ca-923d-4eae-aa9e-e0b810788d56 + + customer_lastname: + type: string + default: 'MrCustomerLast' + + customer_phone: + type: string + default: '+123456' + + use_analytics: + type: integer + default: 1 + + use_guides: + type: integer + default: 1 + + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + + +node_templates: + +## +## Hub spot integration +################## + + hs_registration: + type: hubspot.form.Submit + properties: + portal_id: { get_input: hubspot_portal } + form_guid: { get_input: hubspot_form } + params: + FirstName: { get_input: customer_name } + LastName: " " + Email: { get_input: customer_email } + + +## +## Servers +################## + + + + oib_server: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: OIB_image } + instance_type: { get_input: instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + cfy_manager: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: CFY_image } + instance_type: { get_input: cfy_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet +## +## GCP Networking +############ + subnet: + type: cloudify.gcp.nodes.SubNetwork + properties: + name: { get_input: subnet_name } + region: { get_input: region } + use_external_resource: true + subnet: 10.11.12.0/22 + gcp_config: *gcp_config + relationships: + - type: cloudify.gcp.relationships.contained_in_network + target: network + + network: + type: cloudify.gcp.nodes.Network + properties: + name: { get_input: network_name } + gcp_config: *gcp_config + auto_subnets: false + use_external_resource: true + +## +## SDN +################ + + sdn_sw_manager: + type: ovs.nodes.centos_vswitch + properties: + ipaddr: 10.10.25.15 + netmask: 255.255.255.0 + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_oib_server + type: ovs.relationships.vswitch_gre + + sdn_sw_oib_server: + type: ovs.nodes.centos_vswitch + properties: + use_external_resource: True + resource_id: br-mng + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + +## +## Content Related +############################## + + vpn: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/VPN/vpn_configure.sh + inputs: + public_ip: { get_attribute: [ oib_server, public_ip_address ] } + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + oib_cloudify_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/WRManager2105/manager_oib_configure.sh + inputs: + plugins: { get_input: plugins_bundle } + licence: { get_input: licence } + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: external_network + type: cloudify.relationships.depends_on + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + rproxy: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/rproxy/proxy_install-sdn.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + use_sudo: true + start: + implementation: components/rproxy/proxy_start.sh + + relationships: + - target: oib_server + type: cloudify.relationships.contained_in + + remote_access: + type: CentOS.ssh.RemotePortForward + + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: sdn_sw_manager + type: cloudify.relationships.depends_on + + external_network: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + create: + implementation: components/WRManager2105/scripts/add_external_network.sh + inputs: + public_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + private_ip: { get_attribute: [ cfy_manager , ip] } + use_sudo: true + relationships: + - target: remote_access + type: cloudify.relationships.depends_on + - target: cfy_manager + type: cloudify.relationships.contained_in + + + + analytics: + type: cloudify.nodes.ApplicationModule + capabilities: + scalable: + properties: + default_instances: { get_input: use_analytics } +# interfaces: +# cloudify.interfaces.lifecycle: +# configure: +# implementation: components/CFYManager4x/install_analytics.sh + relationships: + - target: cfy_manager + type: cloudify.relationships.contained_in + - target: oib_cloudify_config + type: cloudify.relationships.depends_on diff --git a/WR2105_Training.yaml b/WR2105_Training.yaml new file mode 100644 index 0000000..9de2be3 --- /dev/null +++ b/WR2105_Training.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + labvm_instance_type: + type: string + default: n1-standard-2 + + centos_image: + type: string + default: { get_secret : GCP_Lab_VM_Image } + +imports: + - WR2105_OIB.yaml + +dsl_definitions: + + client_config: &gcp_config + auth: { get_secret: GCPAuth } + zone: { get_input: zone } + +node_templates: + + labvm1: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + + labvm2_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm2: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm2_disk + + labvm2_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm2 + type: cloudify.relationships.contained_in + + labvm3_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm3: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm3_disk + + labvm3_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm3 + type: cloudify.relationships.contained_in + + labvm4_disk: + type: cloudify.gcp.nodes.Volume + properties: + gcp_config: *gcp_config + image: { get_input: centos_image } + size: 40 + boot: true + + labvm4: + type: cloudify.gcp.nodes.Instance + properties: + gcp_config: *gcp_config + agent_config: + network: external + key: { get_input: agent_user_private_key } + user: { get_input: agent_user } + use_public_ip: true + image_id: { get_input: centos_image } + instance_type: { get_input: labvm_instance_type } + zone: { get_input: zone } + external_ip: true + relationships: + - type: cloudify.relationships.depends_on + target: subnet + - type: cloudify.relationships.connected_to + target: labvm4_disk + + labvm4_config: + type: cloudify.nodes.ApplicationModule + interfaces: + cloudify.interfaces.lifecycle: + configure: + implementation: components/labvm/appvm_prep.sh + relationships: + - target: labvm4 + type: cloudify.relationships.contained_in + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + - title: 'Virtual Machines for Training' + open: no + items: + - name: 'CLI VM Public IP' + value: { get_attribute: [ labvm1, public_ip_address ] } + + - name: 'App1 VM IP' + value: { get_attribute: [ labvm2, public_ip_address ] } + - name: 'App1 VM Private IP' + value: { get_attribute: [ labvm2, networkInterfaces, 0, networkIP] } + + - name: 'App2 VM IP' + value: { get_attribute: [ labvm3, public_ip_address ] } + - name: 'App2 VM Private IP' + value: { get_attribute: [ labvm3, networkInterfaces, 0, networkIP ] } + + - name: 'App3 VM IP' + value: { get_attribute: [ labvm4, public_ip_address ] } + - name: 'App3 VM Private IP' + value: { get_attribute: [ labvm4, networkInterfaces, 0, networkIP ] } + + - name: 'Training VM user' + value: 'centos' + - name: 'Training VMs Private Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa' + - name: 'Training VMs Public Key' + value: 'https://s3-eu-west-1.amazonaws.com/cloudify-labs/cert/training.rsa.pub' + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/WR2105_Vanilla.yaml b/WR2105_Vanilla.yaml new file mode 100644 index 0000000..becbf83 --- /dev/null +++ b/WR2105_Vanilla.yaml @@ -0,0 +1,66 @@ +tosca_definitions_version: cloudify_dsl_1_3 + +inputs: + + + plugins_bundle: + type: string + default: { get_secret : CFY505VanillaPluginsBundle } + + + +imports: + - WR2105_OIB.yaml + + + +outputs: + + integration: + value: + manager: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/dashboard" ] } + composer: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/composer" ] } + iaas_dash: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } + vpn_file: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/vpn/client.ovpn" ] } + ssh_ip: { get_attribute: [ cfy_manager, public_ip_address ] } + osp_ip: { get_attribute: [ oib_server, public_ip_address ] } + ssh_user: "centos" + + lab_env: + description: OpenStack Cloudify Lab + value: + video: https://www.youtube.com/embed/psJhdw78kkw + suspend: false + + lab_ui_outputs: + value: + - title: 'Cloudify Manager' + open: yes + items: + - name: 'Cloudify Manager Credentials' + value: 'username: admin password: admin' + - name: 'Cloudify Manager Link' + value: { concat: ["http://" , { get_attribute: [ cfy_manager, public_ip_address ] }, "/" ] } + - name: 'CLI command' + value: { concat: ["cfy profiles use " , { get_attribute: [ cfy_manager, public_ip_address ] }, " -u admin -p admin -t default_tenant" ] } + - name: 'IP Address' + value: { get_attribute: [ cfy_manager, public_ip_address ] } + + + - title: 'VPN Configuration' + open: no + items: + - name: 'OpenVpn Configuration File' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/vpn/client.ovpn" ] } + - name: 'VPN Portal' + value: { get_attribute: [ oib_server, public_ip_address ] } + - name: 'VPN Configuration Guide' + value: 'https://cloudify.co/knowledge-base/cloudify-labs-vpn-configuration-guide/' + + - title: 'Lab OpenStack IaaS' + open: no + items: + - name: 'OpenStack Dashboard Credentials' + value: 'username: admin password: cloudify1234' + - name: 'OpenStack Dashboard' + value: { concat: ["http://" , { get_attribute: [ oib_server, public_ip_address ] }, "/dashboard" ] } diff --git a/components/CFYManager524/manager_oib_configure.sh b/components/CFYManager524/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/CFYManager524/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager524/manager_oib_rocky_configure.sh b/components/CFYManager524/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/CFYManager524/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager524/manager_vm_configure.sh b/components/CFYManager524/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/CFYManager524/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/CFYManager524/scripts/add_external_network.sh b/components/CFYManager524/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/CFYManager524/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/components/CFYManager610/manager_oib_configure.sh b/components/CFYManager610/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/CFYManager610/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager610/manager_oib_rocky_configure.sh b/components/CFYManager610/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/CFYManager610/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager610/manager_vm_configure.sh b/components/CFYManager610/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/CFYManager610/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/CFYManager610/scripts/add_external_network.sh b/components/CFYManager610/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/CFYManager610/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/components/CFYManager620/manager_oib_configure.sh b/components/CFYManager620/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/CFYManager620/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager620/manager_oib_rocky_configure.sh b/components/CFYManager620/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/CFYManager620/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager620/manager_vm_configure.sh b/components/CFYManager620/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/CFYManager620/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/CFYManager620/scripts/add_external_network.sh b/components/CFYManager620/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/CFYManager620/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/components/CFYManager621/manager_oib_configure.sh b/components/CFYManager621/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/CFYManager621/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager621/manager_oib_rocky_configure.sh b/components/CFYManager621/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/CFYManager621/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager621/manager_vm_configure.sh b/components/CFYManager621/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/CFYManager621/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/CFYManager621/scripts/add_external_network.sh b/components/CFYManager621/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/CFYManager621/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/components/CFYManager631/manager_oib_configure.sh b/components/CFYManager631/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/CFYManager631/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager631/manager_oib_rocky_configure.sh b/components/CFYManager631/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/CFYManager631/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/CFYManager631/manager_vm_configure.sh b/components/CFYManager631/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/CFYManager631/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/CFYManager631/scripts/add_external_network.sh b/components/CFYManager631/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/CFYManager631/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/components/HubSpot/templates/form_submit.yaml b/components/HubSpot/templates/form_submit.yaml index 4b23010..b172d9d 100644 --- a/components/HubSpot/templates/form_submit.yaml +++ b/components/HubSpot/templates/form_submit.yaml @@ -5,10 +5,7 @@ rest_calls: Content-Type: "application/x-www-form-urlencoded" payload_format: "urlencode" - payload: - email: "{{params['Email']}}" - firstname: "{{params['FirstName']}}" - lastname: "{{params['LastName']}}" + payload: {{ params|tojson }} response_format: raw response_expectation: diff --git a/components/HubSpot/types.yaml b/components/HubSpot/types.yaml index b2675d6..077eacc 100644 --- a/components/HubSpot/types.yaml +++ b/components/HubSpot/types.yaml @@ -19,6 +19,8 @@ node_types: inputs: template_file: default: "components/HubSpot/templates/form_submit.yaml" + prerender: + default: true params: default: form_guid: { get_property: [SELF, form_guid] } diff --git a/components/WRManager2105/manager_oib_configure.sh b/components/WRManager2105/manager_oib_configure.sh new file mode 100644 index 0000000..c3c85d1 --- /dev/null +++ b/components/WRManager2105/manager_oib_configure.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + + + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +## TODO: addroutes to init file + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +ctx logger info "checking for file server to be up" +#while ! wget --no-check-certificate https://localhost:53333/ > /dev/null 2>&1 ; do ctx logger info "Waiting file server..." ; sleep 1; done + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + + sudo -u centos cfy secret create openstack_auth_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create openstack_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_id -s 1ceb37e5-f8ee-4192-80c5-433ec52bbcad >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + + +ctx logger info "Uploading Plugins Bundle" +#sudo -u centos cfy plugins bundle-upload -p "$plugins" >> /tmp/cfy_status.txt 2>&1 + + +### TODO +ctx logger info "Checking for plugin executions" +#while cfy executions list --include-system-workflows | grep install_plugin | grep -v -e failed -e completed > /dev/null; do ctx logger info "Waiting for all workflows to finish..." ; sleep 1; done + +ctx logger info "Uploading Openstack Network Blueprint" + +#sudo -u centos cfy blueprints upload -n openstack-example-network.yaml -b "openstack-example-network" "https://storage.googleapis.com/cfylabspub/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +#sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + + + +ctx logger info "Installing Openstack Network Deployment" +#sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/WRManager2105/manager_oib_rocky_configure.sh b/components/WRManager2105/manager_oib_rocky_configure.sh new file mode 100644 index 0000000..b079635 --- /dev/null +++ b/components/WRManager2105/manager_oib_rocky_configure.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +REPO=$plugins_repo + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +ctx logger info "Setting Static routes" +sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo mv $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo mv $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + + +# create secrets +ctx logger info "Creating Secrests" +sudo -u centos cfy secret create ubuntu_trusty_image -s 05bb3a46-ca32-4032-bedd-8d7ebd5c8100 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create centos_core_image -s aee5438f-1c7c-497f-a11e-53360241cf0f >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create small_image_flavor -s 4d798e17-3439-42e1-ad22-fb956ec22b54 >> /tmp/cfy_status.txt 2>&1 & +#cfy secret create medium_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 +sudo -u centos cfy secret create medium_image_flavor -s 3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create large_image_flavor -s 62ed898b-0871-481a-9bb4-ac5f81263b33 >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create keystone_username -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_password -s 'cloudify1234' >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_tenant_name -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_url -s http://10.10.25.1:5000/v3 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create keystone_region -s RegionOne >> /tmp/cfy_status.txt 2>&1 & + +#sudo -u centos cfy secret create agent_key_private -s /etc/cloudify/.ssh/cfy-agent-kp > /tmp/cfy_status.txt 2>&1 + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file /etc/cloudify/.ssh/cfy-agent-kp.cp >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file /etc/cloudify/.ssh/cfy-agent-kp.pub >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secret create private_subnet_name -s provider_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create private_network_name -s provider >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_subnet_name -s private_subnet >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create public_network_name -s private_network >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create router_name -s router1 >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create external_network_name -s external_network >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" +sudo -u centos cfy secret create kubernetes_master_ip -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_certificate_authority_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes_master_port -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_key_data -s X >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create kubernetes-admin_client_certificate_data -s X >> /tmp/cfy_status.txt 2>&1 & + +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Uploading Plugins Bundle" +sudo -u centos cfy plugins bundle-upload -p https://storage.reading-a.openstack.memset.com:8080/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/PluginsMD/labs-plugins-bundel.tar.gz >> /tmp/cfy_status.txt 2>&1 + +cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Uploading Openstack Network Blueprint" + +sudo -u centos cfy blueprints upload -n simple-blueprint.yaml -b "openstack-example-network" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/Openstack/openstack-example-network-5.0.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Creating Openstack Network Deployment" +sudo -u centos cfy deployments create -b "openstack-example-network" "openstack-example-network" -i "external_network_name=external_network" >> /tmp/cfy_status.txt 2>&1 + +sleep 5 + +ctx logger info "Installing Openstack Network Deployment" +sudo -u centos cfy executions start install -d "openstack-example-network" >> /tmp/cfy_status.txt 2>&1 + + +ctx logger info "Script Ends" diff --git a/components/WRManager2105/manager_vm_configure.sh b/components/WRManager2105/manager_vm_configure.sh new file mode 100644 index 0000000..9132199 --- /dev/null +++ b/components/WRManager2105/manager_vm_configure.sh @@ -0,0 +1,87 @@ +#!/bin/bash + + + +# install build +ctx logger info "Installing packages" +sudo yum -y install gcc python-devel wget python-netaddr + +sudo sh -c "source /opt/mgmtworker/env/bin/activate ; pip install netaddr" + +# configure route, now and permanently +#ctx logger info "Setting Static routes" +#sudo route add -net 192.168.113.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '192.168.113.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" +#sudo route add -net 172.25.1.0/24 gw 10.10.25.253 +#sudo /bin/bash -c "echo '172.25.1.0/24 via 10.10.25.253 dev br-ovs' >> /etc/sysconfig/network" + +sudo supervisorctl restart cloudify-stage +sudo supervisorctl restart cloudify-restservice + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + + +# generate Key +ctx logger info "Generating Keys" +sudo mkdir -p /etc/cloudify/.ssh/ +sudo ssh-keygen -f /etc/cloudify/.ssh/cfy-agent-kp -N "" +sudo cp /etc/cloudify/.ssh/cfy-agent-kp /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chmod 644 /etc/cloudify/.ssh/cfy-agent-kp.cp +sudo chown cfyuser:cfyuser -R /etc/cloudify/.ssh +public_key=$(sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub) + +# add training key +training_pem=$(ctx download-resource "certs/training_vm/training.pem") +training_pub=$(ctx download-resource "certs/training_vm/training.rsa.pub") +sudo cp $training_pub "/etc/cloudify/cfy-training.rsa.pub" +sudo cp $training_pem "/etc/cloudify/cfy-training.pem" +sudo chown cfyuser:cfyuser /etc/cloudify/cfy-training* +sudo chmod 600 /etc/cloudify/cfy-training* +sudo cat /etc/cloudify/cfy-training.rsa.pub >> /home/centos/.ssh/authorized_keys + + +# Add manager key to authorized_keys for centos user +sudo cat /etc/cloudify/.ssh/cfy-agent-kp.pub >> /home/centos/.ssh/authorized_keys + +sudo -u centos cfy status >> /tmp/cfy_status.txt 2>&1 & + +#handle licence +sudo -u centos curl $licence -o /tmp/cfy_licence +sudo -u centos cfy license upload /tmp/cfy_licence +sudo -u centos rm /tmp/cfy_licence + +# create secrets +ctx logger info "Creating Secrests" + + +# Create private_key as plain secret +sudo -u centos cfy secret create agent_key_private --secret-file $training_pem >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secret create agent_key_public --secret-file $training_pub >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating k8s Secrests" + + +sudo -u centos cfy secrets create k8s_master_ip -s "${k8s_master_ip}" >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create k8s_node_ip -s "${k8s_node_ip}" >> /tmp/cfy_status.txt 2>&1 & + + +ctx logger info "Creating Deplyment Proxy Secrests" +sudo -u centos cfy secrets create cfy_user -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_password -s admin >> /tmp/cfy_status.txt 2>&1 & +sudo -u centos cfy secrets create cfy_tenant -s default_tenant >> /tmp/cfy_status.txt 2>&1 & + + +sudo -u centos cfy plugins bundle-upload >> /tmp/cfy_status.txt 2>&1 + +sleep 10 +sudo -u centos cfy blueprints upload -n baremetal.yaml -b "kubernetes-blueprint" "https://storage.reading-a.openstack.memset.com/swift/v1/ca0c4540c8f84ad3917c40b432a49df8/Blueprints/K8S/k8s.tar.gz" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy deployments create -b "kubernetes-blueprint" "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +sudo -u centos cfy executions start install -d "kubernetes" >> /tmp/cfy_status.txt 2>&1 + +ctx logger info "Script Ends" diff --git a/components/WRManager2105/scripts/add_external_network.sh b/components/WRManager2105/scripts/add_external_network.sh new file mode 100644 index 0000000..9ceef5b --- /dev/null +++ b/components/WRManager2105/scripts/add_external_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PUBLIC_IP=$public_ip +PRIVATE_IP=$private_ip + +cfy_manager add-networks --networks "{\"external\": \"${PUBLIC_IP}\"}" + +sudo supervisorctl restart cloudify-mgmtworker + +sudo supervisorctl restart nginx + +sudo supervisorctl restart cloudify-rabbitmq diff --git a/tools/gcp/build-oib.sh b/tools/gcp/build-oib.sh index ed8248d..7a0806b 100644 --- a/tools/gcp/build-oib.sh +++ b/tools/gcp/build-oib.sh @@ -285,26 +285,8 @@ sudo sed -i -e '/\[Service\]/a ExecStartPre=/bin/sleep 90' /usr/lib/systemd/syst sudo systemctl daemon-reload -# Create openstack external router and network -EXTERNAL_NETWORK="external_network" -source ${HOME}/keystonerc_admin -neutron net-create $EXTERNAL_NETWORK --provider:network_type flat --provider:physical_network extnet --router:external --share -neutron subnet-create --name ext_sub --enable_dhcp=False --allocation-pool=start=172.25.1.10,end=172.25.1.250 --gateway=172.25.1.1 $EXTERNAL_NETWORK 172.25.1.0/24 - -openstack router create router1 -openstack router set router1 --external-gateway $EXTERNAL_NETWORK - -# create private_network -neutron net-create private_network -neutron subnet-create --name private_subnet --dns-nameserver 8.8.8.8 --dns-nameserver 8.8.4.4 private_network 192.168.113.0/24 -neutron router-interface-add router1 private_subnet - -# create provider network and subnet -neutron net-create provider --provider:network_type flat --provider:physical_network provider -neutron subnet-create provider 10.10.25.0/24 --name provider_subnet --enable-dhcp --allocation-pool start=10.10.25.100,end=10.10.25.200 --dns-nameserver 8.8.8.8 --ip-version 4 --gateway 10.10.25.253 -neutron router-interface-add router1 provider_subnet - # create openstack images +source ${HOME}/keystonerc_admin echo "Uploading CentOS 7.6 ..." curl https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1809.qcow2 -o /tmp/CentOS-7-x86_64-GenericCloud-1809.qcow2 openstack image create --disk-format qcow2 --id aee5438f-1c7c-497f-a11e-53360241cf0f --file /tmp/CentOS-7-x86_64-GenericCloud-1809.qcow2 CentOS7 @@ -601,6 +583,43 @@ sudo chown -R cloudify:cloudify /home/cloudify/.ssh sudo cp ${HOME}/keystonerc_admin /home/cloudify/ sudo chown cloudify:cloudify /home/cloudify/keystonerc_admin + +cat << EOB | sudo tee /root/fix_networks.sh +# Create openstack external router and network +source /root/keystonerc_admin +neutron net-create external_network --provider:network_type flat --provider:physical_network extnet --router:external --share +neutron subnet-create --name ext_sub --enable_dhcp=False --allocation-pool=start=172.25.1.10,end=172.25.1.250 --gateway=172.25.1.1 external_network 172.25.1.0/24 + +openstack router create router1 +openstack router set router1 --external-gateway external_network + +# create private_network +neutron net-create private_network +neutron subnet-create --name private_subnet --dns-nameserver 8.8.8.8 --dns-nameserver 8.8.4.4 private_network 192.168.113.0/24 +neutron router-interface-add router1 private_subnet + +# create provider network and subnet +neutron net-create provider --provider:network_type flat --provider:physical_network provider +neutron subnet-create provider 10.10.25.0/24 --name provider_subnet --enable-dhcp --allocation-pool start=10.10.25.100,end=10.10.25.200 --dns-nameserver 8.8.8.8 --ip-version 4 --gateway 10.10.25.253 +neutron router-interface-add router1 provider_subnet +EOB + + +cat << EOB | sudo tee /usr/lib/systemd/system/openstack-starter.service +[Unit] +After=basic.target network.target system.slice systemd-journald.socket openstack-nova-compute.service +[Install] +WantedBy=multi-user.target +[Service] +Type=oneshot +ExecStartPre=/usr/bin/nova-manage cell_v2 discover_hosts --verbose +ExecStart=/usr/bin/bash /root/fix_networks.sh +User=root +Group=root +EOB + +sudo systemctl enable openstack-starter + # clean sudo rm -f /root/.ssh/authorized_keys rm -f ${HOME}/.ssh/authorized_keys diff --git a/tools/gcp/os_pre_config.sh b/tools/gcp/os_pre_config.sh index 9b0cd00..803361f 100644 --- a/tools/gcp/os_pre_config.sh +++ b/tools/gcp/os_pre_config.sh @@ -1,5 +1,7 @@ #!/bin/bash +sudo sed -i "/enabled=1/c\enabled=0" /etc/yum.repos.d/google-cloud.repo + sudo yum install -y yum-utils sudo yum-config-manager --disable epel @@ -39,4 +41,4 @@ EOB git clone https://github.com/Cloudify-PS/cloudify-labs-env-blueprints.git -sudo reboot \ No newline at end of file +sudo reboot