ansible-nginx/tests/includes/pre_Debian.yml

83 lines
2.0 KiB
YAML

---
- name: APT_REPOSITORY | Install backports
ansible.builtin.apt_repository:
repo: 'deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main'
state: present
when: nginx_backports is defined and nginx_backports
- name: APT | Install needed packages
ansible.builtin.apt:
pkg: "{{ packages }}"
update_cache: true
cache_valid_time: 3600
state: present
vars:
packages:
- cron
- curl
- daemonize
- jq
- nghttp2
- strace
- vim
- unzip
- name: APT | Install PHP
ansible.builtin.apt:
pkg: "{{ pkgs }}"
update_cache: true
cache_valid_time: 3600
state: present
vars:
pkgs:
- php-cli
- php-fpm
- name: SHELL | Get current PHP version
ansible.builtin.shell: php --version | awk '/^PHP/ { print $2 }' | grep -o -E '^.{3}'
changed_when: false
register: cur_php_version
# Bypasses Ansible+Docker issue. With service module... php is not really started!
- name: COMMAND | Force start PHP
ansible.builtin.command: "service php{{ cur_php_version.stdout }}-fpm start"
args:
creates: "/run/php/php{{ cur_php_version.stdout }}-fpm.pid"
- name: GET_URL | Download ngrok
ansible.builtin.get_url:
url: "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
dest: "/tmp/ngrok.zip"
- name: UNARCHIVE | Uncompress ngrok
ansible.builtin.unarchive:
src: "/tmp/ngrok.zip"
dest: "/tmp"
remote_src: true
- name: SET_FACT | ngrok_path
ansible.builtin.set_fact:
ngrok_path: '/tmp/ngrok'
- name: USER | Create PHP User foo
ansible.builtin.user:
name: foo
system: true
- name: INCLUDE_ROLE | hanxhx.php # TODO: repair vagrant
ansible.builtin.include_role:
name: "hanxhx.php"
vars:
php_version: "{{ cur_php_version.stdout }}"
php_autoremove_default_pool: false
php_fpm_poold:
- name: 'hx_unix'
user: 'foo'
php_value:
display_errors: 'Off'
php_admin_value:
memory_limit: '98M'
- name: 'hx_ip'
listen: '127.0.0.1:9636'