Skip to content

Commit

Permalink
bring up to speed.
Browse files Browse the repository at this point in the history
  • Loading branch information
buluma committed Dec 25, 2023
1 parent d69a938 commit 480a2a5
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 72 deletions.
22 changes: 15 additions & 7 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
# Ansible managed
#
exclude_paths:
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml
- ./molecule/default/verify.yml
- ./molecule/default/collections.yml
- ./.tox
- ./.cache
- meta/preferences.yml
- molecule/default/prepare.yml
- molecule/default/converge.yml
- molecule/default/verify.yml
- molecule/default/collections.yml
- .tox
- .cache
- .github
- requirements.yml

skip_list:
- yaml[truthy]

enable_list:
- name[prefix]
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
repository:
description: Install and configure revealmd on your system.
homepage: https://buluma.github.io/
topics: revealmd, presentation, html, markdown, nodejs, git, npm, slides, ansible, molecule, tox, playbook, hacktoberfest
topics: revealmd, presentation, html, markdown, nodejs, git, npm, slides, ansible, molecule, tox, playbook
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
rev: v1.32.0
hooks:
- id: yamllint
args: [-c=.yamllint]

- repo: https://github.com/buluma/pre-commit
rev: v1.0.2
rev: v1.0.3
hooks:
- id: ansible_role_find_unused_variable
- id: ansible_role_find_empty_files
- id: ansible_role_find_empty_directories
- id: ansible_role_fix_readability
- id: ansible_role_find_undefined_handlers
- id: ansible_role_find_unquoted_values
- id: ansible_role_find_horizontal_when
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Here is how you can help, a lot of steps are related to GitHub, not specifically

When you spot an issue, [create an issue](https://github.com/buluma/ansible-role-revealmd/issues).

Making the issue help me and others to find similar problems in the future.
Raising the issue helps me and others to find similar problems and solutions in the future.

### [2. Fork the project.](#2-fork-the-project)

Expand All @@ -33,7 +33,7 @@ I typically do that by cloning the repository (in your namespace) locally:
git clone git@github.com:YOURNAMESPACE/ansible-role-revealmd.git
```

Now you can start to edit on your laptop.
Now you can start to edit on your laptop/PC.

### [4. Optionally: test your changes](#4-optionally-test-your-changes)

Expand Down Expand Up @@ -69,6 +69,7 @@ In the comment-box, you can [refer to the issue number](https://help.github.com/

### [7. Wait](#7-wait)

Now I'll get a message that you've added some code. Thank you, really.
Now I'll get a message that you've added some code. Thank you, trully.

CI starts to test your changes once pull request is reviewed. You can follow the progress on GitHub.

CI starts to test your changes. You can follow the progress on GitHub.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Apache License
Version 2.0, 04 2022
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Expand Down Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Michael Buluma (me@buluma.me.ke)
Copyright 2023 Shadow Walker (bulumaknight@gmail.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
52 changes: 29 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# [revealmd](#revealmd)
# Ansible role [revealmd](https://galaxy.ansible.com/ui/standalone/roles/buluma/revealmd/documentation)

Install and configure revealmd on your system.

|GitHub|GitLab|Quality|Downloads|Version|Issues|Pull Requests|
|------|------|-------|---------|-------|------|-------------|
|[![github](https://github.com/buluma/ansible-role-revealmd/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-revealmd/actions)|[![gitlab](https://gitlab.com/buluma/ansible-role-revealmd/badges/master/pipeline.svg)](https://gitlab.com/buluma/ansible-role-revealmd)|[![quality](https://img.shields.io/ansible/quality/58940)](https://galaxy.ansible.com/buluma/revealmd)|[![downloads](https://img.shields.io/ansible/role/d/58940)](https://galaxy.ansible.com/buluma/revealmd)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/releases/)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/pulls/)|
|GitHub|Version|Issues|Pull Requests|Downloads|
|------|-------|------|-------------|---------|
|[![github](https://github.com/buluma/ansible-role-revealmd/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-revealmd/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/releases/)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-revealmd.svg)](https://github.com/buluma/ansible-role-revealmd/pulls/)|[![Ansible Role](https://img.shields.io/ansible/role/d/buluma/revealmd)](https://galaxy.ansible.com/ui/standalone/roles/buluma/revealmd/documentation)|

## [Example Playbook](#example-playbook)

This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
This example is taken from [`molecule/default/converge.yml`](https://github.com/buluma/ansible-role-revealmd/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.

```yaml
---
- name: Converge
Expand All @@ -20,7 +21,8 @@ This example is taken from `molecule/default/converge.yml` and is tested on each
- role: buluma.revealmd
```
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
The machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/buluma/ansible-role-revealmd/blob/master/molecule/default/prepare.yml):

```yaml
---
- name: Prepare
Expand All @@ -34,10 +36,12 @@ The machine needs to be prepared. In CI this is done using `molecule/default/pre
- role: buluma.git
```

Also see a [full explanation and example](https://buluma.github.io/how-to-use-these-roles.html) on how to use these roles.

## [Role Variables](#role-variables)

The default values for the variables are set in `defaults/main.yml`:
The default values for the variables are set in [`defaults/main.yml`](https://github.com/buluma/ansible-role-revealmd/blob/master/defaults/main.yml):

```yaml
---
# defaults file for revealmd
Expand All @@ -58,25 +62,26 @@ revealmd_options: --theme black

## [Requirements](#requirements)

- pip packages listed in [requirements.txt](https://github.com/buluma/ansible-role-revealmd/blob/main/requirements.txt).
- pip packages listed in [requirements.txt](https://github.com/buluma/ansible-role-revealmd/blob/master/requirements.txt).

## [Status of used roles](#status-of-requirements)
## [State of used roles](#state-of-used-roles)

The following roles are used to prepare a system. You can prepare your system in another way.

| Requirement | GitHub | GitLab |
| Requirement | GitHub | Version |
|-------------|--------|--------|
|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Build Status GitHub](https://github.com/buluma/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/buluma/ansible-role-bootstrap/badges/main/pipeline.svg)](https://gitlab.com/buluma/ansible-role-bootstrap)|
|[buluma.epel](https://galaxy.ansible.com/buluma/epel)|[![Build Status GitHub](https://github.com/buluma/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-epel/actions)|[![Build Status GitLab ](https://gitlab.com/buluma/ansible-role-epel/badges/main/pipeline.svg)](https://gitlab.com/buluma/ansible-role-epel)|
|[buluma.git](https://galaxy.ansible.com/buluma/git)|[![Build Status GitHub](https://github.com/buluma/ansible-role-git/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-git/actions)|[![Build Status GitLab ](https://gitlab.com/buluma/ansible-role-git/badges/master/pipeline.svg)](https://gitlab.com/buluma/ansible-role-git)|
|[buluma.npm](https://galaxy.ansible.com/buluma/npm)|[![Build Status GitHub](https://github.com/buluma/ansible-role-npm/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-npm/actions)|[![Build Status GitLab ](https://gitlab.com/buluma/ansible-role-npm/badges/main/pipeline.svg)](https://gitlab.com/buluma/ansible-role-npm)|
|[buluma.service](https://galaxy.ansible.com/buluma/service)|[![Build Status GitHub](https://github.com/buluma/ansible-role-service/workflows/Ansible%20Molecule/badge.svg)](https://github.com/buluma/ansible-role-service/actions)|[![Build Status GitLab ](https://gitlab.com/buluma/ansible-role-service/badges/main/pipeline.svg)](https://gitlab.com/buluma/ansible-role-service)|
|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Ansible Molecule](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-bootstrap.svg)](https://github.com/shadowwalker/ansible-role-bootstrap)|
|[buluma.epel](https://galaxy.ansible.com/buluma/epel)|[![Ansible Molecule](https://github.com/buluma/ansible-role-epel/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-epel/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-epel.svg)](https://github.com/shadowwalker/ansible-role-epel)|
|[buluma.git](https://galaxy.ansible.com/buluma/git)|[![Ansible Molecule](https://github.com/buluma/ansible-role-git/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-git/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-git.svg)](https://github.com/shadowwalker/ansible-role-git)|
|[buluma.npm](https://galaxy.ansible.com/buluma/npm)|[![Ansible Molecule](https://github.com/buluma/ansible-role-npm/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-npm/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-npm.svg)](https://github.com/shadowwalker/ansible-role-npm)|
|[buluma.service](https://galaxy.ansible.com/buluma/service)|[![Ansible Molecule](https://github.com/buluma/ansible-role-service/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-service/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-service.svg)](https://github.com/shadowwalker/ansible-role-service)|

## [Dependencies](#dependencies)

Most roles require some kind of preparation, this is done in `molecule/default/prepare.yml`. This role has a "hard" dependency on the following roles:

- buluma.npm

## [Context](#context)

This role is a part of many compatible roles. Have a look at [the documentation of these roles](https://buluma.github.io/) for further information.
Expand All @@ -91,18 +96,16 @@ This role has been tested on these [container images](https://hub.docker.com/u/b

|container|tags|
|---------|----|
|el|8|
|debian|bullseye|
|fedora|all|
|[EL](https://hub.docker.com/repository/docker/buluma/enterpriselinux/general)|8|
|[Debian](https://hub.docker.com/repository/docker/buluma/debian/general)|bullseye|
|[Fedora](https://hub.docker.com/repository/docker/buluma/fedora/general)|all|

The minimum version of Ansible required is 2.10, tests have been done to:
The minimum version of Ansible required is 2.12, tests have been done to:

- The previous version.
- The current version.
- The development version.



If you find issues, please register them in [GitHub](https://github.com/buluma/ansible-role-revealmd/issues)

## [Changelog](#changelog)
Expand All @@ -111,8 +114,11 @@ If you find issues, please register them in [GitHub](https://github.com/buluma/a

## [License](#license)

Apache-2.0
[Apache-2.0](https://github.com/buluma/ansible-role-revealmd/blob/master/LICENSE)

## [Author Information](#author-information)

[Michael Buluma](https://buluma.github.io/)
[Shadow Walker](https://buluma.github.io/)


Template inspired by [Robert de Bock](https://github.com/robertdebock)
11 changes: 5 additions & 6 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ This software implements other software, it's not very likely that this software

## [Supported Versions](#supported-versions)

The current major version is supported. For example if the current version is 3.4.1:
These version of [ansible](https://pypi.org/project/ansible/) are supported:

| Version | Supported |
| ------- | ------------------ |
| 3.4.1 | :white_check_mark: |
| 3.4.x | :white_check_mark: |
| 3.x.x | :white_check_mark: |
| 2.0.0 | :x: |
| 1.0.0 | :x: |
| 9 | :white_check_mark: |
| 8 | :white_check_mark: |
| 7 | :white_check_mark: |

## [Reporting a Vulnerability](#reporting-a-vulnarability)

Expand All @@ -21,3 +19,4 @@ Please [open an issue](https://github.com/buluma/ansible-role-revealmd/issues) d
Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.

7 changes: 3 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
galaxy_info:
author: Michael Buluma
namespace: buluma
author: buluma
role_name: revealmd
description: Install and configure revealmd on your system.
license: Apache-2.0
company: none
min_ansible_version: "2.10"
min_ansible_version: "2.12"

platforms:
- name: EL
versions:
- 8
- "8"
- name: Debian
versions:
- bullseye
Expand Down
7 changes: 4 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ lint: |
driver:
name: docker
platforms:
- name: "revealmd-${image:-docker-ubuntu2104-ansible}-${tag:-latest}${TOX_ENVNAME}"
image: "${namespace:-buluma}/${image:-docker-ubuntu2104-ansible}:${tag:-latest}"
- name: "revealmd-${image:-fedora}-${tag:-latest}${TOX_ENVNAME}"
image: "${namespace:-buluma}/${image:-fedora}:${tag:-latest}"
command: /sbin/init
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes
provisioner:
Expand Down
8 changes: 4 additions & 4 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---

- name: test if revealmd_directory is set correctly
- name: assert | Test if revealmd_directory is set correctly
ansible.builtin.assert:
that:
- revealmd_directory is defined
- revealmd_directory is string
quiet: yes

- name: test if revealmd_presentation is set correctly
- name: assert | Test if revealmd_presentation is set correctly
ansible.builtin.assert:
that:
- revealmd_presentation is defined
- revealmd_presentation is string
quiet: yes

- name: test if revealmd_port is set correctly
- name: assert | Test if revealmd_port is set correctly
ansible.builtin.assert:
that:
- revealmd_port is defined
Expand All @@ -23,7 +23,7 @@
- revealmd_port < 65536
quiet: yes

- name: test if revealmd_options is set correctly
- name: assert | Test if revealmd_options is set correctly
ansible.builtin.assert:
that:
- revealmd_options is defined
Expand Down
12 changes: 6 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
# tasks file for revealmd

- name: import assert.yml
- name: Import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost

- name: install revealmd
- name: Install revealmd
community.general.npm:
name: reveal-md
state: present
global: yes

- name: create directory
- name: Create directory
ansible.builtin.file:
path: "{{ revealmd_directory }}"
state: directory
mode: "0755"

- name: place index.md default presentation
- name: Place index.md default presentation
ansible.builtin.copy:
src: index.md
dest: "{{ revealmd_directory }}/index.md"
mode: "0644"

- name: create revealmd service
- name: Create revealmd service
ansible.builtin.import_role:
name: buluma.service
vars:
Expand All @@ -34,7 +34,7 @@
start_command: "{{ revealmd_path }}/reveal-md --port {{ revealmd_port }} {{ revealmd_options | default(omit) }} {{ revealmd_presentation }}"
working_directory: "{{ revealmd_directory }}"

- name: start and enable revealmd
- name: Start and enable revealmd
ansible.builtin.service:
name: revealmd
state: started
Expand Down
Loading

0 comments on commit 480a2a5

Please sign in to comment.