mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-08-01 19:54:30 -07:00
fix role tests
Ansible role tests were failing due to ansible-lint reporting multiple errors. Fixing those errors resolves the failing tests. Switching gcsfuse to use gcloud's bootstrap to follow the current docker install instructions. Removing centos as it's a discontinued distribution. Adding a check to ensure integration tests are skipped unless they are run by a branch (a public fork does not pass required integration test credentials).
This commit is contained in:
parent
18900797c5
commit
f692dd4c76
21 changed files with 113 additions and 96 deletions
|
@ -1,8 +1,5 @@
|
||||||
name: "Run integration tests for the cloud.google collection"
|
name: "Run integration tests for the cloud.google collection"
|
||||||
on:
|
on:
|
||||||
# NOTE: GitHub does not allow secrets to be used
|
|
||||||
# in PRs sent from forks. As such, this configuration is for
|
|
||||||
# PRs that the maintainers would like to send to test.
|
|
||||||
pull_request: {}
|
pull_request: {}
|
||||||
push:
|
push:
|
||||||
branches: master
|
branches: master
|
||||||
|
@ -11,6 +8,10 @@ env:
|
||||||
GCP_PROJECT: "ansible-gcp-ci"
|
GCP_PROJECT: "ansible-gcp-ci"
|
||||||
jobs:
|
jobs:
|
||||||
integration:
|
integration:
|
||||||
|
# NOTE: GitHub does not allow secrets to be used
|
||||||
|
# in PRs sent from forks. As such, this configuration is for
|
||||||
|
# PRs that the maintainers would like to send to test.
|
||||||
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
|
17
.github/workflows/gcloud.yml
vendored
17
.github/workflows/gcloud.yml
vendored
|
@ -22,17 +22,6 @@ jobs:
|
||||||
molecule_playbook:
|
molecule_playbook:
|
||||||
- archive_playbook.yml
|
- archive_playbook.yml
|
||||||
- package_playbook.yml
|
- package_playbook.yml
|
||||||
molecule_distro:
|
|
||||||
- distro: centos:7
|
|
||||||
command: /usr/sbin/init
|
|
||||||
- distro: centos:8
|
|
||||||
command: /usr/sbin/init
|
|
||||||
- distro: ubuntu:18.04
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
- distro: ubuntu:20.04
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
- distro: debian:9
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
collection_role:
|
collection_role:
|
||||||
- gcloud
|
- gcloud
|
||||||
steps:
|
steps:
|
||||||
|
@ -58,14 +47,12 @@ jobs:
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install molecule yamllint ansible ansible-lint docker \
|
pip install molecule[docker] yamllint ansible ansible-lint docker
|
||||||
molecule[docker]
|
|
||||||
|
|
||||||
- name: Run role test
|
- name: Run role test
|
||||||
run: >-
|
run: >-
|
||||||
molecule --version &&
|
molecule --version &&
|
||||||
ansible --version &&
|
ansible --version &&
|
||||||
MOLECULE_COMMAND=${{ matrix.molecule_distro.command }}
|
|
||||||
MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }}
|
|
||||||
MOLECULE_PLAYBOOK=${{ matrix.molecule_playbook }}
|
MOLECULE_PLAYBOOK=${{ matrix.molecule_playbook }}
|
||||||
|
MOLECULE_NO_LOG="false"
|
||||||
molecule --debug test -s ${{ matrix.collection_role }}
|
molecule --debug test -s ${{ matrix.collection_role }}
|
||||||
|
|
22
.github/workflows/gcsfuse.yml
vendored
22
.github/workflows/gcsfuse.yml
vendored
|
@ -17,13 +17,6 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
molecule_distro:
|
|
||||||
- distro: ubuntu:16.04
|
|
||||||
command: /sbin/init
|
|
||||||
- distro: ubuntu:18.04
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
- distro: debian:9
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
collection_role:
|
collection_role:
|
||||||
- gcsfuse
|
- gcsfuse
|
||||||
steps:
|
steps:
|
||||||
|
@ -39,14 +32,21 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt install docker
|
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg \
|
||||||
|
lsb-release
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg \
|
||||||
|
--dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
echo \
|
||||||
|
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install molecule yamllint ansible-lint docker
|
pip install molecule[docker] yamllint ansible ansible-lint docker
|
||||||
|
|
||||||
- name: Run role test
|
- name: Run role test
|
||||||
run: >-
|
run: >-
|
||||||
molecule --version &&
|
molecule --version &&
|
||||||
ansible --version &&
|
ansible --version &&
|
||||||
MOLECULE_COMMAND=${{ matrix.molecule_distro.command }}
|
MOLECULE_NO_LOG="false"
|
||||||
MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }}
|
|
||||||
molecule --debug test -s ${{ matrix.collection_role }}
|
molecule --debug test -s ${{ matrix.collection_role }}
|
||||||
|
|
|
@ -22,6 +22,7 @@ git clone <url> $TARGET_DIR/collections/google/cloud
|
||||||
### prequisites for all tests
|
### prequisites for all tests
|
||||||
|
|
||||||
- Install the `ansible` package.
|
- Install the `ansible` package.
|
||||||
|
- Some container runtime is necessary (e.g. `podman` or `docker`). The instructions use podman.
|
||||||
|
|
||||||
## Running integration tests
|
## Running integration tests
|
||||||
|
|
||||||
|
@ -56,4 +57,33 @@ bash ./scripts/bootstrap-project.sh $PROJECT_ID $SERVICE_ACCOUNT_NAME
|
||||||
|
|
||||||
### Running
|
### Running
|
||||||
|
|
||||||
Run `ansible-test integration`. Currently some tests are disabled as [test are being verified and added](https://github.com/ansible-collections/google.cloud/issues/499).
|
Run `ansible-test integration`. Currently some tests are disabled as [test are being verified and added](https://github.com/ansible-collections/google.cloud/issues/499).
|
||||||
|
|
||||||
|
## Role tests
|
||||||
|
|
||||||
|
### Prequisites for role tests
|
||||||
|
|
||||||
|
If you would like to use podman, you must
|
||||||
|
install the `molecule[podman]` package in PyPI:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install --upgrade molecule[podman]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running role tests
|
||||||
|
|
||||||
|
Ansible roles are tested via molecule.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
module debug --test -s ${ROLE}
|
||||||
|
```
|
||||||
|
|
||||||
|
Role is the name of the role (e.g. gcloud, gcsfuse).
|
||||||
|
|
||||||
|
Add `-d podman` if you would like to use the podman driver.
|
||||||
|
|
||||||
|
If the linting fails, that is generally due to `ansible-lint`, which can be run directly:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible-lint
|
||||||
|
```
|
|
@ -3,7 +3,7 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Install gpg for apt_key
|
- name: Install gpg for apt_key
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: gnupg
|
name: gnupg
|
||||||
update_cache: true
|
update_cache: true
|
||||||
when: ansible_os_family|lower == "debian"
|
when: ansible_os_family|lower == "debian"
|
||||||
|
|
|
@ -3,20 +3,20 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Update package cache
|
- name: Update package cache
|
||||||
package: update_cache=yes
|
ansible.builtin.package: update_cache=yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
delay: 2
|
delay: 2
|
||||||
- name: create containerd folder
|
- name: create containerd folder
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/systemd/system/containerd.service.d
|
path: /etc/systemd/system/containerd.service.d
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: ansible_service_mgr == "systemd"
|
when: ansible_service_mgr == "systemd"
|
||||||
- name: override file for containerd
|
- name: override file for containerd
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: files/override.conf
|
src: files/override.conf
|
||||||
dest: /etc/systemd/system/containerd.service.d/override.conf
|
dest: /etc/systemd/system/containerd.service.d/override.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
|
@ -9,9 +9,15 @@ lint: |
|
||||||
ansible-lint
|
ansible-lint
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance
|
||||||
image: ${MOLECULE_DISTRO:-ubuntu:xenial}
|
image: ubuntu:18.04
|
||||||
privileged: true
|
privileged: true
|
||||||
command: ${MOLECULE_COMMAND:-"sleep infinity"}
|
ansible.builtin.command: "/lib/systemd/systemd"
|
||||||
|
volumes:
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
|
- name: instance
|
||||||
|
image: debian:9
|
||||||
|
privileged: true
|
||||||
|
ansible.builtin.command: "/lib/systemd/systemd"
|
||||||
volumes:
|
volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
provisioner:
|
provisioner:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Install gpg for apt_key
|
- name: Install gpg for apt_key
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: gnupg
|
name: gnupg
|
||||||
update_cache: true
|
update_cache: true
|
||||||
when: ansible_os_family|lower == "debian"
|
when: ansible_os_family|lower == "debian"
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: Example assertion
|
- name: Example assertion
|
||||||
assert:
|
ansible.builtin.assert:
|
||||||
that: true
|
that: true
|
||||||
|
|
|
@ -2,25 +2,12 @@
|
||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Using apt update the packages
|
- name: Update package cache
|
||||||
apt:
|
ansible.builtin.package: update_cache=yes
|
||||||
update_cache: yes
|
changed_when: false
|
||||||
when: ansible_os_family == "Debian"
|
register: task_result
|
||||||
- name: Using apt update the packages
|
until: task_result is success
|
||||||
yum:
|
retries: 10
|
||||||
update_cache: yes
|
delay: 2
|
||||||
when: ansible_os_family == "RedHat"
|
|
||||||
- name: create containerd folder
|
|
||||||
file:
|
|
||||||
path: /etc/systemd/system/containerd.service.d
|
|
||||||
state: directory
|
|
||||||
mode: 0755
|
|
||||||
when: ansible_service_mgr == "systemd"
|
|
||||||
- name: override file for containerd
|
|
||||||
copy:
|
|
||||||
src: files/override.conf
|
|
||||||
dest: /etc/systemd/system/containerd.service.d/override.conf
|
|
||||||
mode: 0644
|
|
||||||
when: ansible_service_mgr == "systemd"
|
|
||||||
roles:
|
roles:
|
||||||
- role: google.cloud.gcsfuse
|
- role: google.cloud.gcsfuse
|
||||||
|
|
|
@ -9,9 +9,15 @@ lint: |
|
||||||
ansible-lint
|
ansible-lint
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance
|
||||||
image: ${MOLECULE_DISTRO:-ubuntu:xenial}
|
image: ubuntu:18.04
|
||||||
privileged: true
|
privileged: true
|
||||||
command: ${MOLECULE_COMMAND:-"sleep infinity"}
|
ansible.builtin.command: "/lib/systemd/systemd"
|
||||||
|
volumes:
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
|
- name: instance
|
||||||
|
image: debian:9
|
||||||
|
privileged: true
|
||||||
|
ansible.builtin.command: "/lib/systemd/systemd"
|
||||||
volumes:
|
volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
provisioner:
|
provisioner:
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: Example assertion
|
- name: Example assertion
|
||||||
assert:
|
ansible.builtin.assert:
|
||||||
that: true
|
that: true
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: gcloud | Archive | Ensure temp path exists
|
- name: gcloud | Archive | Ensure temp path exists
|
||||||
file: path={{ gcloud_archive_path }} state=directory mode=0755
|
ansible.builtin.file: path={{ gcloud_archive_path }} state=directory mode=0755
|
||||||
|
|
||||||
- name: gcloud | Archive | Extract Cloud SDK archive
|
- name: gcloud | Archive | Extract Cloud SDK archive
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: "{{ gcloud_archive_url }}"
|
src: "{{ gcloud_archive_url }}"
|
||||||
dest: "{{ gcloud_archive_path }}"
|
dest: "{{ gcloud_archive_path }}"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
creates: "{{ gcloud_library_path }}"
|
creates: "{{ gcloud_library_path }}"
|
||||||
|
|
||||||
- name: gcloud | Archive | Link binaries to /usr/bin (like package install)
|
- name: gcloud | Archive | Link binaries to /usr/bin (like package install)
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: "{{ gcloud_library_path }}/bin/{{ item }}"
|
src: "{{ gcloud_library_path }}/bin/{{ item }}"
|
||||||
dest: "/usr/bin/{{ item }}"
|
dest: "/usr/bin/{{ item }}"
|
||||||
state: link
|
state: link
|
||||||
|
@ -23,11 +23,11 @@
|
||||||
when: not gcloud_install_script
|
when: not gcloud_install_script
|
||||||
|
|
||||||
- name: gcloud | Archive | Add command completion
|
- name: gcloud | Archive | Add command completion
|
||||||
include_tasks: command_completion.yml
|
ansible.builtin.include_tasks: command_completion.yml
|
||||||
when: gcloud_command_completion
|
when: gcloud_command_completion
|
||||||
|
|
||||||
- name: gcloud | Archive | Install into Path
|
- name: gcloud | Archive | Install into Path
|
||||||
command: >-
|
ansible.builtin.command: >-
|
||||||
{{ gcloud_archive_path }}/install.sh --quiet
|
{{ gcloud_archive_path }}/install.sh --quiet
|
||||||
--usage-reporting {{ gcloud_usage_reporting | lower }}
|
--usage-reporting {{ gcloud_usage_reporting | lower }}
|
||||||
{% if gcloud_profile_path %}
|
{% if gcloud_profile_path %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
# task file to configure bash completion for gcloud
|
# task file to configure bash completion for gcloud
|
||||||
- name: gcloud | Archive | Debian | Ensure bash completion is installed
|
- name: gcloud | Archive | Debian | Ensure bash completion is installed
|
||||||
apt: name=bash-completion
|
ansible.builtin.apt: name=bash-completion
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
- name: gcloud | Archive | RedHat | Ensure bash completion is installed
|
- name: gcloud | Archive | RedHat | Ensure bash completion is installed
|
||||||
yum:
|
ansible.builtin.yum:
|
||||||
name:
|
name:
|
||||||
- bash-completion
|
- bash-completion
|
||||||
register: task_result
|
register: task_result
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
- name: gcloud | Archive | Ensure bash_completion.d directory exists
|
- name: gcloud | Archive | Ensure bash_completion.d directory exists
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/bash_completion.d
|
path: /etc/bash_completion.d
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: gcloud | Archive | Link binaries to /usr/bin (like package install)
|
- name: gcloud | Archive | Link binaries to /usr/bin (like package install)
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: "{{ gcloud_library_path }}/completion.bash.inc"
|
src: "{{ gcloud_library_path }}/completion.bash.inc"
|
||||||
dest: /etc/bash_completion.d/gcloud
|
dest: /etc/bash_completion.d/gcloud
|
||||||
state: link
|
state: link
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
---
|
---
|
||||||
# tasks to install gcloud via archive
|
# tasks to install gcloud via archive
|
||||||
- name: gcloud | Archive | Look for existing Google Cloud SDK installation
|
- name: gcloud | Archive | Look for existing Google Cloud SDK installation
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
|
path: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
|
||||||
register: gcloud_status
|
register: gcloud_status
|
||||||
|
|
||||||
- name: gcloud | Archive | Get gcloud_status
|
- name: gcloud | Archive | Get gcloud_status
|
||||||
debug: var=gcloud_status
|
ansible.builtin.debug: var=gcloud_status
|
||||||
|
|
||||||
- name: gcloud | Archive | Set installed version if installation exists
|
- name: gcloud | Archive | Set installed version if installation exists
|
||||||
block:
|
block:
|
||||||
- name: gcloud | Archive | Importing contents of {{ gcloud_archive_path }}/google-cloud-sdk/VERSION
|
- name: gcloud | Archive | Importing contents of ./google-cloud-sdk/VERSION in {{ gcloud_archive_path }}
|
||||||
slurp:
|
ansible.builtin.slurp:
|
||||||
src: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
|
src: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
|
||||||
register: gcloud_installed_version_data
|
register: gcloud_installed_version_data
|
||||||
- name: gcloud | Archive | Setting the gcloud_installed_version variable/fact
|
- name: gcloud | Archive | Setting the gcloud_installed_version variable/fact
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
gcloud_installed_version: "{{ (gcloud_installed_version_data.content|b64decode|trim) }}"
|
gcloud_installed_version: "{{ (gcloud_installed_version_data.content|b64decode|trim) }}"
|
||||||
- name: gcloud | Archive | get the gcloud_installed_version
|
- name: gcloud | Archive | get the gcloud_installed_version
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "google-cloud-sdk: {{ gcloud_installed_version }} is installed"
|
msg: "google-cloud-sdk: {{ gcloud_installed_version }} is installed"
|
||||||
- name: gcloud | Archive | Version already installed
|
- name: gcloud | Archive | Version already installed
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: >-
|
msg: >-
|
||||||
Skipping installation of google-cloud-sdk version {{ gcloud_version }} when
|
Skipping installation of google-cloud-sdk version {{ gcloud_version }} when
|
||||||
{{ gcloud_installed_version }} is already installed.
|
{{ gcloud_installed_version }} is already installed.
|
||||||
|
@ -29,12 +29,12 @@
|
||||||
when: gcloud_status.stat.exists
|
when: gcloud_status.stat.exists
|
||||||
|
|
||||||
- name: gcloud | Archive | Start installation
|
- name: gcloud | Archive | Start installation
|
||||||
include_tasks: archive_install.yml
|
ansible.builtin.include_tasks: archive_install.yml
|
||||||
when: gcloud_installed_version is undefined or
|
when: gcloud_installed_version is undefined or
|
||||||
gcloud_version is version(gcloud_installed_version, '>')
|
gcloud_version is version(gcloud_installed_version, '>')
|
||||||
|
|
||||||
- name: gcloud | Debian | Install the google-cloud-sdk additional components # noqa 301
|
- name: gcloud | Debian | Install the google-cloud-sdk additional components # noqa 301
|
||||||
command: gcloud components install {{ item }}
|
ansible.builtin.command: gcloud components install {{ item }}
|
||||||
register: gcloud_install_comp_status
|
register: gcloud_install_comp_status
|
||||||
changed_when: "'All components are up to date.' not in gcloud_install_comp_status.stderr_lines"
|
changed_when: "'All components are up to date.' not in gcloud_install_comp_status.stderr_lines"
|
||||||
loop: "{{ gcloud_additional_components }}"
|
loop: "{{ gcloud_additional_components }}"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: gcloud | Load Distro and OS specific variables
|
- name: gcloud | Load Distro and OS specific variables
|
||||||
include_vars: "{{ lookup('first_found', params) }}"
|
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||||
vars:
|
vars:
|
||||||
params:
|
params:
|
||||||
files:
|
files:
|
||||||
|
@ -12,4 +12,4 @@
|
||||||
- 'vars'
|
- 'vars'
|
||||||
|
|
||||||
- name: gcloud | Install the google-cloud-sdk from {{ gcloud_install_type }}
|
- name: gcloud | Install the google-cloud-sdk from {{ gcloud_install_type }}
|
||||||
include_tasks: "{{ gcloud_install_type }}/main.yml"
|
ansible.builtin.include_tasks: "{{ gcloud_install_type }}/main.yml"
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
---
|
---
|
||||||
# tasks that install gcloud on debian
|
# tasks that install gcloud on debian
|
||||||
- name: gcloud | Debian | Add an Apt signing key, uses whichever key is at the URL
|
- name: gcloud | Debian | Add an Apt signing key, uses whichever key is at the URL
|
||||||
apt_key:
|
ansible.builtin.apt_key:
|
||||||
url: "{{ gcloud_apt_key }}"
|
url: "{{ gcloud_apt_key }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: gcloud | Debian | Add the gcloud repository
|
- name: gcloud | Debian | Add the gcloud repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: "deb {{ gcloud_apt_url }} {{ gcloud_apt_repo }} main"
|
repo: "deb {{ gcloud_apt_url }} {{ gcloud_apt_repo }} main"
|
||||||
state: present
|
state: present
|
||||||
filename: google-cloud-sdk
|
filename: google-cloud-sdk
|
||||||
|
|
||||||
- name: gcloud | Debian | Install the google-cloud-sdk package
|
- name: gcloud | Debian | Install the google-cloud-sdk package
|
||||||
apt: name=google-cloud-sdk update_cache=yes
|
ansible.builtin.apt: name=google-cloud-sdk update_cache=yes
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: gcloud | Debian | Install the google-cloud-sdk additional components
|
- name: gcloud | Debian | Install the google-cloud-sdk additional components
|
||||||
apt: name=google-cloud-sdk-{{ item }} update_cache=yes
|
ansible.builtin.apt: name=google-cloud-sdk-{{ item }} update_cache=yes
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
# tasks file for gcloud
|
# tasks file for gcloud
|
||||||
|
|
||||||
- name: gcloud | Start package installation for specific distro
|
- name: gcloud | Start package installation for specific distro
|
||||||
include_tasks: "{{ ansible_os_family|lower }}.yml"
|
ansible.builtin.include_tasks: "{{ ansible_os_family|lower }}.yml"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: gcloud | RHEL | Add an Apt signing key, uses whichever key is at the URL
|
- name: gcloud | RHEL | Add an Apt signing key, uses whichever key is at the URL
|
||||||
yum_repository:
|
ansible.builtin.yum_repository:
|
||||||
name: google-cloud-sdk
|
name: google-cloud-sdk
|
||||||
description: Google Cloud SDK
|
description: Google Cloud SDK
|
||||||
file: google-cloud-sdk
|
ansible.builtin.file: google-cloud-sdk
|
||||||
baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
|
baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
|
||||||
enabled: yes
|
enabled: yes
|
||||||
gpgcheck: yes
|
gpgcheck: yes
|
||||||
|
@ -13,14 +13,14 @@
|
||||||
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
|
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
|
||||||
|
|
||||||
- name: gcloud | RHEL | Install the google-cloud-sdk package
|
- name: gcloud | RHEL | Install the google-cloud-sdk package
|
||||||
yum: name=google-cloud-sdk update_cache=yes
|
ansible.builtin.yum: name=google-cloud-sdk update_cache=yes
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: gcloud | Debian | Install the google-cloud-sdk additional components
|
- name: gcloud | Debian | Install the google-cloud-sdk additional components
|
||||||
yum: name=google-cloud-sdk-{{ item }} update_cache=yes
|
ansible.builtin.yum: name=google-cloud-sdk-{{ item }} update_cache=yes
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: gcsfuse | Ensure gpg is installed
|
- name: gcsfuse | Ensure gpg is installed
|
||||||
apt: name=gnupg
|
ansible.builtin.apt: name=gnupg
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: gcsfuse | Add an apt signing key
|
- name: gcsfuse | Add an apt signing key
|
||||||
apt_key:
|
ansible.builtin.apt_key:
|
||||||
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: gcsfuse | Add the apt repository
|
- name: gcsfuse | Add the apt repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: deb http://packages.cloud.google.com/apt gcsfuse-{{ ansible_distribution_release }} main
|
repo: deb http://packages.cloud.google.com/apt gcsfuse-{{ ansible_distribution_release }} main
|
||||||
state: present
|
state: present
|
||||||
filename: gcsfuse
|
filename: gcsfuse
|
||||||
|
|
||||||
- name: gcsfuse | Install gcsfuse
|
- name: gcsfuse | Install gcsfuse
|
||||||
apt: name=gcsfuse update_cache=yes
|
ansible.builtin.apt: name=gcsfuse update_cache=yes
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result is success
|
until: task_result is success
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
---
|
---
|
||||||
# tasks file for google.cloud.gcsfuse
|
# tasks file for google.cloud.gcsfuse
|
||||||
|
- name: main
|
||||||
- include_tasks: "{{ ansible_os_family|lower }}.yml"
|
ansible.builtin.include_tasks: "{{ ansible_os_family|lower }}.yml"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue