Added GitHub actions. Added missing template.
- Added a Github actions ci file. - Added a template that was accidentally left out. This template is required for the cli_parse module to work.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: ci
|
||||
'on':
|
||||
push:
|
||||
#branches:
|
||||
# - master
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: molecule
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install pypi dep.
|
||||
run: pip3 install molecule molecule-docker docker yamllint ansible-lint
|
||||
|
||||
# The ansible.netcommon is needed for the native parser of cli_parse.
|
||||
# TODO Add these to a requirements.yml
|
||||
- name: Install ansible deps.
|
||||
run: |
|
||||
ansible-galaxy collection install \
|
||||
ansible.utils \
|
||||
ansible.netcommon \
|
||||
community.docker
|
||||
|
||||
- name: Run molecule.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
@@ -1,4 +1,10 @@
|
||||
---
|
||||
|
||||
# TODO Consider adding Makefile. The Makefile can add the color vars and
|
||||
# potentially have a single way of doing things for different CI pipelines. In
|
||||
# addition a Makefile could be used to script running this on N distros if we
|
||||
# get too many.
|
||||
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Retrieve and parse the contents of /etc/os-release
|
||||
ansible.netcommon.cli_parse:
|
||||
ansible.utils.cli_parse:
|
||||
command: cat /etc/os-release
|
||||
parser:
|
||||
name: ansible.netcommon.native
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- example: ID=manjaro
|
||||
getval: '^\s*(?P<key>\S+)\s*=\s*(?P<val>.*)$'
|
||||
result:
|
||||
"{{ key }}": "{{ val }}"
|
||||
Reference in New Issue
Block a user