Skip to content

Commit

Permalink
Merge pull request #41 from johanmeiring/remove-older-os-support
Browse files Browse the repository at this point in the history
Remove older OS support
  • Loading branch information
johanmeiring authored Jan 19, 2020
2 parents f8da71c + 48b497c commit 13926b1
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 106 deletions.
42 changes: 18 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,44 @@
sudo: required

env:
- ansible: 2.0.2.0
- ansible: 2.5
distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
- ansible: 2.2.2.0
distribution: ubuntu
version: 14.04
version: 16.04
init: /sbin/init
run_opts: ""
- ansible: 2.2.2.0
- ansible: 2.9
distribution: ubuntu
version: 16.04
init: /sbin/init
run_opts: ""
- ansible: 2.3.0.0
- ansible: 2.5
distribution: ubuntu
version: 14.04
version: 18.04
init: /sbin/init
run_opts: ""
- ansible: 2.3.0.0
- ansible: 2.9
distribution: ubuntu
version: 16.04
version: 18.04
init: /sbin/init
run_opts: ""
- ansible: 2.2.2.0
- ansible: 2.5
distribution: centos
version: 6
version: 7
init: /sbin/init
run_opts: ""
- ansible: 2.3.0.0
- ansible: 2.9
distribution: centos
version: 6
version: 7
init: /sbin/init
run_opts: ""
- ansible: 2.2.2.0
- ansible: 2.5
distribution: centos
version: 7
version: 8
init: /sbin/init
run_opts: ""
- ansible: 2.3.0.0
- ansible: 2.9
distribution: centos
version: 7
version: 8
init: /sbin/init
run_opts: ""

Expand All @@ -53,9 +48,9 @@ services:

before_install:
# Pull container
- 'sudo docker pull ${distribution}:${version}'
- "sudo docker pull ${distribution}:${version}"
# Customize container
- 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version}.ansible-${ansible} --tag=${distribution}-${version}:ansible-${ansible} tests'
- "sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version}.ansible-${ansible} --tag=${distribution}-${version}:ansible-${ansible} tests"

script:
- container_id=$(mktemp)
Expand Down Expand Up @@ -106,6 +101,5 @@ script:
|| (echo 'Idempotence test: fail' && exit 1)
# Clean up
- 'sudo docker stop "$(cat ${container_id})"'

# notifications:
# webhooks: https://galaxy.ansible.com/api/v1/notifications/
# webhooks: https://galaxy.ansible.com/api/v1/notifications/
21 changes: 17 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@ galaxy_info:
author: Johan Meiring
description: "Setup chrooted SFTP service on top of OpenSSH"
license: MIT
min_ansible_version: 2.0
min_ansible_version: 2.5

platforms:
- name: Ubuntu
versions:
- all
- name: Ubuntu
versions:
- xenial
- yakkety
- zesty
- artful
- bionic
- cosmic
- disco
- eoan
- name: EL
versions:
- 7
- 8

galaxy_tags:
- networking
- system
- sftp
- ssh

