Skip to content

Commit df341ba

Browse files
committed
add redirectionio.apache_module ansible role
0 parents  commit df341ba

File tree

7 files changed

+145
-0
lines changed

7 files changed

+145
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vagrant
2+
*.retry

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 redirection.io
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Ansible redirectionio-apache_module role
2+
3+
This role installs the [redirection.io](https://redirection.io/) Apache2 module. It supports Debian and RHEL-based Linux distributions.
4+
5+
Once installed, the [redirection.io](https://redirection.io/) Apache2 module might be used in Apache Virtualhosts, as
6+
described [in the related documentation](https://redirection.io/documentation/developer-documentation/apache-module#configuration).
7+
8+
## Installation
9+
10+
Simply run the following command:
11+
12+
```
13+
ansible-galaxy install redirectionio.apache_module
14+
```
15+
16+
## Role variables
17+
18+
This role does not provide variables.
19+
20+
## Example playbook
21+
22+
```yml
23+
- hosts: webservers
24+
roles:
25+
- { role: redirectionio.apache_module, become: true }
26+
```
27+
28+
## Dependencies
29+
30+
This role has no dependency.
31+
32+
## License
33+
34+
This role is available under the terms of the MIT License.

meta/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
galaxy_info:
3+
role_name: 'apache_module'
4+
author: 'redirection.io'
5+
description: Install libapache2-mod-redirectionio
6+
license: MIT
7+
min_ansible_version: 1.6
8+
platforms:
9+
- name: Ubuntu
10+
versions:
11+
- xenial
12+
- artful
13+
- bionic
14+
- cuttlefish
15+
- name: Debian
16+
versions:
17+
- stretch
18+
- buster
19+
- name: EL
20+
versions:
21+
- 7
22+
- 6
23+
galaxy_tags:
24+
- monitoring
25+
dependencies: []

tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
- import_tasks: pkg-debian.yml
4+
when: ansible_os_family == "Debian"
5+
6+
- import_tasks: pkg-redhat.yml
7+
when: ansible_os_family == "RedHat"

tasks/pkg-debian.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
3+
- name: Install the apt-transport-https
4+
apt:
5+
name: apt-transport-https
6+
state: present
7+
8+
- name: import redirection.io apt key
9+
apt_key:
10+
keyserver: pgp.mit.edu
11+
id: 24765BBD8E16EB44
12+
state: present
13+
14+
- name: Install redirection.io repository
15+
apt_repository:
16+
repo: "deb https://packages.redirection.io/deb {{ ansible_distribution_release }} main"
17+
state: present
18+
19+
- name: Update apt cache
20+
apt:
21+
update_cache: true
22+
23+
- name: Install libapache2-mod-redirectionio
24+
apt:
25+
name: libapache2-mod-redirectionio
26+
state: latest

tasks/pkg-redhat.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
3+
- name: Add rpm repository key
4+
rpm_key:
5+
state: present
6+
key: http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x24765BBD8E16EB44
7+
8+
- set_fact:
9+
distribution_repository_name: centos
10+
when: ansible_distribution != 'Fedora'
11+
12+
- set_fact:
13+
distribution_repository_name: fedora
14+
when: ansible_distribution == 'Fedora'
15+
16+
- name: Install redirection.io repository
17+
yum_repository:
18+
name: redirectionio
19+
description: redirection.io
20+
baseurl: "https://packages.redirection.io/rpm/{{ distribution_repository_name }}_{{ ansible_distribution_major_version }}"
21+
enabled: yes
22+
gpgcheck: yes
23+
state: present
24+
25+
- name: Update yum cache
26+
yum:
27+
update_cache: true
28+
29+
- name: Install libapache2-mod-redirectionio
30+
yum:
31+
name: libapache2-mod-redirectionio
32+
state: latest

0 commit comments

Comments
 (0)