commit
8b6c745801
@ -0,0 +1,53 @@ |
|||||||
|
--- |
||||||
|
sudo: required |
||||||
|
|
||||||
|
env: |
||||||
|
- distribution: centos |
||||||
|
version: 6 |
||||||
|
init: /sbin/init |
||||||
|
run_opts: "" |
||||||
|
- distribution: centos |
||||||
|
version: 7 |
||||||
|
init: /usr/lib/systemd/systemd |
||||||
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" |
||||||
|
- distribution: ubuntu |
||||||
|
version: 14.04 |
||||||
|
init: /sbin/init |
||||||
|
run_opts: "" |
||||||
|
- distribution: ubuntu |
||||||
|
version: 12.04 |
||||||
|
init: /sbin/init |
||||||
|
run_opts: "" |
||||||
|
|
||||||
|
services: |
||||||
|
- docker |
||||||
|
|
||||||
|
before_install: |
||||||
|
# Pull container |
||||||
|
- 'sudo docker pull ${distribution}:${version}' |
||||||
|
# Customize container |
||||||
|
- 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' |
||||||
|
|
||||||
|
script: |
||||||
|
- container_id=$(mktemp) |
||||||
|
# Run container in detached state |
||||||
|
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' |
||||||
|
|
||||||
|
# Ansible syntax check. |
||||||
|
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' |
||||||
|
|
||||||
|
# Test role. |
||||||
|
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' |
||||||
|
|
||||||
|
# Test role idempotence. |
||||||
|
- > |
||||||
|
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml |
||||||
|
| grep -q 'changed=0.*failed=0' |
||||||
|
&& (echo 'Idempotence test: pass' && exit 0) |
||||||
|
|| (echo 'Idempotence test: fail' && exit 1) |
||||||
|
|
||||||
|
# Clean up |
||||||
|
- 'sudo docker stop "$(cat ${container_id})"' |
||||||
|
|
||||||
|
notifications: |
||||||
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
@ -0,0 +1,31 @@ |
|||||||
|
# Ansible Role: Let's Encrypt |
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-letsencrypt.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-letsencrypt) |
||||||
|
|
||||||
|
Installs Let's Encrypt for RHEL/CentOS or Debian/Ubuntu. |
||||||
|
|
||||||
|
## Requirements |
||||||
|
|
||||||
|
Let's Encrypt requires `git` to be installed. You can install using the `geerlingguy.git` role. |
||||||
|
|
||||||
|
## Role Variables |
||||||
|
|
||||||
|
None. |
||||||
|
|
||||||
|
## Dependencies |
||||||
|
|
||||||
|
None. |
||||||
|
|
||||||
|
## Example Playbook |
||||||
|
|
||||||
|
- hosts: servers |
||||||
|
roles: |
||||||
|
- geerlingguy.letsencrypt |
||||||
|
|
||||||
|
## License |
||||||
|
|
||||||
|
MIT / BSD |
||||||
|
|
||||||
|
## Author Information |
||||||
|
|
||||||
|
This role was created in 2016 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). |
@ -0,0 +1,6 @@ |
|||||||
|
--- |
||||||
|
letsencrypt_repo: https://github.com/letsencrypt/letsencrypt |
||||||
|
letsencrypt_version: master |
||||||
|
letsencrypt_keep_updated: yes |
||||||
|
|
||||||
|
letsencrypt_dir: /opt/letsencrypt |
@ -0,0 +1,2 @@ |
|||||||
|
--- |
||||||
|
# TODO |
@ -0,0 +1,24 @@ |
|||||||
|
--- |
||||||
|
dependencies: [] |
||||||
|
|
||||||
|
galaxy_info: |
||||||
|
author: geerlingguy |
||||||
|
description: "Let's Encrypt for RHEL/CentOS and Debian/Ubuntu." |
||||||
|
company: "Midwestern Mac, LLC" |
||||||
|
license: "license (BSD, MIT)" |
||||||
|
min_ansible_version: 1.8 |
||||||
|
platforms: |
||||||
|
- name: EL |
||||||
|
versions: |
||||||
|
- 6 |
||||||
|
- 7 |
||||||
|
- name: Ubuntu |
||||||
|
versions: |
||||||
|
- all |
||||||
|
- name: Debian |
||||||
|
versions: |
||||||
|
- all |
||||||
|
galaxy_tags: |
||||||
|
- networking |
||||||
|
- system |
||||||
|
- web |
@ -0,0 +1,7 @@ |
|||||||
|
--- |
||||||
|
- name: Clone Let's Encrypt into configured directory. |
||||||
|
git: |
||||||
|
repo: "{{ letsencrypt_repo }}" |
||||||
|
dest: "{{ letsencrypt_dir }}" |
||||||
|
version: "{{ letsencrypt_version }}" |
||||||
|
update: "{{ letsencrypt_keep_updated }}" |
@ -0,0 +1,19 @@ |
|||||||
|
FROM centos:6 |
||||||
|
|
||||||
|
# Install Ansible |
||||||
|
RUN yum -y update; yum clean all; |
||||||
|
RUN yum -y install epel-release |
||||||
|
RUN yum -y install git python-setuptools gcc sudo libffi-devel python-devel openssl-devel |
||||||
|
RUN yum clean all |
||||||
|
RUN easy_install pip |
||||||
|
RUN pip install ansible |
||||||
|
|
||||||
|
|
||||||
|
# Disable requiretty |
||||||
|
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers |
||||||
|
|
||||||
|
# Install Ansible inventory file |
||||||
|
RUN mkdir - p /etc/ansible |
||||||
|
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts |
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"] |
@ -0,0 +1,29 @@ |
|||||||
|
FROM centos:7 |
||||||
|
|
||||||
|
# Install systemd -- See https://hub.docker.com/_/centos/ |
||||||
|
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs |
||||||
|
RUN yum -y update; yum clean all; \ |
||||||
|
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ |
||||||
|
rm -f /lib/systemd/system/multi-user.target.wants/*; \ |
||||||
|
rm -f /etc/systemd/system/*.wants/*; \ |
||||||
|
rm -f /lib/systemd/system/local-fs.target.wants/*; \ |
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ |
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ |
||||||
|
rm -f /lib/systemd/system/basic.target.wants/*; \ |
||||||
|
rm -f /lib/systemd/system/anaconda.target.wants/*; |
||||||
|
|
||||||
|
# Install Ansible |
||||||
|
RUN yum -y install git python-setuptools gcc sudo libffi-devel python-devel openssl-devel |
||||||
|
RUN yum clean all |
||||||
|
RUN easy_install pip |
||||||
|
RUN pip install ansible |
||||||
|
|
||||||
|
# Disable requiretty |
||||||
|
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers |
||||||
|
|
||||||
|
# Install Ansible inventory file |
||||||
|
RUN mkdir - p /etc/ansible |
||||||
|
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts |
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"] |
||||||
|
CMD ["/usr/sbin/init"] |
@ -0,0 +1,11 @@ |
|||||||
|
FROM ubuntu:12.04 |
||||||
|
RUN apt-get update |
||||||
|
|
||||||
|
# Install Ansible |
||||||
|
RUN apt-get install -y software-properties-common python-software-properties git |
||||||
|
RUN apt-add-repository -y ppa:ansible/ansible |
||||||
|
RUN apt-get update |
||||||
|
RUN apt-get install -y ansible |
||||||
|
|
||||||
|
# Install Ansible inventory file |
||||||
|
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts |
@ -0,0 +1,11 @@ |
|||||||
|
FROM ubuntu:14.04 |
||||||
|
RUN apt-get update |
||||||
|
|
||||||
|
# Install Ansible |
||||||
|
RUN apt-get install -y software-properties-common git |
||||||
|
RUN apt-add-repository -y ppa:ansible/ansible |
||||||
|
RUN apt-get update |
||||||
|
RUN apt-get install -y ansible |
||||||
|
|
||||||
|
# Install Ansible inventory file |
||||||
|
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts |
@ -0,0 +1,5 @@ |
|||||||
|
--- |
||||||
|
- hosts: all |
||||||
|
|
||||||
|
roles: |
||||||
|
- role_under_test |
@ -0,0 +1,2 @@ |
|||||||
|
--- |
||||||
|
samba_daemon: smbd |
@ -0,0 +1,2 @@ |
|||||||
|
--- |
||||||
|
samba_daemon: smb |
Loading…
Reference in new issue