This commit is contained in:
parent
4125d011d2
commit
aebaa0d348
3
.drone.env
Normal file
3
.drone.env
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export ANSIBLE_LINT_EXCLUSION="--exclude .gitea"
|
||||||
|
export ANSIBLE_INVENTORY="-i 127.0.0.1, --connection=local"
|
||||||
|
export ANSIBLE_PLAYBOOK="baseos.yml"
|
26
.drone.yml
Normal file
26
.drone.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: CentOS_9-Ansible-Pipeline
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
exclude:
|
||||||
|
- main
|
||||||
|
event: [push]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ansible_environment_verify
|
||||||
|
image: gitea.thezengarden.net/podman/ansible-dev/centos9:release
|
||||||
|
commands:
|
||||||
|
- . ./.drone.env
|
||||||
|
- env
|
||||||
|
- git log -1
|
||||||
|
- ansible --version
|
||||||
|
- ansible-lint --version
|
||||||
|
|
||||||
|
- name: ansible_lint
|
||||||
|
image: gitea.thezengarden.net/podman/ansible-dev/centos9:release
|
||||||
|
commands:
|
||||||
|
- . ./.drone.env
|
||||||
|
- ansible-lint --offline $ANSIBLE_LINT_EXCLUSION
|
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[defaults]
|
||||||
|
roles_path = roles
|
4
roles/testing/README.md
Normal file
4
roles/testing/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Role Name
|
||||||
|
=========
|
||||||
|
|
||||||
|
A simple role to say hello to the world.
|
29
roles/testing/meta/main.yml
Normal file
29
roles/testing/meta/main.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
galaxy_info:
|
||||||
|
author: Chris Hammer
|
||||||
|
description: Simple default role to say hello world.
|
||||||
|
|
||||||
|
license: GPL-2.0-or-later
|
||||||
|
|
||||||
|
min_ansible_version: "2.14"
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
- name: Fedora
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
|
|
||||||
|
- name: EL
|
||||||
|
versions:
|
||||||
|
- "8"
|
||||||
|
- "9"
|
||||||
|
|
||||||
|
galaxy_tags: []
|
||||||
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||||
|
# remove the '[]' above, if you add tags to this list.
|
||||||
|
#
|
||||||
|
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||||
|
# Maximum 20 tags per role.
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
|
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||||
|
# if you add dependencies to this list.
|
7
roles/testing/tasks/main.yml
Normal file
7
roles/testing/tasks/main.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Hello World.
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: Hello world.
|
||||||
|
|
||||||
|
|
||||||
|
...
|
14
tests/unit-test.yml
Normal file
14
tests/unit-test.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: Test the role provided in extra_vars
|
||||||
|
hosts: all
|
||||||
|
become: false
|
||||||
|
gather_facts: true
|
||||||
|
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Include role to test
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: "{{ __test_role | default('testing') }}"
|
||||||
|
|
||||||
|
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user