diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..0f23865 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# Ansible Role: Remi repository + +Installs Remi repository + +## Supported platforms + +``` +CentOS 6 & 7 +``` + +## Requirements + +None + +## Role Variables + +Enable remi-php55: + +``` +remi_enable_php55: true +``` + +Enable remi-php56: + +``` +remi_enable_php56: false +``` + +## Dependencies + +None + +## Example Playbook + +``` +- hosts: servers + roles: + - { role: pcextreme.repo-remi } +``` + +## License + +MIT / BSD + +## Author Information + +Created by [Attila van der Velde](https://github.com/vdvm) diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..3ac3890 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,3 @@ +--- +remi_enable_php55: true +remi_enable_php56: false diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..dc17aeb --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,17 @@ +--- +galaxy_info: + author: "Attila van der Velde" + description: "Installs Remi repository" + company: "PCextreme B.V." + license: "license (MIT, BSD)" + min_ansible_version: 1.8 + platforms: + - name: EL + versions: + - 6 + - 7 + categories: + - packaging + +dependencies: + - { role: pcextreme.repo-epel } diff --git a/tasks/centos.yml b/tasks/centos.yml new file mode 100644 index 0000000..6e909be --- /dev/null +++ b/tasks/centos.yml @@ -0,0 +1,12 @@ +--- +- name: Add Remi repo file + template: src=remi.repo.j2 dest=/etc/yum.repos.d/remi.repo owner=root group=root mode=0644 + +- name: Add Remi repo key + get_url: url=http://rpms.famillecollet.com/RPM-GPG-KEY-remi dest=/etc/pki/rpm-gpg/RPM-GPG-KEY-remi sha256sum=b0d1d4ca043e2bd60ff71899b5c0145af64f9c0ec6f2073357dfb64deada59e4 force=yes + +- name: Add Remi repo key + file: path=/etc/pki/rpm-gpg/RPM-GPG-KEY-remi owner=root group=root mode=0644 + +- name: Add Remi repo key + rpm_key: state=present key=/etc/pki/rpm-gpg/RPM-GPG-KEY-remi diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..7bc0705 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include: centos.yml + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6 diff --git a/templates/remi.repo.j2 b/templates/remi.repo.j2 new file mode 100644 index 0000000..d076238 --- /dev/null +++ b/templates/remi.repo.j2 @@ -0,0 +1,36 @@ +[remi] +name=Les RPM de remi pour Enterprise Linux {{ ansible_distribution_major_version }} - $basearch +#baseurl=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/remi/$basearch/ +mirrorlist=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/remi/mirror +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi + +[remi-php55] +name=Les RPM de remi de PHP 5.5 pour Enterprise Linux {{ ansible_distribution_major_version }} - $basearch +#baseurl=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/php55/$basearch/ +mirrorlist=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/php55/mirror +# WARNING: If you enable this repository, you must also enable "remi" +enabled={% if remi_enable_php55 %}1{% else %}0{% endif %} + +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi + +[remi-php56] +name=Les RPM de remi de PHP 5.6 pour Enterprise Linux {{ ansible_distribution_major_version }} - $basearch +#baseurl=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/php56/$basearch/ +mirrorlist=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/php56/mirror +# WARNING: If you enable this repository, you must also enable "remi" +enabled={% if remi_enable_php56 %}1{% else %}0{% endif %} + +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi + +[remi-test] +name=Les RPM de remi en test pour Enterprise Linux {{ ansible_distribution_major_version }} - $basearch +#baseurl=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/test/$basearch/ +mirrorlist=http://rpms.famillecollet.com/enterprise/{{ ansible_distribution_major_version }}/test/mirror +# WARNING: If you enable this repository, you must also enable "remi" +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi