Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Same playbook for all tests, updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Nov 6, 2018
1 parent f138351 commit 2e45587
Show file tree
Hide file tree
Showing 19 changed files with 141 additions and 24 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -3,8 +3,7 @@ xinetd

[![Build Status](https://travis-ci.org/robertdebock/ansible-role-xinetd.svg?branch=master)](https://travis-ci.org/robertdebock/ansible-role-xinetd)

Provides xinetd for your system.

The purpose of this role is to install and configure xinetd on your system.

Example Playbook
----------------
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Expand Up @@ -2,7 +2,7 @@
galaxy_info:
author: Robert de Bock
role_name: xinetd
description: Provides xinetd for your system.
description: The purpose of this role is to install and configure xinetd on your system.
license: Apache-2.0
company: none
min_ansible_version: 2.4
Expand Down
1 change: 0 additions & 1 deletion meta/purpose.txt

This file was deleted.

4 changes: 2 additions & 2 deletions molecule/alpine-edge/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/archlinux/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/centos-6/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/debian-stable/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/debian-unstable/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
3 changes: 3 additions & 0 deletions molecule/default/molecule.yml
Expand Up @@ -42,6 +42,9 @@ provisioner:
name: ansible
lint:
name: ansible-lint
config_options:
defaults:
callback_plugins: /usr/lib/python2.7/site-packages/ara/plugins/callbacks
scenario:
name: default
verifier:
Expand Down
4 changes: 2 additions & 2 deletions molecule/fedora-rawhide/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/opensuse-leap/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/opensuse-tumbleweed/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/ubuntu-artful/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/ubuntu-devel/playbook.yml
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: true
gather_facts: false
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
Expand Down
17 changes: 17 additions & 0 deletions molecule/vagrant/INSTALL.rst
@@ -0,0 +1,17 @@
*******
Vagrant driver installation guide
*******

Requirements
============

* Vagrant
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
* python-vagrant

Install
=======

.. code-block:: bash
$ sudo pip install python-vagrant
29 changes: 29 additions & 0 deletions molecule/vagrant/molecule.yml
@@ -0,0 +1,29 @@
---
dependency:
name: galaxy
options:
role-file: requirements.yml
driver:
name: vagrant
provider:
name: virtualbox
lint:
name: yamllint
platforms:
- name: xinetd-debian
box: debian/stretch64
- name: xinetd-fedora
box: fedora/28-cloud-base
provisioner:
name: ansible
lint:
name: ansible-lint
config_options:
defaults:
callback_plugins: /usr/lib/python2.7/site-packages/ara/plugins/callbacks
scenario:
name: vagrant
verifier:
name: goss
lint:
name: yamllint
9 changes: 9 additions & 0 deletions molecule/vagrant/playbook.yml
@@ -0,0 +1,9 @@
---
- name: Converge
hosts: all
gather_facts: no
become: yes

roles:
- robertdebock.bootstrap
- ansible-role-xinetd
8 changes: 8 additions & 0 deletions molecule/vagrant/tests/test_default.yml
@@ -0,0 +1,8 @@
# Molecule managed

---
file:
/etc/hosts:
exists: true
owner: root
group: root
53 changes: 53 additions & 0 deletions molecule/vagrant/verify.yml
@@ -0,0 +1,53 @@
---
# This is an example playbook to execute goss tests.
# Tests need distributed to the appropriate ansible host/groups
# prior to execution by `goss validate`.

- name: Verify
hosts: all
become: true
vars:
goss_version: v0.3.6
goss_arch: amd64
goss_dst: /usr/local/bin/goss
goss_sha256sum: 53dd1156ab66f2c4275fd847372e6329d895cfb2f0bcbec5f86c1c4df7236dde
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
goss_test_directory: /tmp
goss_format: documentation
tasks:
- name: Download and install Goss
get_url:
url: "{{ goss_url }}"
dest: "{{ goss_dst }}"
sha256sum: "{{ goss_sha256sum }}"
mode: 0755
register: download_goss
until: download_goss is succeeded
retries: 3

- name: Copy Goss tests to remote
copy:
src: "{{ item }}"
dest: "{{ goss_test_directory }}/{{ item | basename }}"
with_fileglob:
- "{{ lookup('env', 'MOLECULE_VERIFIER_TEST_DIRECTORY') }}/test_*.yml"

- name: Register test files
shell: "ls {{ goss_test_directory }}/test_*.yml"
register: test_files

- name: Execute Goss tests
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}"
register: test_results
with_items: "{{ test_files.stdout_lines }}"

- name: Display details about the Goss results
debug:
msg: "{{ item.stdout_lines }}"
with_items: "{{ test_results.results }}"

- name: Fail when tests fail
fail:
msg: "Goss failed to validate"
when: item.rc != 0
with_items: "{{ test_results.results }}"

0 comments on commit 2e45587

Please sign in to comment.