Google Cloud has several tools and features for which Ansible modules are not available at the time of writing. In such cases we can use a shell module and Google Cloud SDK's gcloud command line tool. One such component of Google Cloud is Cloud SQL which provides managed MySQL and PostgreSQL instances.
Creating a Cloud SQL instance (without Ansible module)
How to do it...
Let us build an instance of MySQL using Ansible and gcloud:
- We will start by configuring the gcloud tool. In order to keep our main.yml clean, we will move the gcloud configuration tasks into a different YAML file, configure_gcloud.yml, and import it in main.yml. In this YAML file, we have Ansible tasks to take care of installing the Google SDK repository...