-
Notifications
You must be signed in to change notification settings - Fork 65
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 #13 from hispanico/enable-http2-over-https
Enable http2 over https and switch to molecule role test
- Loading branch information
Showing
12 changed files
with
115 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 |
---|---|---|
@@ -1,46 +1,32 @@ | ||
--- | ||
os: linux | ||
language: python | ||
python: "2.7" | ||
|
||
sudo: required | ||
dist: xenial | ||
|
||
# Install ansible | ||
addons: | ||
apt: | ||
packages: | ||
- python-pip | ||
services: docker | ||
|
||
env: | ||
global: | ||
- ROLE_NAME: nginx-revproxy | ||
jobs: | ||
# - MOLECULE_DISTRO: centos7 | ||
- MOLECULE_DISTRO: ubuntu1604 | ||
- MOLECULE_DISTRO: ubuntu1804 | ||
- MOLECULE_DISTRO: debian9 | ||
- MOLECULE_DISTRO: debian10 | ||
|
||
install: | ||
# Install ansible | ||
- pip install ansible | ||
# Install test dependencies. | ||
- pip install molecule docker | ||
|
||
# Check ansible version | ||
- ansible --version | ||
|
||
# Create ansible.cfg with correct roles_path | ||
- printf '[defaults]\nroles_path=../' >ansible.cfg | ||
before_script: | ||
# Use actual Ansible Galaxy role name for the project directory. | ||
- cd ../ | ||
- mv ansible-$ROLE_NAME hispanico.$ROLE_NAME | ||
- cd hispanico.$ROLE_NAME | ||
|
||
script: | ||
# Basic role syntax check | ||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check | ||
|
||
# Run the role/playbook with ansible-playbook | ||
- ansible-playbook tests/test.yml -i tests/inventory --connection=local --become | ||
|
||
# Run the role/playbook again, checking to make sure it's idempotent | ||
- > | ||
ansible-playbook tests/test.yml -i tests/inventory --connection=local --become | ||
| grep -q 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
# Check for role is done | ||
- sudo service nginx status | ||
- sudo netstat -ntulp |grep nginx | ||
- sudo ls /etc/nginx/sites-enabled/ | ||
- for i in $(sudo ls /etc/nginx/sites-enabled/); do echo $i;echo "------------------------------"; sudo cat /etc/nginx/sites-enabled/$i; echo "------------------------------";echo ""; done | ||
|
||
# Run tests. | ||
- molecule test | ||
- pip install https://github.com/openwisp/openwisp-utils/tarball/master | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
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 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | ||
name: yamllint | ||
options: | ||
config-file: molecule/default/yaml-lint.yml | ||
enabled: true | ||
platforms: | ||
- name: "${ROLE_NAME}-${MOLECULE_DISTRO:-centos7}" | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- /var/lib/docker | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml} | ||
scenario: | ||
name: default | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
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 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
|
||
pre_tasks: | ||
- name: Install cron (RedHat). | ||
yum: | ||
name: cronie | ||
state: present | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Install cron (Debian). | ||
apt: | ||
name: cron | ||
state: present | ||
when: ansible_distribution == 'Debian' | ||
|
||
- name: Update apt cache. | ||
apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
when: ansible_distribution == 'Ubuntu' | ||
|
||
roles: | ||
- role: hispanico.nginx-revproxy |
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 @@ | ||
--- | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 150 | ||
level: warning |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.