-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automated tests #4
base: master
Are you sure you want to change the base?
Changes from 8 commits
ad825ca
fc23172
519d2f8
61a493b
1d1c05e
911b60f
feb0784
b2b10ce
a29ea94
c192d64
a08b573
4c884e0
5438014
a3906cc
f53097e
84fcbd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "${{ github.repository }}" | ||
- name: molecule | ||
uses: robertdebock/[email protected] | ||
with: | ||
command: lint | ||
test: | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- geerlingguy/docker-ubuntu2004-ansible:latest | ||
- geerlingguy/docker-ubuntu1804-ansible:latest | ||
- geerlingguy/docker-ubuntu1604-ansible:latest | ||
- geerlingguy/docker-centos8-ansible:latest | ||
- geerlingguy/docker-centos7-ansible:latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "${{ github.repository }}" | ||
- name: molecule | ||
uses: robertdebock/[email protected] | ||
with: | ||
image: "${{ matrix.image }}" | ||
options: parallel | ||
env: | ||
MOLECULE_DOCKER_IMAGE: "${{ matrix.image }}" |
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]' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
|
||
vars: | ||
- default_mail_recipient: [email protected] | ||
|
||
roles: | ||
- role: ansible-role-letsencrypt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: instance | ||
image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu1804-ansible:latest'} | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-converge.yml} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- name: Install nginx | ||
hosts: all | ||
# connection: local | ||
become: no | ||
gather_facts: yes | ||
tasks: | ||
|
||
- name: Update yum | ||
yum: | ||
update_cache: yes | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Ensure nginx is installed | ||
package: | ||
name: | ||
- nginx | ||
state: present | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Ensure python is installed | ||
package: | ||
name: | ||
- python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Chithrak07 You might need python3 here? Python2 is Dead/EOL. This is just a guess. You'll need to find out for sure what the package name is for RH/CentOS. |
||
state: present | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Ensure nginx is installed for Debian | ||
apt: pkg=nginx state=present update_cache=true | ||
when: ansible_os_family == 'Debian' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this task happens to fail, just update apt's cache first by itself before trying to install anything. |
||
|
||
- name: Ensure python is installed for Debian | ||
apt: pkg=python state=present update_cache=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue here - Python without a version is generally python2 ... we want python3. |
||
when: ansible_os_family == 'Debian' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use fictional values instead.