diff --git a/README.md b/README.md index 1c9a5da..10a733d 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ If you're building the provider, follow the instructions to [install it as a plu Examples are available in the examples directory: -- `basic_main`: shows how to define a simple ghost application -- `shared_modules_features_main`: shows how modules and features can be shared across ghost\_app resources using `locals` +- `basic`: shows how to define a simple ghost application +- `shared_modules_features`: shows how modules and features can be shared across ghost\_app resources using `locals`. It also shows how to write or import scripts. Developing the Provider --------------------------- diff --git a/examples/inputs.tf b/examples/basic/inputs.tf similarity index 100% rename from examples/inputs.tf rename to examples/basic/inputs.tf diff --git a/examples/basic_main.tf b/examples/basic/main.tf similarity index 100% rename from examples/basic_main.tf rename to examples/basic/main.tf diff --git a/examples/shared_modules_features/inputs.tf b/examples/shared_modules_features/inputs.tf new file mode 100644 index 0000000..6faec1b --- /dev/null +++ b/examples/shared_modules_features/inputs.tf @@ -0,0 +1 @@ +variable "password" {} diff --git a/examples/shared_modules_features_main.tf b/examples/shared_modules_features/main.tf similarity index 89% rename from examples/shared_modules_features_main.tf rename to examples/shared_modules_features/main.tf index 8bda810..48b1fd0 100644 --- a/examples/shared_modules_features_main.tf +++ b/examples/shared_modules_features/main.tf @@ -82,6 +82,15 @@ locals { path = "/var/www" scope = "code" git_repo = "https://github.com/KnpLabs/KnpIpsum.git" + + // You can load scripts from files + post_deploy = "${file("post_deploy.txt")}" + + // You can also use heredocs + pre_deploy = <<-SCRIPT + #!/bin/bash + echo "EXAMPLE_CONFIG" >> /var/www/html/wp-config.php + SCRIPT } custom_module_2 = { diff --git a/examples/shared_modules_features/post_deploy.txt b/examples/shared_modules_features/post_deploy.txt new file mode 100644 index 0000000..75b5d5e --- /dev/null +++ b/examples/shared_modules_features/post_deploy.txt @@ -0,0 +1,2 @@ +#!/bin/bash +echo "EXAMPLE_CONFIG" >> /var/www/html/wp-config.php