dependencies: []
19 changes: 9 additions & 10 deletions run-local-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ run_test() {
docker build --rm=true --file=tests/Dockerfile.$1-$2.ansible-$3 --tag=$1-$2:ansible-$3 tests
container_id=$(mktemp)
docker run --rm=true --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro $1-$2:ansible-$3 /sbin/init > "${container_id}"
docker exec --tty "$(cat ${container_id})" env TERM=xterm python --version
docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check
docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml
docker exec --tty "$(cat ${container_id})" env TERM=xterm grep "user1" /etc/shadow && (echo 'User created' && exit 0) || (echo 'User not created' && exit 1)
Expand All @@ -20,16 +21,14 @@ run_test() {
docker stop "$(cat ${container_id})"
}

run_test ubuntu 14.04 2.2.2.0
run_test ubuntu 14.04 2.3.0.0
run_test ubuntu 16.04 2.5
run_test ubuntu 16.04 2.9

run_test ubuntu 16.04 2.2.2.0
run_test ubuntu 16.04 2.3.0.0
run_test ubuntu 18.04 2.5
run_test ubuntu 18.04 2.9

run_test ubuntu 18.04 2.5.0.0
run_test centos 7 2.5
run_test centos 7 2.9

run_test centos 6 2.2.2.0
run_test centos 6 2.3.0.0

run_test centos 7 2.2.2.0
run_test centos 7 2.3.0.0
run_test centos 8 2.5
run_test centos 8 2.9
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM centos:7
#RUN yum update
RUN yum -y update

# Install OpenSSH server
RUN yum install -y openssh-server epel-release libffi-devel gcc

# Install Ansible
RUN yum install -y python-pip python-devel openssl-devel
RUN yum install -y python3-pip python3-devel openssl-devel
#software-properties-common git python-dev libffi-dev libssl-dev
RUN pip install -U setuptools
RUN pip install 'ansible==2.2.2.0'
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.5.0'
RUN alternatives --install /usr/bin/python python /usr/bin/python3 60

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "localhost ansible_connection=local" > /etc/ansible/hosts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM centos:7
#RUN yum update
RUN yum -y update

# Install OpenSSH server
RUN yum install -y openssh-server epel-release libffi-devel gcc

# Install Ansible
RUN yum install -y python-pip python-devel openssl-devel
RUN yum install -y python3-pip python3-devel openssl-devel
#software-properties-common git python-dev libffi-dev libssl-dev
RUN pip install -U setuptools
RUN pip install 'ansible==2.3.0.0'
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.9.0'
RUN alternatives --install /usr/bin/python python /usr/bin/python3 60

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "localhost ansible_connection=local" > /etc/ansible/hosts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM centos:6
#RUN yum update
FROM centos:8
RUN yum -y update

# Install OpenSSH server
RUN yum install -y openssh-server epel-release libffi-devel gcc

# Install Ansible
RUN yum install -y python-pip python-devel openssl-devel
RUN yum install -y python3-pip python3-devel openssl-devel
#software-properties-common git python-dev libffi-dev libssl-dev
RUN pip install --upgrade pip
RUN pip install -U setuptools
RUN pip install 'ansible==2.2.2.0'
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.5.0'
RUN alternatives --set python /usr/bin/python3

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "localhost ansible_connection=local" > /etc/ansible/hosts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM centos:6
#RUN yum update
FROM centos:8
RUN yum -y update

# Install OpenSSH server
RUN yum install -y openssh-server epel-release libffi-devel gcc

# Install Ansible
RUN yum install -y python-pip python-devel openssl-devel
RUN yum install -y python3-pip python3-devel openssl-devel
#software-properties-common git python-dev libffi-dev libssl-dev
RUN pip install --upgrade pip
RUN pip install -U setuptools
RUN pip install 'ansible==2.3.0.0'
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.9.0'
RUN alternatives --set python /usr/bin/python3

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "localhost ansible_connection=local" > /etc/ansible/hosts
13 changes: 0 additions & 13 deletions tests/Dockerfile.ubuntu-14.04.ansible-2.0.2.0

This file was deleted.

13 changes: 0 additions & 13 deletions tests/Dockerfile.ubuntu-14.04.ansible-2.2.2.0

This file was deleted.

13 changes: 0 additions & 13 deletions tests/Dockerfile.ubuntu-14.04.ansible-2.3.0.0

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ RUN apt-get update
RUN apt-get install -y openssh-server

# Install Ansible
RUN apt-get install -y software-properties-common git python-pip python-dev libffi-dev libssl-dev
RUN pip install -U setuptools
RUN pip install 'ansible==2.3.0.0'
RUN apt-get install -y software-properties-common git python3-pip python3-dev libffi-dev libssl-dev
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.5.0'
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ RUN apt-get update
RUN apt-get install -y openssh-server

# Install Ansible
RUN apt-get install -y software-properties-common git python-pip python-dev libffi-dev libssl-dev
RUN pip install -U setuptools
RUN pip install 'ansible==2.2.2.0'
RUN apt-get install -y software-properties-common git python3-pip python3-dev libffi-dev libssl-dev
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.9.0'
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ RUN apt-get update
RUN apt-get install -y openssh-server

# Install Ansible
RUN apt-get install -y software-properties-common git python-pip python-dev libffi-dev libssl-dev
RUN pip install -U setuptools
RUN pip install 'ansible==2.5.0.0'
RUN apt-get install -y software-properties-common git python3-pip python3-dev libffi-dev libssl-dev
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.5.0'
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
14 changes: 14 additions & 0 deletions tests/Dockerfile.ubuntu-18.04.ansible-2.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:18.04
RUN apt-get update

# Install OpenSSH server
RUN apt-get install -y openssh-server

# Install Ansible
RUN apt-get install -y software-properties-common git python3-pip python3-dev libffi-dev libssl-dev
RUN pip3 install -U setuptools
RUN pip3 install 'ansible~=2.9.0'
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

# Install Ansible inventory file
RUN mkdir /etc/ansible/ && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts

0 comments on commit 13926b1

Please sign in to comment.