-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated role to work with the latest version of Ansible and the latest version of Goss
- Loading branch information
1 parent
c27ebd2
commit 9a32312
Showing
24 changed files
with
236 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
[bumpversion] | ||
current_version = 0.1.5 | ||
current_version = 0.1.6 | ||
commit = True | ||
tag = True | ||
|
||
[bumpversion:file:VERSION] | ||
|
||
[bumpversion:file:README.md] | ||
|
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,48 @@ | ||
--- | ||
name: Molecule Test | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pwd | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements.txt | ||
- name: Details about molecule | ||
run: | | ||
echo "" | ||
echo "Molecule version" | ||
molecule --version | ||
echo "" | ||
echo "Molecule drivers" | ||
molecule drivers | ||
echo "" | ||
echo "Molecule list" | ||
molecule list | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
|
||
- name: Test with molecule | ||
run: molecule test -- -v | ||
env: | ||
ANSIBLE_FORCE_COLOR: '1' | ||
ANSIBLE_STDOUT_CALLBACK: yaml | ||
PY_COLORS: '1' |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
VERSION=0.1.4 | ||
VERSION=0.1.6 |
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,6 @@ | ||
[defaults] | ||
|
||
# Use the YAML callback plugin. | ||
stdout_callback = yaml | ||
# Use the stdout_callback when running ad-hoc commands. | ||
bin_ansible_callbacks = True |
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
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
connection: local | ||
gather_facts: false | ||
|
||
roles: | ||
- role: marcinpraczko.goss-install |
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,36 @@ | ||
--- | ||
- name: Create | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
# no_log: "{{ molecule_no_log }}" | ||
tasks: | ||
|
||
# TODO: Developer must implement and populate 'server' variable | ||
|
||
- name: Create instance config | ||
when: server.changed | default(false) | bool # noqa no-handler | ||
block: | ||
- name: Populate instance config dict # noqa jinja | ||
ansible.builtin.set_fact: | ||
instance_conf_dict: {} | ||
# instance': "{{ }}", | ||
# address': "{{ }}", | ||
# user': "{{ }}", | ||
# port': "{{ }}", | ||
# 'identity_file': "{{ }}", } | ||
with_items: "{{ server.results }}" | ||
register: instance_config_dict | ||
|
||
- name: Convert instance config dict to a list | ||
ansible.builtin.set_fact: | ||
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" | ||
|
||
- name: Dump instance config | ||
ansible.builtin.copy: | ||
content: | | ||
# Molecule managed | ||
{{ instance_conf | to_json | from_json | to_yaml }} | ||
dest: "{{ molecule_instance_config }}" | ||
mode: 0600 |
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,24 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
# no_log: "{{ molecule_no_log }}" | ||
tasks: | ||
# Developer must implement. | ||
|
||
# Mandatory configuration for Molecule to function. | ||
|
||
- name: Populate instance config | ||
ansible.builtin.set_fact: | ||
instance_conf: {} | ||
|
||
- name: Dump instance config | ||
ansible.builtin.copy: | ||
content: | | ||
# Molecule managed | ||
{{ instance_conf | to_json | from_json | to_yaml }} | ||
dest: "{{ molecule_instance_config }}" | ||
mode: 0600 | ||
when: server.changed | default(false) | bool # noqa no-handler |
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
provider: | ||
name: virtualbox | ||
lint: | ||
name: yamllint | ||
# https://stackoverflow.com/questions/69652451/molecule-error-computed-fully-qualified-role-name-does-not-follow-current-galax | ||
role_name_check: 1 | ||
|
||
platforms: | ||
- name: centos7 | ||
box: centos/7 | ||
- name: ubuntu1804 | ||
box: generic/ubuntu1804 | ||
- name: instance | ||
# you might want to add your own variables here based on what provisioning | ||
# you are doing like: | ||
# image: quay.io/centos/centos:stream8 | ||
|
||
provisioner: | ||
name: ansible | ||
log: true | ||
lint: | ||
name: ansible-lint | ||
|
||
verifier: | ||
name: goss | ||
lint: | ||
name: yamllint | ||
name: testinfra | ||
additional_files_or_dirs: | ||
- ../path/to/test_1.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.