forked from actions/runner
-
Notifications
You must be signed in to change notification settings - Fork 0
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 actions#2 from MonolithProjects/develop
First fully working release Former-commit-id: 2ab4e62b307dc7800bdb7501fba2731d96a325ad
- Loading branch information
Showing
17 changed files
with
398 additions
and
68 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,36 @@ | ||
name: molecule test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
schedule: | ||
- cron: '0 6 * * 0' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: molecule | ||
uses: robertdebock/[email protected] | ||
with: | ||
entrypoint: /usr/local/bin/molecule | ||
args: lint | ||
test: | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "${{ github.repository }}" | ||
- name: molecule | ||
uses: robertdebock/[email protected] | ||
env: | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |
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 @@ | ||
molecule/default | ||
actions-runner-linux-* |
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
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,31 @@ | ||
# Molecule managed | ||
|
||
{% if item.registry is defined %} | ||
FROM {{ item.registry.url }}/{{ item.image }} | ||
{% else %} | ||
FROM {{ item.image }} | ||
{% endif %} | ||
|
||
{% if item.env is defined %} | ||
{% for var, value in item.env.items() %} | ||
{% if value %} | ||
ENV {{ var }} {{ value }} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ | ||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ | ||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ | ||
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ | ||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ | ||
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi | ||
|
||
ENV ANSIBLE_USER=ansible SUDO_GROUP=wheel DEPLOY_GROUP=deployer | ||
RUN set -xe \ | ||
&& groupadd -r ${ANSIBLE_USER} \ | ||
&& groupadd -r ${DEPLOY_GROUP} \ | ||
&& useradd -m -g ${ANSIBLE_USER} ${ANSIBLE_USER} \ | ||
&& usermod -aG ${SUDO_GROUP} ${ANSIBLE_USER} \ | ||
&& usermod -aG ${DEPLOY_GROUP} ${ANSIBLE_USER} \ | ||
&& sed -i "/^%${SUDO_GROUP}/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers |
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,22 @@ | ||
******* | ||
Docker driver installation guide | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Docker Engine | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
$ pip install 'molecule[docker]' |
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 @@ | ||
505e69bab8d510528aa662ef554436d57c936f38 |
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: Converge | ||
user: ansible | ||
hosts: all | ||
become: yes | ||
vars: | ||
- runner_user: ansible | ||
- github_repo: ansible-github_actions_runner-testrepo | ||
- github_account: monolithprojects | ||
roles: | ||
- role: ansible-github_actions_runner | ||
|
||
- name: Uninstall | ||
user: ansible | ||
hosts: all | ||
become: yes | ||
tags: | ||
- uninstall | ||
vars: | ||
- runner_user: ansible | ||
- github_repo: ansible-github_actions_runner-testrepo | ||
- github_account: monolithprojects | ||
roles: | ||
- role: ansible-github_actions_runner |
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,75 @@ | ||
--- | ||
driver: | ||
name: docker | ||
lint: | | ||
yamllint . | ||
platforms: | ||
- name: CentOS7 | ||
image: monolithprojects/systemd-centos7:latest | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: no | ||
pre_build_image: yes | ||
- name: CentOS8 | ||
image: monolithprojects/systemd-centos8:latest | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: no | ||
pre_build_image: yes | ||
# - name: Ubuntu16 | ||
# image: monolithprojects/systemd-ubuntu16:latest | ||
# command: /sbin/init | ||
# tmpfs: | ||
# - /run | ||
# - /tmp | ||
# volumes: | ||
# - /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
# privileged: no | ||
# pre_build_image: yes | ||
# - name: Ubuntu18 | ||
# image: monolithprojects/systemd-ubuntu18:latest | ||
# command: /sbin/init | ||
# tmpfs: | ||
# - /run | ||
# - /tmp | ||
# volumes: | ||
# - /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
# privileged: no | ||
# pre_build_image: yes | ||
provisioner: | ||
name: ansible | ||
log: false | ||
# env: | ||
# PERSONAL_ACCESS_TOKEN: $PERSONAL_ACCESS_TOKEN | ||
inventory: | ||
host_vars: | ||
CentOS8: | ||
ansible_python_interpreter: /usr/bin/python3 | ||
verifier: | ||
name: ansible | ||
dependency: | ||
name: galaxy | ||
options: | ||
ignore-certs: True | ||
ignore-errors: True | ||
scenario: | ||
name: default | ||
test_sequence: | ||
- dependency | ||
- lint | ||
- cleanup | ||
- destroy | ||
- syntax | ||
- create | ||
- prepare | ||
- converge | ||
- cleanup | ||
- destroy |
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,3 @@ | ||
--- | ||
- role: robertdebock.epel | ||
version: master |
Binary file not shown.
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,15 @@ | ||
import os | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE'] | ||
).get_hosts('all') | ||
|
||
|
||
def test_hosts_file(host): | ||
f = host.file('/etc/hosts') | ||
|
||
assert f.exists | ||
assert f.user == 'root' | ||
assert f.group == 'root' |
Oops, something went wrong.