summaryrefslogtreecommitdiffstats
path: root/ansible_collections/google/cloud/roles
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:04:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:04:41 +0000
commit975f66f2eebe9dadba04f275774d4ab83f74cf25 (patch)
tree89bd26a93aaae6a25749145b7e4bca4a1e75b2be /ansible_collections/google/cloud/roles
parentInitial commit. (diff)
downloadansible-975f66f2eebe9dadba04f275774d4ab83f74cf25.tar.xz
ansible-975f66f2eebe9dadba04f275774d4ab83f74cf25.zip
Adding upstream version 7.7.0+dfsg.upstream/7.7.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/google/cloud/roles')
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/README.md58
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/defaults/main.yml28
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/meta/main.yml20
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/archive/archive_install.yml54
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/archive/command_completion.yml34
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/archive/main.yml41
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/main.yml15
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/package/debian.yml31
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/package/main.yml5
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/tasks/package/redhat.yml31
-rw-r--r--ansible_collections/google/cloud/roles/gcloud/vars/main.yml1
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/README.md38
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/defaults/main.yml14
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/meta/main.yml59
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/tasks/main.yml65
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/tests/inventory2
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/tests/test.yml5
-rw-r--r--ansible_collections/google/cloud/roles/gcp_http_lb/vars/main.yml12
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/README.md31
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/defaults/main.yml2
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/handlers/main.yml2
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/meta/main.yml20
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/tasks/debian.yml28
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/tasks/main.yml4
-rw-r--r--ansible_collections/google/cloud/roles/gcsfuse/vars/main.yml2
25 files changed, 602 insertions, 0 deletions
diff --git a/ansible_collections/google/cloud/roles/gcloud/README.md b/ansible_collections/google/cloud/roles/gcloud/README.md
new file mode 100644
index 000000000..8c6b83ac9
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/README.md
@@ -0,0 +1,58 @@
+# google.cloud.gcloud
+
+This role installs the gcloud command-line tool on a linux system.
+
+## Requirements
+
+### Debian
+
+None
+
+### Ubuntu
+
+None
+
+### CentOS
+
+- epel (if using archive installation)
+
+## Role Variables
+
+All variables which can be overridden are stored in defaults/main.yml file as well as in table below.
+
+| Variable | Required | Default | Comments |
+| ------------------------------ | -------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
+| `gcloud_install_type` | No | `package` | Type of install `package` or `archive` |
+| `gcloud_apt_url` | No | `http://packages.cloud.google.com/apt` | URL of the APT Repository |
+| `gcloud_apt_key` | No | `https://packages.cloud.google.com/apt/doc/apt-key.gpg` | GPG Key for the APT Repository |
+| `gcloud_apt_repo` | No | `cloud-sdk-{{ ansible_distribution_release }}` | Name of the APT Repository |
+| `gcloud_yum_baseurl` | No | `https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64` | URL of the YUM Repository |
+| `gcloud_yum_key` | No | `https://packages.cloud.google.com/yum/doc/yum-key.gpg` | GPG Key for the YUM Repository |
+| `gcloud_version` | No | `268.0.0` | Version of google-cloud-sdk to install |
+| `gcloud_archive_name` | No | `google-cloud-sdk-{{ gcloud_version }}-linux-{{ ansible_architecture }}.tar.gz` | Full length name of gcloud archive |
+| `gcloud_archive_url` | No | `https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/{{ gcloud_archive_name }}` | URL to download the gcloud archive |
+| `gcloud_archive_path` | No | `/usr/lib` | Where should we unpack the archive |
+| `gcloud_library_path` | No | `{{ gcloud_archive_path }}/google-cloud-sdk` | Path of the library after archive unpack |
+| `gcloud_install_script` | No | `false` | Boolean: Execute install.sh from archive |
+| `gcloud_usage_reporting` | No | `false` | Boolean: Disable anonymous usage reporting. |
+| `gcloud_profile_path` | No | `false` | Profile to update with PATH and completion. |
+| `gcloud_command_completion` | No | `false` | Boolean: Add a line for command completion in the profile |
+| `gcloud_update_path` | No | `false` | Boolean: Add a line for path updating in the profile |
+| `gcloud_override_components` | No | `[]` | Override the components that would be installed by default |
+| `gcloud_additional_components` | No | `[]` | Additional components to installed |
+
+## Example Playbook
+
+```yaml
+- hosts: servers
+ roles:
+ - role: google.cloud.gcloud
+```
+
+## License
+
+MIT
+
+## Author Information
+
+[ericsysmin](https://ericsysmin.com)
diff --git a/ansible_collections/google/cloud/roles/gcloud/defaults/main.yml b/ansible_collections/google/cloud/roles/gcloud/defaults/main.yml
new file mode 100644
index 000000000..deeec6998
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/defaults/main.yml
@@ -0,0 +1,28 @@
+---
+# defaults file for gcloud
+gcloud_install_type: package
+
+# default values for gcloud apt installation
+gcloud_apt_key: https://packages.cloud.google.com/apt/doc/apt-key.gpg
+gcloud_apt_url: http://packages.cloud.google.com/apt
+gcloud_apt_repo: cloud-sdk
+
+# default values for gcloud yum installation
+gcloud_yum_baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
+gcloud_yum_key: https://packages.cloud.google.com/yum/doc/yum-key.gpg
+
+# default values for gcloud archive installation
+gcloud_version: 268.0.0
+gcloud_archive_name: google-cloud-sdk-{{ gcloud_version }}-linux-{{ ansible_architecture }}.tar.gz
+gcloud_archive_url: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/{{ gcloud_archive_name }}
+gcloud_archive_path: /usr/lib
+gcloud_library_path: "{{ gcloud_archive_path }}/google-cloud-sdk"
+
+# values if you want to use the gcloud install script
+gcloud_install_script: false
+gcloud_usage_reporting: false
+gcloud_profile_path: false
+gcloud_command_completion: false
+gcloud_update_path: false
+gcloud_override_components: []
+gcloud_additional_components: []
diff --git a/ansible_collections/google/cloud/roles/gcloud/meta/main.yml b/ansible_collections/google/cloud/roles/gcloud/meta/main.yml
new file mode 100644
index 000000000..049ed0eae
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/meta/main.yml
@@ -0,0 +1,20 @@
+---
+galaxy_info:
+ role_name: gcloud
+ author: Eric Anderson
+ description: Ansible role to install google-cloud-sdk
+ license: GPL-3.0
+ min_ansible_version: "2.9"
+ platforms:
+ - name: Ubuntu
+ versions:
+ - precise
+ - trusty
+ - xenial
+ - bionic
+ galaxy_tags:
+ - gcloud
+ - google
+ - cloud
+ - sdk
+dependencies: []
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/archive/archive_install.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/archive_install.yml
new file mode 100644
index 000000000..8f6a52aeb
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/archive_install.yml
@@ -0,0 +1,54 @@
+---
+- name: Gcloud | Archive | Ensure temp path exists
+ ansible.builtin.file:
+ path: "{{ gcloud_archive_path }}"
+ state: "directory"
+ mode: "0755"
+
+- name: Gcloud | Archive | Extract Cloud SDK archive
+ ansible.builtin.unarchive:
+ src: "{{ gcloud_archive_url }}"
+ dest: "{{ gcloud_archive_path }}"
+ remote_src: yes
+ creates: "{{ gcloud_library_path }}"
+
+- name: Gcloud | Archive | Link binaries to /usr/bin (like package install)
+ ansible.builtin.file:
+ src: "{{ gcloud_library_path }}/bin/{{ item }}"
+ dest: "/usr/bin/{{ item }}"
+ state: link
+ loop:
+ - bq
+ - docker-credential-gcloud
+ - gcloud
+ - git-credential-gcloud.sh
+ - gsutil
+ when: not gcloud_install_script
+
+- name: Gcloud | Archive | Add command completion
+ ansible.builtin.include_tasks: command_completion.yml
+ when: gcloud_command_completion
+
+- name: Gcloud | Archive | Install into Path
+ changed_when: false
+ ansible.builtin.command: >-
+ {{ gcloud_archive_path }}/install.sh --quiet
+ --usage-reporting {{ gcloud_usage_reporting | lower }}
+ {% if gcloud_profile_path %}
+ --rc-path {{ gcloud_profile_path }}
+ {% endif %}
+ --command-completion {{ gcloud_command_completion | lower }}
+ --path-update {{ gcloud_update_path | lower }}
+ {% if gcloud_override_components | length > 0 %}--override-components
+ {% for component in gcloud_override_components %}{{ component }}
+ {% if loop.index < gcloud_override_components | length %}
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ {% if gcloud_additional_components | length > 0 %}--additional-components
+ {% for component in gcloud_additional_components %}{{ component }}
+ {% if loop.index < gcloud_additional_components | length %}
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ when: gcloud_install_script
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/archive/command_completion.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/command_completion.yml
new file mode 100644
index 000000000..d457c09d0
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/command_completion.yml
@@ -0,0 +1,34 @@
+---
+# task file to configure bash completion for gcloud
+- name: Gcloud | Archive | Debian | Ensure bash completion is installed
+ ansible.builtin.apt:
+ name: "bash-completion"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+ when: ansible_os_family == "Debian"
+
+- name: Gcloud | Archive | RedHat | Ensure bash completion is installed
+ ansible.builtin.yum:
+ name:
+ - bash-completion
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+ when: ansible_os_family == "RedHat"
+
+- name: Gcloud | Archive | Ensure bash_completion.d directory exists
+ ansible.builtin.file:
+ path: /etc/bash_completion.d
+ owner: root
+ group: root
+ state: directory
+ mode: 0755
+
+- name: Gcloud | Archive | Link binaries to /usr/bin (like package install)
+ ansible.builtin.file:
+ src: "{{ gcloud_library_path }}/completion.bash.inc"
+ dest: /etc/bash_completion.d/gcloud
+ state: link
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/archive/main.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/main.yml
new file mode 100644
index 000000000..989c89ba9
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/archive/main.yml
@@ -0,0 +1,41 @@
+---
+# tasks to install gcloud via archive
+- name: Gcloud | Archive | Look for existing Google Cloud SDK installation
+ ansible.builtin.stat:
+ path: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
+ register: gcloud_status
+
+- name: Gcloud | Archive | Get gcloud_status
+ ansible.builtin.debug:
+ var: "gcloud_status"
+
+- name: Gcloud | Archive | Set installed version if installation exists
+ when: gcloud_status.stat.exists
+ block:
+ - name: Gcloud | Archive | Importing contents of ./google-cloud-sdk/VERSION in {{ gcloud_archive_path }}
+ ansible.builtin.slurp:
+ src: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
+ register: gcloud_installed_version_data
+ - name: Gcloud | Archive | Setting the gcloud_installed_version variable/fact
+ ansible.builtin.set_fact:
+ gcloud_installed_version: "{{ (gcloud_installed_version_data.content | b64decode | trim) }}"
+ - name: Gcloud | Archive | get the gcloud_installed_version
+ ansible.builtin.debug:
+ msg: "google-cloud-sdk: {{ gcloud_installed_version }} is installed"
+ - name: Gcloud | Archive | Version already installed
+ when: gcloud_version == gcloud_installed_version
+ ansible.builtin.debug:
+ msg: >-
+ Skipping installation of google-cloud-sdk version {{ gcloud_version }} when
+ {{ gcloud_installed_version }} is already installed.
+
+- name: Gcloud | Archive | Start installation
+ when: gcloud_installed_version is undefined or
+ gcloud_version is version(gcloud_installed_version, '>')
+ ansible.builtin.include_tasks: archive_install.yml
+
+- name: Gcloud | Debian | Install the google-cloud-sdk additional components # noqa 301
+ ansible.builtin.command: gcloud components install {{ item }}
+ register: gcloud_install_comp_status
+ changed_when: "'All components are up to date.' not in gcloud_install_comp_status.stderr_lines"
+ loop: "{{ gcloud_additional_components }}"
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/main.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/main.yml
new file mode 100644
index 000000000..bdbd347a2
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/main.yml
@@ -0,0 +1,15 @@
+---
+
+- name: Gcloud | Load Distro and OS specific variables
+ ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
+ vars:
+ params:
+ files:
+ - "os/{{ ansible_distribution | lower }}.yml"
+ - "os/{{ ansible_os_family | lower }}.yml"
+ - main.yml
+ paths:
+ - 'vars'
+
+- name: Gcloud | Install the google-cloud-sdk from {{ gcloud_install_type }}
+ ansible.builtin.include_tasks: "{{ gcloud_install_type }}/main.yml"
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/package/debian.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/package/debian.yml
new file mode 100644
index 000000000..6b0bf707a
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/package/debian.yml
@@ -0,0 +1,31 @@
+---
+# tasks that install gcloud on debian
+- name: Gcloud | Debian | Add an Apt signing key, uses whichever key is at the URL
+ ansible.builtin.apt_key:
+ url: "{{ gcloud_apt_key }}"
+ state: present
+
+- name: Gcloud | Debian | Add the gcloud repository
+ ansible.builtin.apt_repository:
+ repo: "deb {{ gcloud_apt_url }} {{ gcloud_apt_repo }} main"
+ state: present
+ filename: google-cloud-sdk
+
+- name: Gcloud | Debian | Install the google-cloud-sdk package
+ ansible.builtin.apt:
+ name: "google-cloud-sdk"
+ update_cache: "yes"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+
+- name: Gcloud | Debian | Install the google-cloud-sdk additional components
+ ansible.builtin.apt:
+ name: "google-cloud-sdk-{{ item }}"
+ update_cache: "yes"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+ loop: "{{ gcloud_additional_components }}"
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/package/main.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/package/main.yml
new file mode 100644
index 000000000..61bf28a95
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/package/main.yml
@@ -0,0 +1,5 @@
+---
+# tasks file for gcloud
+
+- name: Gcloud | Start package installation for specific distro
+ ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"
diff --git a/ansible_collections/google/cloud/roles/gcloud/tasks/package/redhat.yml b/ansible_collections/google/cloud/roles/gcloud/tasks/package/redhat.yml
new file mode 100644
index 000000000..50cdac5a1
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/tasks/package/redhat.yml
@@ -0,0 +1,31 @@
+---
+- name: Gcloud | RHEL | Add an Apt signing key, uses whichever key is at the URL
+ ansible.builtin.yum_repository:
+ name: google-cloud-sdk
+ description: Google Cloud SDK
+ baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
+ enabled: yes
+ gpgcheck: yes
+ repo_gpgcheck: yes
+ gpgkey:
+ - https://packages.cloud.google.com/yum/doc/yum-key.gpg
+ - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
+
+- name: Gcloud | RHEL | Install the google-cloud-sdk package
+ ansible.builtin.yum:
+ name: "google-cloud-sdk"
+ update_cache: "yes"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+
+- name: Gcloud | Debian | Install the google-cloud-sdk additional components
+ ansible.builtin.yum:
+ name: "google-cloud-sdk-{{ item }}"
+ update_cache: "yes"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+ loop: "{{ gcloud_additional_components }}"
diff --git a/ansible_collections/google/cloud/roles/gcloud/vars/main.yml b/ansible_collections/google/cloud/roles/gcloud/vars/main.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcloud/vars/main.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/README.md b/ansible_collections/google/cloud/roles/gcp_http_lb/README.md
new file mode 100644
index 000000000..901de6e1a
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/README.md
@@ -0,0 +1,38 @@
+gcp_http_lb
+=========
+
+This role helps you set up a Google Cloud Load Balancer.
+
+Requirements
+------------
+
+- requests Python library
+- googleauth Python library
+
+Role Variables
+--------------
+
+```
+ gcp_http_lb_backend: the selflink for the backend that this load balancer will be supporting
+ gcp_project: the name of your gcp project
+ service_account_file: the path to your service account JSON file
+```
+
+Example Playbook
+----------------
+
+ - hosts: local
+ vars:
+ gcp_http_lb_backend: projects/project/zones/us-central1-c/instanceGroups/my-instance-group
+ roles:
+ - role: gcp_http_lb
+
+License
+-------
+
+GPLv3
+
+Author Information
+------------------
+
+Google Inc.
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/defaults/main.yml b/ansible_collections/google/cloud/roles/gcp_http_lb/defaults/main.yml
new file mode 100644
index 000000000..f705f01df
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/defaults/main.yml
@@ -0,0 +1,14 @@
+---
+# defaults file for gcp-http-lb
+gcp_http_lb_state: present
+gcp_http_lb_cdn: true
+gcp_http_lb_name_prefix: 'gcp'
+
+# Name schemes for resources being created
+gcp_http_lb_globaladdress: "{{gcp_lb_name_prefix}}-globaladdress"
+gcp_http_lb_instancegroup: "{{gcp_lb_name_prefix}}-instancegroup"
+gcp_http_lb_healthcheck: "{{gcp_lb_name_prefix}}-healthcheck"
+gcp_http_lb_backendservice: "{{gcp_lb_name_prefix}}-backendservice"
+gcp_http_lb_urlmap: "{{gcp_lb_name_prefix}}-urlmap"
+gcp_http_lb_httpproxy: "{{gcp_lb_name_prefix}}-httpproxy"
+gcp_http_lb_forwardingrule: "{{gcp_lb_name_prefix}}-forwardingrule"
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/meta/main.yml b/ansible_collections/google/cloud/roles/gcp_http_lb/meta/main.yml
new file mode 100644
index 000000000..9ee910409
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/meta/main.yml
@@ -0,0 +1,59 @@
+galaxy_info:
+ author: googlecloudplatform
+ description: Create a HTTP Load Balancer on GCP
+ company: Google
+
+ # If the issue tracker for your role is not on github, uncomment the
+ # next line and provide a value
+ # issue_tracker_url: http://example.com/issue/tracker
+
+ # Some suggested licenses:
+ # - BSD (default)
+ # - MIT
+ # - GPLv2
+ # - GPLv3
+ # - Apache
+ # - CC-BY
+ license: GPLv3
+
+ min_ansible_version: 2.7
+ # If this a Container Enabled role, provide the minimum Ansible Container version.
+ # min_ansible_container_version:
+
+ # Optionally specify the branch Galaxy will use when accessing the GitHub
+ # repo for this role. During role install, if no tags are available,
+ # Galaxy will use this branch. During import Galaxy will access files on
+ # this branch. If Travis integration is configured, only notifications for this
+ # branch will be accepted. Otherwise, in all cases, the repo's default branch
+ # (usually master) will be used.
+ #github_branch:
+
+ #
+ # Provide a list of supported platforms, and for each platform a list of versions.
+ # If you don't wish to enumerate all versions for a particular platform, use 'all'.
+ # To view available platforms and versions (or releases), visit:
+ # https://galaxy.ansible.com/api/v1/platforms/
+ #
+ # platforms:
+ # - name: Fedora
+ # versions:
+ # - all
+ # - 25
+ # - name: SomePlatform
+ # versions:
+ # - all
+ # - 1.0
+ # - 7
+ # - 99.99
+
+ galaxy_tags: []
+ # List tags for your role here, one per line. A tag is a keyword that describes
+ # and categorizes the role. Users find roles by searching for tags. Be sure to
+ # remove the '[]' above, if you add tags to this list.
+ #
+ # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
+ # Maximum 20 tags per role.
+
+dependencies: []
+ # List your role dependencies here, one per line. Be sure to remove the '[]' above,
+ # if you add dependencies to this list.
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/tasks/main.yml b/ansible_collections/google/cloud/roles/gcp_http_lb/tasks/main.yml
new file mode 100644
index 000000000..8ed8f4d36
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/tasks/main.yml
@@ -0,0 +1,65 @@
+---
+- name: create a global address for the load balancer.
+ gcp_compute_global_address:
+ name: "{{ gcp_http_lb_globaladdress }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: globaladdress
+- name: create a http health check to verify lb working
+ gcp_compute_http_health_check:
+ name: "{{ gcp_http_lb_healthcheck }}"
+ healthy_threshold: 10
+ port: 80
+ timeout_sec: 2
+ unhealthy_threshold: 5
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: healthcheck
+- name: create a backend service
+ gcp_compute_backend_service:
+ name: "{{ gcp_http_lb_backendservice }}"
+ backends:
+ - group: "{{ gcp_http_lb_backend.selfLink }}"
+ health_checks:
+ - "{{ healthcheck.selfLink }}"
+ enable_cdn: "{{ gcp_http_lb_cdn }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: backendservice
+- name: create a url map
+ gcp_compute_url_map:
+ name: "{{ gcp_http_lb_urlmap }}"
+ default_service: "{{ backendservice }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: urlmap
+- name: create a target http proxy
+ gcp_compute_target_http_proxy:
+ name: "{{ gcp_http_lb_httpproxy }}"
+ url_map: "{{ urlmap }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: httpproxy
+- name: create a global forwarding rule
+ gcp_compute_global_forwarding_rule:
+ name: "{{ gcp_http_lb_forwardingrule }}"
+ ip_address: "{{ globaladdress.address }}"
+ load_balancing_scheme: "EXTERNAL"
+ ip_protocol: TCP
+ port_range: 80-80
+ target: "{{ httpproxy.selfLink }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: "{{ gcp_http_lb_state }}"
+ register: result
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/tests/inventory b/ansible_collections/google/cloud/roles/gcp_http_lb/tests/inventory
new file mode 100644
index 000000000..878877b07
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/tests/inventory
@@ -0,0 +1,2 @@
+localhost
+
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/tests/test.yml b/ansible_collections/google/cloud/roles/gcp_http_lb/tests/test.yml
new file mode 100644
index 000000000..341c7a4ed
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/tests/test.yml
@@ -0,0 +1,5 @@
+---
+- hosts: localhost
+ remote_user: root
+ roles:
+ - gcp_http_lb
diff --git a/ansible_collections/google/cloud/roles/gcp_http_lb/vars/main.yml b/ansible_collections/google/cloud/roles/gcp_http_lb/vars/main.yml
new file mode 100644
index 000000000..ca9443f6f
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcp_http_lb/vars/main.yml
@@ -0,0 +1,12 @@
+---
+# vars file for gcp-http-lb
+vars:
+ # The backend this LB will be supporting. This will typically be a Instance Group:
+ # example: projects/sample-project/zones/us-central1-c/instanceGroups/sample-instance-group
+ gcp_http_lb_backend: your-backend
+ # The name of your GCP project
+ gcp_project: your-project
+ # The kind of authentication you will use (serviceaccount is recommended)
+ auth_kind: serviceaccount
+ # The path to your service account file (if using the serviceaccount auth kind)
+ service_account_file: path-to-service-account-file
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/README.md b/ansible_collections/google/cloud/roles/gcsfuse/README.md
new file mode 100644
index 000000000..2da6d4d1c
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/README.md
@@ -0,0 +1,31 @@
+# gcsfuse
+
+This role configures the gcsfuse repository, and installs gcsfuse on your host.
+gcsfuse is a user-space file system for working with
+[Google Cloud Storage](https://cloud.google.com/storage/).
+
+**Important:** You should run gcsfuse as the user who will be using the file
+system, not as the root user. Do not use sudo either.
+
+After installed you can use it to mount by command:
+`gcsfuse bucket-name /mount/point`
+
+## Example Playbook
+
+Including an example of how to use your role (for instance, with variables
+passed in as parameters) is always nice for users too:
+
+```yaml
+- hosts: servers
+ tasks:
+ - include_role:
+ name: google.cloud.gcsfuse
+```
+
+## License
+
+GPLv3
+
+## Author Information
+
+[ericsysmin](https://ericsysmin.com)
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/defaults/main.yml b/ansible_collections/google/cloud/roles/gcsfuse/defaults/main.yml
new file mode 100644
index 000000000..f51977148
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+# defaults file for google.cloud.gcsfuse
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/handlers/main.yml b/ansible_collections/google/cloud/roles/gcsfuse/handlers/main.yml
new file mode 100644
index 000000000..db9f8ae03
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/handlers/main.yml
@@ -0,0 +1,2 @@
+---
+# handlers file for google.cloud.gcsfuse
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/meta/main.yml b/ansible_collections/google/cloud/roles/gcsfuse/meta/main.yml
new file mode 100644
index 000000000..05c57644d
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/meta/main.yml
@@ -0,0 +1,20 @@
+---
+galaxy_info:
+ role_name: gcsfuse
+ author: Eric Anderson
+ description: Ansible role to install gcsfuse
+ license: GPL-3.0
+ min_ansible_version: "2.9"
+ platforms:
+ - name: Ubuntu
+ versions:
+ - precise
+ - trusty
+ - xenial
+ - bionic
+ galaxy_tags:
+ - gcloud
+ - google
+ - gcsfuse
+ - fuse
+dependencies: []
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/tasks/debian.yml b/ansible_collections/google/cloud/roles/gcsfuse/tasks/debian.yml
new file mode 100644
index 000000000..941f3bd42
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/tasks/debian.yml
@@ -0,0 +1,28 @@
+---
+- name: Gcsfuse | Ensure gpg is installed
+ ansible.builtin.apt:
+ name: "gnupg"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
+
+- name: Gcsfuse | Add an apt signing key
+ ansible.builtin.apt_key:
+ url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
+ state: present
+
+- name: Gcsfuse | Add the apt repository
+ ansible.builtin.apt_repository:
+ repo: deb http://packages.cloud.google.com/apt gcsfuse-{{ ansible_distribution_release }} main
+ state: present
+ filename: gcsfuse
+
+- name: Gcsfuse | Install gcsfuse
+ ansible.builtin.apt:
+ name: "gcsfuse"
+ update_cache: "yes"
+ register: task_result
+ until: task_result is success
+ retries: 10
+ delay: 2
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/tasks/main.yml b/ansible_collections/google/cloud/roles/gcsfuse/tasks/main.yml
new file mode 100644
index 000000000..b7989f918
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+# tasks file for google.cloud.gcsfuse
+- name: Main
+ ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"
diff --git a/ansible_collections/google/cloud/roles/gcsfuse/vars/main.yml b/ansible_collections/google/cloud/roles/gcsfuse/vars/main.yml
new file mode 100644
index 000000000..019372d6c
--- /dev/null
+++ b/ansible_collections/google/cloud/roles/gcsfuse/vars/main.yml
@@ -0,0 +1,2 @@
+---
+# vars file for google.cloud.gcsfuse