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 #1088 from ajdecon/singularity-centos-8
Add Molecule testing for Singularity, plus infra for more roles
- Loading branch information
Showing
12 changed files
with
264 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: test ansible roles with molecule | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
deepops-role: | ||
- singularity_wrapper | ||
steps: | ||
- name: check out repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "${{ github.repository }}" | ||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- name: install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install molecule[docker] docker ansible | ||
- name: run molecule test | ||
run: | | ||
cd "${{ github.repository }}/roles" | ||
ansible-galaxy role install --force -r ./requirements.yml | ||
ansible-galaxy collection install --force -r ./requirements.yml | ||
cd "${{ matrix.deepops-role }}" | ||
molecule test |
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,10 +1,5 @@ | ||
--- | ||
- hosts: all | ||
become: yes | ||
pre_tasks: | ||
- name: create a folder for go | ||
file: | ||
path: "{{ golang_install_dir }}" | ||
recurse: yes | ||
roles: | ||
- lecorguille.singularity | ||
- singularity_wrapper |
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,33 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
max-spaces-after: -1 | ||
level: error | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: disable | ||
truthy: disable |
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,10 @@ | ||
--- | ||
# vars for lecorguille.singularity | ||
singularity_version: "3.7.3" | ||
singularity_conf_path: "/etc/singularity/singularity.conf" | ||
bind_paths: [] | ||
|
||
# vars for gantsign.golang | ||
golang_version: "1.14.4" | ||
golang_install_dir: "/opt/go/{{ golang_version }}" | ||
golang_gopath: "/opt/go/packages" |
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,9 @@ | ||
--- | ||
galaxy_info: | ||
role_name: singularity_wrapper | ||
namespace: deepops | ||
author: DeepOps Team | ||
company: NVIDIA | ||
description: Wrap lecourguille.singularity role | ||
license: 3-Clause BSD | ||
min_ansible_version: 2.9 |
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,7 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include singularity_wrapper" | ||
include_role: | ||
name: "singularity_wrapper" |
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,26 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
options: | ||
requirements-file: requirements.yml | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: ubuntu-1804 | ||
image: geerlingguy/docker-ubuntu1804-ansible | ||
pre_build_image: true | ||
- name: ubuntu-2004 | ||
image: geerlingguy/docker-ubuntu2004-ansible | ||
pre_build_image: true | ||
- name: centos-7 | ||
image: geerlingguy/docker-centos7-ansible | ||
pre_build_image: true | ||
- name: centos-8 | ||
image: geerlingguy/docker-centos8-ansible | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
ansible_args: | ||
- -vv | ||
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,13 @@ | ||
--- | ||
- name: verify | ||
hosts: all | ||
tasks: | ||
- name: check for path to singularity | ||
command: which singularity | ||
register: which_singularity | ||
changed_when: which_singularity.rc != 0 | ||
|
||
- name: verify path to singularity | ||
assert: | ||
that: | ||
- "'/usr/local/bin/singularity' in which_singularity.stdout" |
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,35 @@ | ||
--- | ||
- name: centos 8 - ensure powertools installed | ||
block: | ||
- name: ensure prereq packages installed | ||
yum: | ||
name: "dnf-plugins-core" | ||
state: "present" | ||
- name: enable powertools | ||
command: "yum config-manager --set-enabled powertools" | ||
register: enable_powertools | ||
changed_when: enable_powertools.rc != 0 | ||
when: (ansible_distribution == "CentOS") and (ansible_distribution_major_version == "8") | ||
|
||
- name: rhel 8 - ensure CRB repository is enabled | ||
rhsm_repository: | ||
name: "codeready-builder-for-rhel-8-x86_64-rpms" | ||
when: (ansible_distribution == "Red Hat Enterprise Linux") and (ansible_distribution_major_version == "8") | ||
|
||
- name: debian - ensure apt cache is up to date | ||
apt: | ||
update_cache: yes | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: create a folder for go | ||
file: | ||
path: "{{ golang_install_dir }}" | ||
recurse: yes | ||
|
||
- name: install golang explicitly | ||
include_role: | ||
name: gantsign.golang | ||
|
||
- name: install singularity | ||
include_role: | ||
name: abims_sbr.singularity |
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