Skip to content

Commit

Permalink
install v2 by default, documented configuration directives
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Jan 14, 2021
1 parent f36b4c9 commit d434dee
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018-2019 redirection.io
Copyright (c) 2018-2021 redirection.io

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ ansible-galaxy install redirectionio.apache_module

## Role variables

This role does not provide variables.
By default, this role installs the last stable version of [libapache2-mod-redirectionio](https://github.com/redirectionio/libapache2-mod-redirectionio).
This behavior can be modified using the following role variables:

* `redirectionio_apache_module_channel` (default: `stable`): choose a specific release channel (`stable` or `beta`)
* `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
* `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-`

## Example playbook

Expand Down
14 changes: 8 additions & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ redirectionio_packages_url: https://packages.redirection.io/
redirectionio_gpg_key_url: "{{ redirectionio_packages_url }}gpg.key"

# Version management
# This allow to choose a specific version for your infrastructure
# Channel can be stable or beta, left empty to use legacy system
redirectionio_apache_module_channel: ""
# Main version of agent, this allow to upgrade safely your system without BC break with a new main version
# This allows to choose a specific release channel (stable or beta)
redirectionio_apache_module_channel: "stable"

# Main version of the Apache module
# This allows to upgrade safely your system without BC break with a new main version
redirectionio_apache_module_main_version: 2
# Specific version for your agent, use * to use the latest available version
# Version are of the form: [timestamp]:[version]-[build], if you want a specific version like 2.0.0 you should put *:2.0.0-*

# Specific version of the Apache module. Use * to use the latest available version
# Versions are of the form: [timestamp]:[version]-[build], if you want a specific version like 2.0.0, you should put *:2.0.0-*
redirectionio_apache_module_version: "*"
7 changes: 5 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ galaxy_info:
- name: Ubuntu
versions:
- xenial
- artful
- bionic
- cuttlefish
- disco
- eoan
- focal
- name: Debian
versions:
- stretch
- buster
- name: EL
versions:
- 8
- 7
- 6
galaxy_tags:
- apache
- http
- monitoring
- redirection
- seo
dependencies: []
4 changes: 2 additions & 2 deletions tasks/pkg-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
apt_repository:
repo: "deb {{ redirectionio_packages_url }}deb {{ ansible_distribution_release }} main"
state: present
when: redirectionio_apache_module_channel|length == 0
when: redirectionio_apache_module_main_version == 1

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

- name: Update apt cache
apt:
Expand Down
18 changes: 4 additions & 14 deletions tasks/pkg-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,25 @@
state: present
key: "{{ redirectionio_gpg_key_url }}"

- name: Define distribution_repository_name
set_fact:
distribution_repository_name: centos
when: ansible_distribution != 'Fedora'

- name: Define distribution_repository_name when the distribution is Fedora
set_fact:
distribution_repository_name: fedora
when: ansible_distribution == 'Fedora'

- name: Install redirection.io repository
yum_repository:
name: redirectionio
description: redirection.io
baseurl: "{{ redirectionio_packages_url }}rpm/{{ distribution_repository_name }}_{{ ansible_distribution_major_version }}"
baseurl: "{{ redirectionio_packages_url }}rpm/centos_{{ ansible_distribution_major_version }}"
enabled: yes
gpgcheck: yes
state: present
when: redirectionio_apache_module_channel|length == 0
when: redirectionio_apache_module_main_version == 1

- name: Install redirection.io repository
yum_repository:
name: redirectionio
description: redirection.io
baseurl: "{{ redirectionio_packages_url }}rpm/{{ redirectionio_apache_module_channel }}/{{ redirectionio_apache_module_main_version }}/{{ distribution_repository_name }}_{{ ansible_distribution_major_version }}"
baseurl: "{{ redirectionio_packages_url }}rpm/{{ redirectionio_apache_module_channel }}/{{ redirectionio_apache_module_main_version }}/centos_{{ ansible_distribution_major_version }}"
enabled: yes
gpgcheck: yes
state: present
when: redirectionio_apache_module_channel|length > 0
when: redirectionio_apache_module_main_version > 1

- name: Update yum cache
yum:
Expand Down

0 comments on commit d434dee

Please sign in to comment.