Added linting to molecule.

master
shnee 4 years ago
parent aeb9d2145e
commit a722fd8574

@ -1,4 +1,6 @@
---
galaxy_info: galaxy_info:
author: shnee author: shnee
namespace: shnee namespace: shnee
description: Retrieves the contents of /etc/os-release description: Retrieves the contents of /etc/os-release
@ -6,24 +8,13 @@ galaxy_info:
license: GPL-3.0-only license: GPL-3.0-only
min_ansible_version: 2.1 min_ansible_version: 2.1
# platforms:
# Provide a list of supported platforms, and for each platform a list of versions. - name: EL
# If you don't wish to enumerate all versions for a particular platform, use 'all'. versions:
# To view available platforms and versions (or releases), visit: - 8
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: [] galaxy_tags:
- distro
- system
dependencies: [] dependencies: []

@ -3,5 +3,5 @@
hosts: all hosts: all
tasks: tasks:
- name: "Include shnee.os_release" - name: "Include shnee.os_release"
include_role: ansible.builtin.include_role:
name: "shnee.os_release" name: "shnee.os_release"

@ -3,6 +3,10 @@ dependency:
name: galaxy name: galaxy
driver: driver:
name: docker name: docker
lint: |
set -e
yamllint .
ansible-lint
platforms: platforms:
- name: centos-8-stream - name: centos-8-stream
image: quay.io/centos/centos:stream8 image: quay.io/centos/centos:stream8

@ -24,9 +24,9 @@
tasks: tasks:
- name: Is the OS in exp_vals? - name: Is the OS in exp_vals?
assert: ansible.builtin.assert:
that: exp_vals[ansible_hostname] is defined that: exp_vals[ansible_hostname] is defined
- name: Verify that os-release matches our expected values. - name: Verify that os-release matches our expected values.
assert: ansible.builtin.assert:
that: os_release[item.key] == item.value that: os_release[item.key] == item.value
loop: "{{ exp_vals[ansible_hostname] | dict2items }}" loop: "{{ exp_vals[ansible_hostname] | dict2items }}"

@ -7,4 +7,3 @@
os: linux os: linux
command: cat os-release command: cat os-release
set_fact: os_release set_fact: os_release

Loading…
Cancel
Save