/ansible-role-gcs_proxy

Google Cloud SQL Proxy on Google Cloud Compute

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Role Description

Role to install Google Cloud Proxy on Google Cloud Compute instance. See Google's documentation on connecting to Cloud SQL from Compute Engine.

Starting And Stopping The service

systemctl start gcsql_proxy
systemctl stop gcsql_proxy

Requirements

If the target server has SELinux enabled, install the SELinux packages from OS. We recommend using the role CentOS Base.

Role Variables

Variable Default Value Description Required
gcs_proxy_instances YOUR INSTANCE CONNECTION NAME Google Cloud SQL instance name Yes
gcs_proxy_credential_file <PATH_TO_KEY_FILE> Path to key file on the remtote server No
gcsql_proxy_configure_selinux false Ensure Google Cloud SQL Proxy runs when SELinux is enabled No

Dependencies

None. We recommend using the role CentOS Base

Example Playbook

  - hosts: servers
    vars:
      - gcs_proxy_instances: <YOUR INSTANCE CONNECTION NAME>
      - gcs_proxy_credential_file: <PATH_TO_KEY_FILE>
      - centos_base_install_selinux_packages: true
    remote_user: <YOUR REMOTE USER>
    become: yes
    roles:
      - bngsudheer.gcsql_proxy

Developement

To run molecule tests locally, you might want to set the ANSIBLE_ROLES_PATH variable.

export ANSIBLE_ROLES_PATH=/path/to/ansible-role-redmine/molecule/default/roles

License

BSD

Sudheer Satyanarayana