Add example from wordpress tutorial
This commit is contained in:
parent
8792dd569d
commit
fe7dc5f383
6
examples/wordpress/run.sh
Executable file
6
examples/wordpress/run.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
solar resource create nodes templates/nodes count=1
|
||||
solar repo import /vagrant/examples/wordpress/wp_repo
|
||||
solar resource create wp_docker wp_repo/docker
|
65
examples/wordpress/wp_repo/docker/1.0.0/docker.yaml
Normal file
65
examples/wordpress/wp_repo/docker/1.0.0/docker.yaml
Normal file
@ -0,0 +1,65 @@
|
||||
version: 1.2.4
|
||||
resources:
|
||||
- id: docker
|
||||
from: resources/docker
|
||||
location: node1
|
||||
|
||||
- id: config
|
||||
from: wp_repo/wp_config
|
||||
location: node1
|
||||
input:
|
||||
db_root_pass: 'r00tme'
|
||||
db_port: 3306
|
||||
wp_db_name: 'wp'
|
||||
wp_db_user: 'wp'
|
||||
wp_db_pass: 'h4ack'
|
||||
|
||||
- id: mysql
|
||||
from: resources/docker_container
|
||||
location: node1
|
||||
input:
|
||||
ip: node1::ip
|
||||
image: mysql:5.6
|
||||
ports:
|
||||
- config::db_port
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: config::db_root_pass
|
||||
wait_cmd:
|
||||
computable:
|
||||
func: "mysql -p{{env['MYSQL_ROOT_PASSWORD']}} -uroot -e 'SELECT 1'"
|
||||
connections:
|
||||
- mysql::env::NO_EVENTS
|
||||
|
||||
- id: wp_db
|
||||
from: resources/mariadb_db
|
||||
location: node1
|
||||
input:
|
||||
db_name: config::wp_db_name
|
||||
db_host: mysql::ip
|
||||
login_user: 'root'
|
||||
login_password: config::db_root_pass
|
||||
login_port: config::db_port
|
||||
|
||||
- id: wp_user
|
||||
from: resources/mariadb_user
|
||||
location: node1
|
||||
input:
|
||||
user_password: config::wp_db_pass
|
||||
user_name: config::wp_db_user
|
||||
db_name: wp_db::db_name
|
||||
db_host: mysql::ip
|
||||
login_user: 'root'
|
||||
login_password: config::db_root_pass
|
||||
login_port: config::db_port
|
||||
|
||||
- id: wordpress
|
||||
from: resources/docker_container
|
||||
location: node1
|
||||
input:
|
||||
ip: node1::ip
|
||||
image: wordpress:latest
|
||||
env:
|
||||
WORDPRESS_DB_HOST: mysql::ip
|
||||
WORDPRESS_DB_USER: wp_user::user_name
|
||||
WORDPRESS_DB_PASSWORD: wp_user::user_password
|
||||
WORDPRESS_DB_NAME: wp_db::db_name
|
18
examples/wordpress/wp_repo/wp_config/1.0.0/meta.yaml
Normal file
18
examples/wordpress/wp_repo/wp_config/1.0.0/meta.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
handler: none
|
||||
version: 1.0.0
|
||||
input:
|
||||
db_root_pass:
|
||||
schema: str!
|
||||
value:
|
||||
db_port:
|
||||
schema: int!
|
||||
value:
|
||||
wp_db_name:
|
||||
schema: str!
|
||||
value:
|
||||
wp_db_user:
|
||||
schema: str!
|
||||
value:
|
||||
wp_db_pass:
|
||||
schema: str!
|
||||
value:
|
Loading…
Reference in New Issue
Block a user