Skip to content

Commit d434dee

Browse files
committed
install v2 by default, documented configuration directives
1 parent f36b4c9 commit d434dee

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018-2019 redirection.io
1+
Copyright (c) 2018-2021 redirection.io
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ ansible-galaxy install redirectionio.apache_module
1717

1818
## Role variables
1919

20-
This role does not provide variables.
20+
By default, this role installs the last stable version of [libapache2-mod-redirectionio](https://github.com/redirectionio/libapache2-mod-redirectionio).
21+
This behavior can be modified using the following role variables:
22+
23+
* `redirectionio_apache_module_channel` (default: `stable`): choose a specific release channel (`stable` or `beta`)
24+
* `redirectionio_apache_module_main_version` (default: `2`): main version of the Apache module. This allows to upgrade safely your system without BC break with a new main version
25+
* `redirectionio_apache_module_version` (default: `*`): specific version of the Apache module. Use `*` to use the latest available version. Valid versions are of the form: `[timestamp]:[version]-[build]`, if you want a specific version like `2.0.0`, you should use `:2.0.0-`
2126

2227
## Example playbook
2328

defaults/main.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ redirectionio_packages_url: https://packages.redirection.io/
44
redirectionio_gpg_key_url: "{{ redirectionio_packages_url }}gpg.key"
55

66
# Version management
7-
# This allow to choose a specific version for your infrastructure
8-
# Channel can be stable or beta, left empty to use legacy system
9-
redirectionio_apache_module_channel: ""
10-
# Main version of agent, this allow to upgrade safely your system without BC break with a new main version
7+
# This allows to choose a specific release channel (stable or beta)
8+
redirectionio_apache_module_channel: "stable"
9+
10+
# Main version of the Apache module
11+
# This allows to upgrade safely your system without BC break with a new main version
1112
redirectionio_apache_module_main_version: 2
12-
# Specific version for your agent, use * to use the latest available version
13-
# Version are of the form: [timestamp]:[version]-[build], if you want a specific version like 2.0.0 you should put *:2.0.0-*
13+
14+
# Specific version of the Apache module. Use * to use the latest available version
15+
# Versions are of the form: [timestamp]:[version]-[build], if you want a specific version like 2.0.0, you should put *:2.0.0-*
1416
redirectionio_apache_module_version: "*"

meta/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@ galaxy_info:
1010
- name: Ubuntu
1111
versions:
1212
- xenial
13-
- artful
1413
- bionic
1514
- cuttlefish
15+
- disco
16+
- eoan
17+
- focal
1618
- name: Debian
1719
versions:
1820
- stretch
1921
- buster
2022
- name: EL
2123
versions:
24+
- 8
2225
- 7
23-
- 6
2426
galaxy_tags:
2527
- apache
2628
- http
2729
- monitoring
2830
- redirection
31+
- seo
2932
dependencies: []

tasks/pkg-debian.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
apt_repository:
1515
repo: "deb {{ redirectionio_packages_url }}deb {{ ansible_distribution_release }} main"
1616
state: present
17-
when: redirectionio_apache_module_channel|length == 0
17+
when: redirectionio_apache_module_main_version == 1
1818

1919
- name: Install redirection.io repository
2020
apt_repository:
2121
repo: "deb {{ redirectionio_packages_url }}deb/{{ redirectionio_apache_module_channel }}/{{ redirectionio_apache_module_main_version }} {{ ansible_distribution_release }} main"
2222
state: present
23-
when: redirectionio_apache_module_channel|length > 0
23+
when: redirectionio_apache_module_main_version > 1
2424

2525
- name: Update apt cache
2626
apt:

tasks/pkg-redhat.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,25 @@
55
state: present
66
key: "{{ redirectionio_gpg_key_url }}"
77

8-
- name: Define distribution_repository_name
9-
set_fact:
10-
distribution_repository_name: centos
11-
when: ansible_distribution != 'Fedora'
12-
13-
- name: Define distribution_repository_name when the distribution is Fedora
14-
set_fact:
15-
distribution_repository_name: fedora
16-
when: ansible_distribution == 'Fedora'
17-
188
- name: Install redirection.io repository
199
yum_repository:
2010
name: redirectionio
2111
description: redirection.io
22-
baseurl: "{{ redirectionio_packages_url }}rpm/{{ distribution_repository_name }}_{{ ansible_distribution_major_version }}"
12+
baseurl: "{{ redirectionio_packages_url }}rpm/centos_{{ ansible_distribution_major_version }}"
2313
enabled: yes
2414
gpgcheck: yes
2515
state: present
26-
when: redirectionio_apache_module_channel|length == 0
16+
when: redirectionio_apache_module_main_version == 1
2717

2818
- name: Install redirection.io repository
2919
yum_repository:
3020
name: redirectionio
3121
description: redirection.io
32-
baseurl: "{{ redirectionio_packages_url }}rpm/{{ redirectionio_apache_module_channel }}/{{ redirectionio_apache_module_main_version }}/{{ distribution_repository_name }}_{{ ansible_distribution_major_version }}"
22+
baseurl: "{{ redirectionio_packages_url }}rpm/{{ redirectionio_apache_module_channel }}/{{ redirectionio_apache_module_main_version }}/centos_{{ ansible_distribution_major_version }}"
3323
enabled: yes
3424
gpgcheck: yes
3525
state: present
36-
when: redirectionio_apache_module_channel|length > 0
26+
when: redirectionio_apache_module_main_version > 1
3727

3828
- name: Update yum cache
3929
yum:

0 commit comments

Comments
 (0)