[OpenStack]Deploy WordPress Using Heat

來源:互聯網
上載者:User

標籤:openstack   wordpress   

This is the HOT for WordPess deployment on top of OpenStack environment.

heat_template_version: 2014-09-06 description: >  Heat Docker template using software deployments. parameters:   key_name:    type: string    description : Name of a KeyPair to enable SSH access to the instance    default: heat   instance_type:    type: string    description: Instance type for WordPress server    default: m1.small   image:    type: string    description: >      Name or ID of the image to use for the Docker server.  This needs to be      built with os-collect-config tools from a fedora base image. resources:  docker_sg:    type: OS::Neutron::SecurityGroup    properties:      description: Ping, SSH, Docker      rules:      - protocol: icmp      - protocol: tcp        port_range_min: 22        port_range_max: 22      - protocol: tcp        port_range_min: 80        port_range_max: 80      - protocol: tcp        port_range_min: 2345        port_range_max: 2345   docker_config:    type: OS::Heat::SoftwareConfig    properties:      group: script      config: |        #!/bin/bash -v        setenforce 0        yum -y install docker-io        cp /usr/lib/systemd/system/docker.service /etc/systemd/system/        sed -i -e '/ExecStart/ { s,fd://,tcp://0.0.0.0:2345, }' /etc/systemd/system/docker.service        systemctl start docker.service   docker_deployment:    type: OS::Heat::SoftwareDeployment    properties:      config: {get_resource: docker_config}      server: {get_resource: docker_host}   docker_host:    type: OS::Nova::Server    properties:      image: {get_param: image}      flavor: {get_param: instance_type}      key_name: {get_param: key_name}      security_groups:        - {get_resource: docker_sg}      user_data_format: SOFTWARE_CONFIG   database_password:    type: OS::Heat::RandomString   database:    type: DockerInc::Docker::Container    depends_on: [docker_deployment]    properties:      image: mysql      name: db      docker_endpoint:        str_replace:          template: http://host:2345/          params:            host: {get_attr: [docker_host, networks, private, 0]}      env:        - {str_replace: {template: MYSQL_ROOT_PASSWORD=password,                         params: {password: {get_attr: [database_password, value]}}}}   wordpress:    type: DockerInc::Docker::Container    depends_on: [database]    properties:      image: wordpress      links:        db: mysql      port_bindings:        80/tcp: [{"HostPort": "80"}]      docker_endpoint:        str_replace:          template: http://host:2345/          params:            host: {get_attr: [docker_host, networks, private, 0]} outputs:  url:    description: Public address of the web site    value:      str_replace:        template: http://host/wordpress        params:          host: {get_attr: [docker_host, networks, private, 0]}


[OpenStack]Deploy WordPress Using Heat

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.