This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1177: Add DotDeb repo for later PHP version support.
- Loading branch information
1 parent
47710cf
commit d4d2f0c
Showing
8 changed files
with
125 additions
and
0 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
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,44 @@ | ||
--- | ||
sudo: required | ||
|
||
env: | ||
- distro: debian8 | ||
init: /lib/systemd/systemd | ||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
# Pull container. | ||
- 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest' | ||
|
||
script: | ||
- container_id=$(mktemp) | ||
# Run container in detached state. | ||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' | ||
|
||
# Install dependencies. | ||
- 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' | ||
|
||
# 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. | ||
- idempotence=$(mktemp) | ||
- sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} | ||
- > | ||
tail ${idempotence} | ||
| grep -q 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
after_success: | ||
# Clean up. | ||
- 'sudo docker stop "$(cat ${container_id})"' | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Ansible Role: DotDeb Repository | ||
|
||
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-repo-dotdeb.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-repo-dotdeb) | ||
|
||
Installs the [DotDeb repository](https://www.dotdeb.org/) for Debian. | ||
|
||
## Requirements | ||
|
||
This role only is needed/runs on Debian and its derivatives. | ||
|
||
## Role Variables | ||
|
||
Available variables are listed below, along with default values (see `defaults/main.yml`): | ||
|
||
dotdeb_sources: | ||
- "deb http://packages.dotdeb.org {{ ansible_distribution_release }} all" | ||
- "deb-src http://packages.dotdeb.org {{ ansible_distribution_release }} all" | ||
dotdeb_repo_gpg_key_url: https://www.dotdeb.org/dotdeb.gpg | ||
|
||
The DotDeb repos and GPG key URL. Generally, these should not be changed, but if this role is out of date, or if you need a very specific version, these can both be overridden. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
## Example Playbook | ||
|
||
- hosts: servers | ||
roles: | ||
- geerlingguy.repo-dotdeb | ||
|
||
## License | ||
|
||
MIT / BSD | ||
|
||
## Author Information | ||
|
||
This role was created in 2016 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). |
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,5 @@ | ||
--- | ||
dotdeb_sources: | ||
- "deb http://packages.dotdeb.org {{ ansible_distribution_release }} all" | ||
- "deb-src http://packages.dotdeb.org {{ ansible_distribution_release }} all" | ||
dotdeb_repo_gpg_key_url: https://www.dotdeb.org/dotdeb.gpg |
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,15 @@ | ||
--- | ||
dependencies: [] | ||
|
||
galaxy_info: | ||
author: geerlingguy | ||
description: DotDeb repository for Debian. | ||
company: "Midwestern Mac, LLC" | ||
license: "license (BSD, MIT)" | ||
min_ansible_version: 2.0 | ||
platforms: | ||
- name: Debian | ||
versions: | ||
- all | ||
galaxy_tags: | ||
- packaging |
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,15 @@ | ||
--- | ||
- name: Install DotDeb repo. | ||
apt_repository: | ||
repo: "{{ item }}" | ||
with_items: "{{ dotdeb_sources }}" | ||
register: dotdeb_apt_repo_result | ||
|
||
- name: Import DotDeb GPG key. | ||
apt_key: | ||
url: "{{ dotdeb_repo_gpg_key_url }}" | ||
register: dotdeb_apt_key_result | ||
|
||
- name: Update apt cache if repo or key added. | ||
apt: update_cache=yes | ||
when: dotdeb_apt_repo_result.changed or dotdeb_apt_key_result.changed |
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,5 @@ | ||
--- | ||
- hosts: all | ||
|
||
roles: | ||
- role_under_test |