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 47804c1 commit f47e2d7
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 12 15 * *'
- cron: '10 16 15 * *'

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 @@ -42,6 +42,8 @@ jobs:
tag: "edge"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "testing"
- image: "debian"
tag: "unstable"
- image: "centos"
Expand All @@ -68,7 +70,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: '17 1 16 * *'
- cron: '51 20 16 * *'

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
- image="alpine" tag="latest"
- image="alpine" tag="edge"
- 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 @@
openssh
=========

<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-openssh"> <img src="https://travis-ci.org/robertdebock/ansible-role-openssh.svg?branch=master" alt="Build status"/></a> <img src="https://img.shields.io/ansible/role/d/30937"/> <img src="https://img.shields.io/ansible/quality/30937"/>

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

Install and configure openssh on your system.

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

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 All @@ -23,7 +22,7 @@ This example is taken from `molecule/resources/playbook.yml` and is tested on ea
- robertdebock.openssh
```
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 @@ -35,7 +34,7 @@ The machine you are running this on, may need to be prepared, I use this playboo
- robertdebock.bootstrap
```

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 f47e2d7

Please sign in to comment.