Skip to content

Commit

Permalink
Merge pull request #12 from ansiblebit/2.24.x
Browse files Browse the repository at this point in the history
2.24.x
  • Loading branch information
steenzout authored Oct 10, 2018
2 parents a4ade23 + 22cdcc1 commit f0abf6c
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.retry
**/dependencies/*
**/roles/*

# Created by https://www.gitignore.io

Expand Down
33 changes: 27 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ sudo: yes

matrix:
include:
- python: 3.6
env: TOXENV=py36-ansible27
- python: 3.6
env: TOXENV=py36-ansible26
- python: 3.6
env: TOXENV=py36-ansible25
- python: 2.7
env: TOXENV=py27-ansible24
- python: 2.7
env: TOXENV=py27-ansible23
- python: 2.7
env: TOXENV=py27-ansible22
- python: 2.7
env: TOXENV=py27-ansible21
- python: 2.7
env: TOXENV=py27-ansible20
- python: 2.7
env: TOXENV=py27-ansible19

install:
- pip install tox
Expand All @@ -17,12 +27,23 @@ script:
- tox

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email: false
slack:
template:
- "%{repository_name}@%{branch} %{commit} : [%{build_number}] %{result} "
- "%{build_url}"
- "'%{commit_subject}' by %{author}"
- "%{elapsed_time} : %{duration}"
- "%{message}"
rooms:
secure:xxx
on_success: always
on_failure: always
webhooks: https://galaxy.ansible.com/api/v1/notifications/

before_cache:
- rm -f ${HOME}/.cache/pip/log/debug.log
- "find ${HOME}/.pip -name log -o -name __pycache__ -type d | xargs -I {} rm -rf {}"

cache:
directories:
- ${HOME}/.cache/pip

- "${HOME}/.cache/pip"
20 changes: 17 additions & 3 deletions tests/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require 'yaml'

PLAYBOOK = 'test.yml'
CONFIGURATION_FILE = 'boxes.yml'
ROLE_NAME = "#{File.expand_path("..").split("/")[-1]}"

Vagrant.configure('2') do |config|

Expand All @@ -24,15 +25,16 @@ Vagrant.configure('2') do |config|
config.vm.define box_name do |host|

host.vm.box = box_settings['box'] unless not box_settings.key? 'box'
host.vm.box_version = box_settings['box_version'] unless not box_settings.key? 'box_version'

host.vm.network box_settings['network']['name'], ip: box_settings['network']['ip'] unless box_settings.key? 'network'
host.vm.network :forwarded_port, guest: 3000, host: 3000
host.vm.synced_folder '.', '/vagrant', disabled: true

# puts "[DEBUG] applying virtualbox settings for #{box_name} box..."
customize_args = [ "modifyvm", :id ]
box_settings['provider']['virtualbox'].collect { |k, v| customize_args |= ["--#{k}", v.to_s] }
vagrant_environment['provider']['virtualbox'].collect { |k, v| customize_args |= ["--#{k}", v.to_s] }
host.vm.provider 'virtualbox' do |vb|
vb.name = "#{ROLE_NAME}_#{box_name}"
vb.customize customize_args
end

Expand All @@ -47,7 +49,19 @@ Vagrant.configure('2') do |config|
'yakkety64.vagrant.dev' => {
'ansible_python_interpreter' => '/usr/bin/python2.7',
'playbook_python2' => true
}
},
'artful64.vagrant.dev' => {
'ansible_python_interpreter' => '/usr/bin/python2.7',
'playbook_python2' => true
},
'bionic64.vagrant.dev' => {
'ansible_python_interpreter' => '/usr/bin/python2.7',
'playbook_python2' => true
},
'cosmic64.vagrant.dev' => {
'ansible_python_interpreter' => '/usr/bin/python2.7',
'playbook_python2' => true
},
}

ansible.playbook = PLAYBOOK
Expand Down
3 changes: 1 addition & 2 deletions tests/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ host_key_checking = False

private_key_file = ~/.vagrant.d/insecure_private_key

roles_path = ../../:../:dependencies

roles_path = ../../:../
96 changes: 67 additions & 29 deletions tests/boxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# file: influxdb/tests/boxes.yml
#

provider:
virtualbox:
memory: 1024
cpus: 1

vagrant:

# Debian
Expand All @@ -13,48 +18,70 @@ vagrant:
name: private_network
ip: 192.168.122.1

provider:
virtualbox:
memory: 1024
cpus: 1

wheezy64.vagrant.dev:
enabled: true
box: debian/wheezy64
network:
name: private_network
ip: 192.168.122.2

provider:
virtualbox:
memory: 1024
cpus: 1
stretch64.vagrant.dev:
enabled: false
box: debian/stretch64
network:
name: private_network
ip: 192.168.122.3

# Ubuntu

precise32.vagrant.dev:
enabled: false
box: ubuntu/precise32
network:
name: private_network
ip: 192.168.124.1

precise64.vagrant.dev:
enabled: true
enabled: false
box: ubuntu/precise64
network:
name: private_network
ip: 192.168.124.2

provider:
virtualbox:
memory: 1024
cpus: 1
trusty32.vagrant.dev:
enabled: false
box: ubuntu/trusty32
network:
name: private_network
ip: 192.168.124.3

trusty64.vagrant.dev:
enabled: true
enabled: false
box: ubuntu/trusty64
network:
name: private_network
ip: 192.168.124.4

provider:
virtualbox:
memory: 1024
cpus: 1
vivid32.vagrant.dev:
enabled: false
box: ubuntu/vivid32
network:
name: private_network
ip: 192.168.124.5

vivid64.vagrant.dev:
enabled: false
box: ubuntu/vivid64
network:
name: private_network
ip: 192.168.124.6

wily64.vagrant.dev:
enabled: true
box: ubuntu/wily64
network:
name: private_network
ip: 192.168.124.7

xenial64.vagrant.dev:
enabled: true
Expand All @@ -63,19 +90,30 @@ vagrant:
name: private_network
ip: 192.168.124.8

provider:
virtualbox:
memory: 1024
cpus: 1

yakkety64.vagrant.dev:
enabled: false
enabled: true
box: ubuntu/yakkety64
network:
name: private_network
ip: 192.168.124.9

provider:
virtualbox:
memory: 1024
cpus: 1
artful64.vagrant.dev:
enabled: true
box: ubuntu/artful64
network:
name: private_network
ip: 192.168.124.10

bionic64.vagrant.dev:
enabled: true
box: ubuntu/bionic64
network:
name: private_network
ip: 192.168.124.11

cosmic64.vagrant.dev:
enabled: true
box: ubuntu/cosmic64
network:
name: private_network
ip: 192.168.124.12
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ test -s ${DIR}/../requirements.yml \
&& ansible-galaxy install \
--force \
-r ${DIR}/../requirements.yml \
--roles-path=${DIR}/dependencies \
--roles-path=${DIR}/roles \
|| true
1 change: 1 addition & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

tasks:
- raw: sudo apt-get update -qq && sudo apt-get install -qq python2.7
changed_when: no
when: playbook_python2 is defined and
playbook_python2

Expand Down
8 changes: 5 additions & 3 deletions tests/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Bash script to run the test suite against the Vagrant environment.
#
# version: 1.2
# version: 1.8
#
# usage:
#
Expand All @@ -16,6 +16,9 @@
#
# changelog:
#
# v1.8 : 10 August 2016
# - force provisioning
#
# v1.6 : 10 Jun 2016
# - exit if USER environment variable is travis
#
Expand Down Expand Up @@ -61,7 +64,7 @@ do
if [ ! -n "${BOX+1}" ] || [ "${BOX}" = "${VAGRANT_BOX}" ]; then

echo "[INFO] preparing ${VAGRANT_BOX}..."
vagrant up ${VAGRANT_BOX} 2> /dev/null
vagrant up --provision ${VAGRANT_BOX} 2> /dev/null
if [ $? -ne 0 ]; then
# box not enabled
continue
Expand All @@ -74,4 +77,3 @@ do
vagrant destroy -f ${VAGRANT_BOX}
fi
done

15 changes: 11 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
{py27}-{ansible21,ansible20,ansible19}
py{36,27}-ansible{27,26,25,24,23,22,21,20,19}

skipsdist = True

Expand All @@ -9,9 +9,16 @@ skipsdist = True
changedir = tests

deps =
ansible21: ansible==2.1.*
ansible20: ansible==2.0.*
ansible19: ansible==1.9.*
ansible27: ansible>=2.7,<2.8
ansible26: ansible>=2.6,<2.7
ansible25: ansible>=2.5,<2.6
ansible24: ansible>=2.4,<2.5
ansible23: ansible>=2.3,<2.4
ansible22: ansible>=2.2,<2.3
ansible21: ansible>=2.1,<2.2
ansible20: ansible>=2.0.0,<2.1
ansible19: ansible>=1.9,<2.0.0


passenv = ANSIBLE_ASK_SUDO_PASS HOME LANG LC_ALL TRAVIS USER

Expand Down

0 comments on commit f0abf6c

Please sign in to comment.