Skip to content

Commit

Permalink
Use molecule 3
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Feb 21, 2020
1 parent 51589ef commit f773ebd
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '*'
pull_request:
schedule:
- cron: '24 9 8 * *'
- cron: '58 15 8 * *'

jobs:
lint:
Expand All @@ -20,7 +20,7 @@ jobs:
- name: checkout
uses: actions/checkout@v2
- name: molecule
uses: robertdebock/molecule-action@1.2.8
uses: robertdebock/molecule-action@2.0.0
with:
entrypoint: /usr/local/bin/molecule
args: lint
Expand All @@ -34,6 +34,8 @@ jobs:
config:
- image: "debian"
tag: "latest"
- image: "debian"
tag: "testing"
- image: "debian"
tag: "unstable"
- image: "centos"
Expand All @@ -60,7 +62,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@1.2.8
uses: robertdebock/molecule-action@2.0.0
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
tags:
- '*'
schedule:
- cron: '0 1 9 * *'
- cron: '26 5 9 * *'

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
namespace="robertdebock"
matrix:
- image="debian" tag="latest"
- image="debian" tag="testing"
- image="debian" tag="unstable"
- image="centos" tag="7"
- image="centos" tag="latest"
Expand Down
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends: default

rules:
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
httpd
=========

<img src="https://docs.ansible.com/ansible-tower/3.2.4/html_ja/installandreference/_static/images/logo_invert.png" width="10%" height="10%" alt="Ansible logo" align="right"/>
<a href="https://travis-ci.org/robertdebock/ansible-role-httpd"> <img src="https://travis-ci.org/robertdebock/ansible-role-httpd.svg?branch=master" alt="Build status"/></a> <img src="https://img.shields.io/ansible/role/d/21855"/> <img src="https://img.shields.io/ansible/quality/21855"/>

<a href="https://github.com/robertdebock/ansible-role-httpd/actions"><img src="https://github.com/robertdebock/ansible-role-httpd/workflows/GitHub%20Action/badge.svg"/></a>

Install and configure httpd on your system.

|Travis|GitHub|Quality|Downloads|
|------|------|-------|---------|
|[![travis](https://travis-ci.org/robertdebock/ansible-role-httpd.svg?branch=master)](https://travis-ci.org/robertdebock/ansible-role-httpd)|[![github](https://github.com/robertdebock/ansible-role-httpd/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-httpd/actions)|![quality](https://img.shields.io/ansible/quality/21855)|![downloads](https://img.shields.io/ansible/role/d/21855)|

Example Playbook
----------------

This example is taken from `molecule/resources/playbook.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
Expand Down Expand Up @@ -55,7 +54,7 @@ This example is taken from `molecule/resources/playbook.yml` and is tested on ea
- robertdebock.httpd
```

The machine you are running this on, may need to be prepared, I use this playbook to ensure everything is in place to let the role work.
The machine may need to be prepared using `molecule/resources/prepare.yml`:
```yaml
---
- name: Prepare
Expand All @@ -70,7 +69,7 @@ The machine you are running this on, may need to be prepared, I use this playboo
- robertdebock.python_pip
```

After running this role, this playbook runs to verify that everything works, this may be a good example how you can use this role.
For verification `molecule/resources/verify.yml` run after the role has been applied.
```yaml
---
- name: Verify
Expand Down
8 changes: 3 additions & 5 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
lint:
name: yamllint
lint: |
yamllint molecule/default/converge.yml
ansible-lint molecule/default/converge.yml
driver:
name: docker
platforms:
Expand All @@ -26,8 +27,5 @@ provisioner:
bin_ansible_callbacks: yes
verifier:
name: ansible
lint:
name: ansible-lint
enabled: yes
scenario:
name: default
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ deps =
previous: ansible>=2.8, <2.9
current: ansible>=2.9
next: git+https://github.com/ansible/ansible.git@devel
molecule>=3, <4
docker
molecule
ansible-lint
commands = molecule test
setenv =
TOX_ENVNAME={envname}
Expand Down

0 comments on commit f773ebd

Please sign in to comment.