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:
Yusuke Tsutsumi 2022-11-26 07:00:46 +00:00 committed by Yusuke Tsutsumi
commit f692dd4c76
21 changed files with 113 additions and 96 deletions

View file

@ -3,7 +3,7 @@
hosts: all
pre_tasks:
- name: Install gpg for apt_key
apt:
ansible.builtin.apt:
name: gnupg
update_cache: true
when: ansible_os_family|lower == "debian"

View file

@ -3,20 +3,20 @@
hosts: all
pre_tasks:
- name: Update package cache
package: update_cache=yes
ansible.builtin.package: update_cache=yes
changed_when: false
register: task_result
until: task_result is success
retries: 10
delay: 2
- name: create containerd folder
file:
ansible.builtin.file:
path: /etc/systemd/system/containerd.service.d
state: directory
mode: 0755
when: ansible_service_mgr == "systemd"
- name: override file for containerd
copy:
ansible.builtin.copy:
src: files/override.conf
dest: /etc/systemd/system/containerd.service.d/override.conf
mode: 0644

View file

@ -9,9 +9,15 @@ lint: |
ansible-lint
platforms:
- name: instance
image: ${MOLECULE_DISTRO:-ubuntu:xenial}
image: ubuntu:18.04
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:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:

View file

@ -3,7 +3,7 @@
hosts: all
pre_tasks:
- name: Install gpg for apt_key
apt:
ansible.builtin.apt:
name: gnupg
update_cache: true
when: ansible_os_family|lower == "debian"

View file

@ -5,5 +5,5 @@
hosts: all
tasks:
- name: Example assertion
assert:
ansible.builtin.assert:
that: true

View file

@ -2,25 +2,12 @@
- name: Converge
hosts: all
pre_tasks:
- name: Using apt update the packages
apt:
update_cache: yes
when: ansible_os_family == "Debian"
- name: Using apt update the packages
yum:
update_cache: yes
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"
- name: Update package cache
ansible.builtin.package: update_cache=yes
changed_when: false
register: task_result
until: task_result is success
retries: 10
delay: 2
roles:
- role: google.cloud.gcsfuse

View file

@ -9,9 +9,15 @@ lint: |
ansible-lint
platforms:
- name: instance
image: ${MOLECULE_DISTRO:-ubuntu:xenial}
image: ubuntu:18.04
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:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:

View file

@ -5,5 +5,5 @@
hosts: all
tasks:
- name: Example assertion
assert:
ansible.builtin.assert:
that: true