Compare commits
2
Commits
4fd0fbc071
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcdfc914db | ||
|
|
e4c7dadb9c |
@@ -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'
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
|
|
||||||
author: shnee
|
author: shnee
|
||||||
|
role_name: os_release
|
||||||
namespace: shnee
|
namespace: shnee
|
||||||
description: Retrieves the contents of /etc/os-release
|
description: Retrieves the contents of /etc/os-release
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
driver:
|
driver:
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Retrieve and parse the contents of /etc/os-release
|
- name: Retrieve and parse the contents of /etc/os-release
|
||||||
ansible.netcommon.cli_parse:
|
ansible.utils.cli_parse:
|
||||||
command: cat /etc/os-release
|
command: cat /etc/os-release
|
||||||
parser:
|
parser:
|
||||||
name: ansible.netcommon.native
|
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