Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. heat_template_version: 2013-05-23
  2.  
  3. description: Template that installs PhpMyAdmin
  4.  
  5. parameters:
  6. image:
  7. type: string
  8. label: Image name or ID
  9. description: Image to be used for server. Please use an Ubuntu based image.
  10. default: PaaS_Base_ubuntu
  11. flavor:
  12. type: string
  13. label: Flavor
  14. description: Type of instance (flavor) to be used on the compute instance.
  15. default: m1.small
  16. key:
  17. type: string
  18. label: Key name
  19. description: Name of key-pair to be installed on the compute instance.
  20. default: SAN-KEY
  21. private_network:
  22. type: string
  23. label: Private network name or ID
  24. description: Network to attach server to.
  25. default: db-pnw
  26. mysql_server:
  27. type: string
  28. label: MySQL database server
  29. description: IP address of the MySQL database server.
  30. database_name:
  31. type: string
  32. label: Database name
  33. description: Name of the application database.
  34. database_user:
  35. type: string
  36. label: Database user
  37. description: Name of the database user.
  38. database_password:
  39. type: string
  40. label: Database password
  41. hidden: true
  42. description: Password to access the database.
  43. server_name:
  44. type: string
  45. label: Server Name
  46. description: REQUIRED PARAMETER - Name of the instance to spin up.
  47. hidden: false
  48. default: PHP_Server
  49. mysql_root_password:
  50. type: string
  51. label: Database password
  52. hidden: true
  53. description: Root password to access the database.
  54.  
  55. resources:
  56.  
  57. security_group:
  58. type: OS::Neutron::SecurityGroup
  59. properties:
  60. name: web_server_security_group
  61. rules:
  62. - protocol: tcp
  63. port_range_min: 80
  64. port_range_max: 80
  65.  
  66. port:
  67. type: OS::Neutron::Port
  68. properties:
  69. network: { get_param: private_network }
  70. security_groups:
  71. - { get_resource: security_group }
  72.  
  73. wordpress_instance:
  74. type: OS::Nova::Server
  75. properties:
  76. name: { get_param: server_name }
  77. image: { get_param: image }
  78. flavor: { get_param: flavor }
  79. key_name: { get_param: key }
  80. networks:
  81. - port: { get_resource: port }
  82. user_data_format: RAW
  83. user_data:
  84. str_replace:
  85. params:
  86. __mysql_ip__: { get_param: mysql_server }
  87. __database_user__: { get_param: database_user }
  88. __database_password__: { get_param: database_password }
  89. __mysql_root_password__: { get_param: mysql_root_password }
  90. template: |
  91. #!/bin/bash -ex
  92. sed -i 's/172.16.*.*/8.8.8.8/g' /etc/resolv.conf
  93. # install dependencies
  94. apt-get update
  95. echo 'phpmyadmin phpmyadmin/dbconfig-install boolean true' | debconf-se/etc/apache2/apache2.conft-selections
  96. echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections
  97. echo 'phpmyadmin phpmyadmin/app-password-confirm password __mysql_root_password__' | debconf-set-selections
  98. echo 'phpmyadmin phpmyadmin/mysql/admin-pass password __mysql_root_password__' | debconf-set-selections
  99. echo 'phpmyadmin phpmyadmin/database-type select mysql' | debconf-set-selections
  100. echo 'phpmyadmin phpmyadmin/mysql/app-pass password __mysql_root_password__' | debconf-set-selections
  101. export DEBIAN_FRONTEND=noninteractive
  102. apt-get -q -y install phpmyadmin
  103. sed -i 's/localhost/__mysql_ip__/' /etc/phpmyadmin/config.inc.php
  104. echo -e "Include /etc/phpmyadmin/apache.conf" && >> /etc/apache2/apache2.conf
  105. service apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement