Skip to content
Snippets Groups Projects
Commit 8490c814 authored by nimrod's avatar nimrod
Browse files

Merge branch 'master' of /home/nimrod/Documents/Shore/Ansible/example

# Conflicts:
#	meta/main.yml
#	tasks/main.yml
#	tests/playbook.yml
parents 4a5e2796 bd2a87de
No related branches found
No related tags found
No related merge requests found
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
sha: v0.7.1 sha: v0.9.3
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-json - id: check-json
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
- id: flake8 - id: flake8
- id: check-symlinks - id: check-symlinks
- repo: https://github.com/adarnimrod/ansible-pre-commit.git - repo: https://github.com/adarnimrod/ansible-pre-commit.git
sha: v0.6.0 sha: v0.7.0
hooks: hooks:
- id: ansible-syntax-check - id: ansible-syntax-check
- repo: https://github.com/willthames/ansible-lint - repo: https://github.com/willthames/ansible-lint
sha: v3.4.13 sha: v3.4.15
hooks: hooks:
- id: ansible-lint - id: ansible-lint
files: tests/playbook.yml files: tests/playbook.yml
......
...@@ -22,6 +22,7 @@ cache: ...@@ -22,6 +22,7 @@ cache:
- pip - pip
- directories: - directories:
- $HOME/.pre-commit - $HOME/.pre-commit
- $HOME/.vagrant.d/boxes
install: install:
- sudo apt-get update - sudo apt-get update
......
FROM ubuntu:trusty
RUN apt-get update; apt-get install -y python-pip python-dev libssl-dev libffi-dev build-essential
RUN pip install --upgrade pip urllib3[secure] ndg-httpsclient pyasn1 pyopenssl
#!/usr/bin/env bats
setup () {
docker build -t python27_tls_test ./
}
@test 'test sni' {
run docker run --entrypoint /bin/sh python27_tls_test -c "pip install nonexistant-package"
! ( echo "$output" | grep -qi warning )
}
#@test 'test tls 1.2' {
# run docker run --entrypoint /usr/bin/python2 python27_tls_test -c "import urllib2, json; print(json.loads(urllib2.urlopen(urllib2.Request('https://www.howsmyssl.com/a/check')).read())['tls_version'])"
# echo "$output" | grep -qi 'TLS 1\.2'
#}
...@@ -7,11 +7,11 @@ galaxy_info: ...@@ -7,11 +7,11 @@ galaxy_info:
platforms: platforms:
- name: OpenBSD - name: OpenBSD
versions: versions:
- 5.6 - '5.6'
- 5.7 - '5.7'
- 5.8 - '5.8'
- 5.9 - '5.9'
- 6.0 - '6.0'
- name: Ubuntu - name: Ubuntu
versions: versions:
- xenial - xenial
......
--- ---
# tasks file for python27 # tasks file for python27
- name: Load meta vars
include_vars:
file: meta/main.yml
name: meta
- name: Assertions - name: Assertions
assert: assert:
that: that:
- ansible_os_family in ['OpenBSD', 'Debian'] - ansible_distribution in meta.galaxy_info.platforms|map(attribute='name')
- ansible_distribution_release in ['xenial', 'trusty', 'precise', 'stretch', 'jessie', 'wheezy'] or ansible_distribution_version in ['6.0'] - |
(meta.galaxy_info.platforms|selectattr('name', 'equalto', ansible_distribution)|first).versions|intersect([ansible_distribution_release, ansible_distribution_version])|length > 0
- python27_packages is iterable - python27_packages is iterable
- name: APT install - name: APT install
......
ansible==2.3.1.0 ansible==2.3.2.0
testinfra==1.6.3 testinfra==1.7.0
molecule==1.25.0 molecule<2
ansible-lint==3.4.13 ansible-lint==3.4.15
python-vagrant==0.5.15 python-vagrant==0.5.15
netaddr==0.7.19 netaddr==0.7.19
passlib==1.7.1 passlib==1.7.1
......
...@@ -5,3 +5,5 @@ ...@@ -5,3 +5,5 @@
name: debian-bootstrap name: debian-bootstrap
- src: adarnimrod.users - src: adarnimrod.users
name: users name: users
- src: adarnimrod.python27
name: python27
...@@ -15,17 +15,17 @@ commands = ...@@ -15,17 +15,17 @@ commands =
[testenv:pre-commit] [testenv:pre-commit]
deps = deps =
-rtests/requirements.txt {[testenv]deps}
pre-commit pre-commit
passenv = HOME VBOX* ANSIBLE_* passenv = {[testenv]passenv}
whitelist_externals = whitelist_externals = {[testenv]whitelist_externals}
sh
commands = commands =
sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles" sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles"
molecule dependency molecule dependency
pre-commit run --all-files pre-commit run --all-files
[testenv:import] [testenv:import]
envdir = {toxinidir}/.tox/molecule envdir = {[testenv]envdir}
deps = -rtests/requirements.txt deps = {[testenv]deps}
passenv = {[testenv]passenv}
commands = ansible-galaxy import -v commands = ansible-galaxy import -v
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment