Skip to content

Commit

Permalink
single-server/provisioner: fix wording
Browse files Browse the repository at this point in the history
  • Loading branch information
bkircher committed Jul 29, 2020
1 parent 08bbdad commit 648e447
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions single-server/provisioner/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Provisioning with Terraform and Ansible

This example provisions a web-server using Ansible and Terraform. It creates an Ansible inventory based on the server's IP address and name. In your Ansible playbooks, to reference the server use the server resource name. In this example, `demo-complete-provisioner` as show in `main.yml`.
This example provisions a web server using Ansible and Terraform. It creates a local Ansible inventory file containing the server's IP address and name. In the playbook we can then reference the server by using this name. In this example it is `demo-complete-provisioner` (as shown in `main.yml`) which is the same as the resource name we use in the HCL file.

Note: You need Ansible installed and in PATH to run this example.

## Running the Example

As usual, set `GRIDSCALE_TOKEN` and `GRIDSCALE_UUID` environment variables to the values you retrieved from your panel.
As usual, set `GRIDSCALE_TOKEN` and `GRIDSCALE_UUID` environment variables to the values you got from your panel.

$ export GRIDSCALE_TOKEN=project-a-api-token
$ export GRIDSCALE_UUID=your-user-id
Expand All @@ -19,7 +19,7 @@ And then do a

$ terraform apply

Type `yes` when terraform asks you to. In the end you should see following output should be shown on your terminal:
Type `yes` when terraform asks you to. In the end, you should see something like following output in your terminal:

```raw
Expand All @@ -32,14 +32,14 @@ Outputs:
server_ip = 45.17.50.177
```

E voilà, you have a new server resource along with a running Apache web-server. Try it:
E voilà, you have a new server resource along with a running Apache web server. Try it:

$ curl -i http://45.17.50.177

## Details

This example uses a null resource in order to provision the storage with Ansible. This is needed only if the storage is for some reason re-created and you want Ansible to re-provision the storage automatically again. This is achieved using a trigger. The null resource also depends on the server resource implicitly. This is what the `echo ${gridscale_server.server.id}` is for (so please don't remove it). It also leverages the `remote-exec` provisioners timeout and retry functionality to wait for SSH to be available for Ansible to work.
This example uses a null resource in order to provision the storage with Ansible. This is needed only if the storage is for some reason re-created and you want Ansible to re-provision the storage automatically again. This is achieved using a trigger. The null resource also depends on the server resource implicitly. This is what the `echo ${gridscale_server.server.id}` is for (so please don't remove it). It also leverages the `remote-exec` provisioners operation timeout and retry functionality to wait for SSH to be available for Ansible to work.

If you don't need the functionality of reprovisioning the storage on when it is re-created, just define the provisioner inside the server resource and remove the null resource.
If you don't need the functionality of reprovisioning the storage when it is re-created, just define the provisioner inside the server resource and remove the null resource.

We are currently enhancing the gridscale Terraform provider in a way that makes the null resource obsolete and general usage of provisioners more straight forward.

0 comments on commit 648e447

Please sign in to comment.