fixing ansible-lint errors, fix gcsfuse

Ansible-lint is required for Ansible collection
certification for Automation Hub.

gcsfuse had no metadata associated with it, failing
the Ansible Hub upload.
This commit is contained in:
Yusuke Tsutsumi 2022-12-10 09:54:28 -08:00 committed by Yusuke Tsutsumi
commit 4907356bba
16 changed files with 71 additions and 33 deletions

View file

@ -4,7 +4,7 @@ galaxy_info:
author: Eric Anderson
description: Ansible role to install google-cloud-sdk
license: GPL-3.0
min_ansible_version: 2.9
min_ansible_version: "2.9"
platforms:
- name: Ubuntu
versions:

View file

@ -1,6 +1,9 @@
---
- name: gcloud | Archive | Ensure temp path exists
ansible.builtin.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
ansible.builtin.unarchive:
@ -37,7 +40,7 @@
--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 %}
{% if loop.index < gcloud_override_components | length %}
{% endif %}
{% endfor %}
{% endif %}

View file

@ -1,7 +1,8 @@
---
# task file to configure bash completion for gcloud
- name: gcloud | Archive | Debian | Ensure bash completion is installed
ansible.builtin.apt: name=bash-completion
ansible.builtin.apt:
name: "bash-completion"
register: task_result
until: task_result is success
retries: 10

View file

@ -6,9 +6,11 @@
register: gcloud_status
- name: gcloud | Archive | Get gcloud_status
ansible.builtin.debug: var=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:
@ -16,22 +18,21 @@
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) }}"
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.
when: gcloud_version == gcloud_installed_version
when: gcloud_status.stat.exists
- name: gcloud | Archive | Start installation
ansible.builtin.include_tasks: archive_install.yml
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 }}

View file

@ -5,8 +5,8 @@
vars:
params:
files:
- "os/{{ ansible_distribution|lower }}.yml"
- "os/{{ ansible_os_family|lower }}.yml"
- "os/{{ ansible_distribution | lower }}.yml"
- "os/{{ ansible_os_family | lower }}.yml"
- main.yml
paths:
- 'vars'

View file

@ -12,14 +12,18 @@
filename: google-cloud-sdk
- name: gcloud | Debian | Install the google-cloud-sdk package
ansible.builtin.apt: name=google-cloud-sdk update_cache=yes
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
ansible.builtin.apt:
name: "google-cloud-sdk-{{ item }}"
update_cache: "yes"
register: task_result
until: task_result is success
retries: 10

View file

@ -2,4 +2,4 @@
# tasks file for gcloud
- name: gcloud | Start package installation for specific distro
ansible.builtin.include_tasks: "{{ ansible_os_family|lower }}.yml"
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"

View file

@ -13,14 +13,18 @@
- 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
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
ansible.builtin.yum:
name: "google-cloud-sdk-{{ item }}"
update_cache: "yes"
register: task_result
until: task_result is success
retries: 10

View file

@ -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: []

View file

@ -1,6 +1,7 @@
---
- name: gcsfuse | Ensure gpg is installed
ansible.builtin.apt: name=gnupg
ansible.builtin.apt:
name: "gnupg"
register: task_result
until: task_result is success
retries: 10
@ -18,7 +19,9 @@
filename: gcsfuse
- name: gcsfuse | Install gcsfuse
ansible.builtin.apt: name=gcsfuse update_cache=yes
ansible.builtin.apt:
name: "gcsfuse"
update_cache: "yes"
register: task_result
until: task_result is success
retries: 10

View file

@ -1,4 +1,4 @@
---
# tasks file for google.cloud.gcsfuse
- name: main
ansible.builtin.include_tasks: "{{ ansible_os_family|lower }}.yml"
- name: Main
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"