-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from bbaassssiiee/feature/localhost
Feature: molecule verify -s localhost
- Loading branch information
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
# This is a playbook to test the tasks. | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
gather_facts: true | ||
|
||
vars: | ||
ansible_user: "{{ lookup('env', 'USER') }}" | ||
role_name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
rhel8cis_rule_5_3_4: false | ||
|
||
pre_tasks: | ||
tasks: | ||
- name: "Include tasks" | ||
ansible.builtin.include_role: | ||
name: "{{ role_name }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
# Molecule configuration | ||
# https://molecule.readthedocs.io/en/latest/ | ||
|
||
driver: | ||
name: delegated | ||
options: | ||
managed: false | ||
ansible_connection_options: | ||
ansible_connection: local | ||
platforms: | ||
- name: localhost | ||
|
||
provisioner: | ||
name: ansible | ||
config_options: | ||
defaults: | ||
interpreter_python: auto_silent | ||
stdout_callback: yaml | ||
callbacks_enabled: profile_tasks, timer | ||
|
||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
flake8 | ||
verifier: | ||
name: ansible | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
become: true | ||
|
||
vars: | ||
role_name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
|
||
tasks: | ||
- name: "Include verify tasks" | ||
ansible.builtin.include_role: | ||
name: "{{ role_name }}" | ||
tasks_from: verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
- name: Install openscap | ||
ansible.builtin.dnf: | ||
state: present | ||
name: | ||
- openscap-scanner | ||
- scap-security-guide | ||
|
||
- name: Run CIS oscap scan and create /tmp/report.html | ||
ansible.builtin.command: | ||
oscap xccdf eval \ | ||
--report /tmp/report.html | ||
--profile cis | ||
--fetch-remote-resources | ||
/usr/share/xml/scap/ssg/content/ssg-almalinux8-ds.xml | ||
changed_when: true | ||
no_log: false | ||
ignore_errors: true |