Installation de php en fonction de la distribution.

This commit is contained in:
William 2021-12-22 17:29:42 +01:00
parent 84ecdf92cd
commit 1e5bfe1afc

View File

@ -1,9 +1,23 @@
--- ---
- name: apt repository - name: add gpg key (debian)
apt_key:
url: "https://packages.sury.org/php/apt.gpg"
state: present
when: ansible_distribution == 'Debian'
- name: add repository (debian)
apt_repository:
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
state: present
update_cache: yes
when: ansible_distribution == 'Debian'
- name: add repository (ubuntu)
apt_repository: apt_repository:
repo: ppa:ondrej/php repo: ppa:ondrej/php
state: present state: present
update_cache: yes update_cache: yes
when: ansible_distribution == 'Ubuntu'
- name: install - name: install
apt: apt: