Add molecule

This commit is contained in:
2021-05-18 16:51:13 +12:00
parent 97f3a46cef
commit 7619781008
7 changed files with 106 additions and 0 deletions

33
.yamllint Normal file
View File

@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable

View File

@@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@@ -0,0 +1,7 @@
---
- name: Converge
hosts: all
tasks:
- name: "Include ansible-role-rsyslog"
include_role:
name: "ansible-role-rsyslog"

View File

@@ -0,0 +1,19 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities:
- SYS_ADMIN
privileged: true
pre_build_image: true
provisioner:
name: ansible
verifier:
name: ansible

View File

@@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@@ -1,5 +1,9 @@
# Install and configure rsyslog
---
- name: Debugger
debug:
msg: 'OS Family: {{ ansible_os_family }}'
- name: set OS dependent variables
tags:
- rsyslog
@@ -99,6 +103,10 @@
- restart rsyslog
when: rsyslog_os_supported == True
- name: Reload systemd
systemd:
daemon_reload: yes
- name: enable service
tags:
- rsyslog

8
vars/Rocky.yml Normal file
View File

@@ -0,0 +1,8 @@
# RedHat Family OS defaults
---
rsyslog_package_names:
- rsyslog
rsyslog_service_name: rsyslog
rsyslog_file_owner: root
rsyslog_file_group: adm
rsyslog_os_supported: yes