ansible-nginx/tests/includes/pre_Debian.yml

102 lines
2.3 KiB
YAML
Raw Normal View History

---
- name: APT_REPOSITORY | Install backports
2017-10-03 22:57:35 +07:00
apt_repository:
repo: 'deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main'
state: present
when: nginx_backports
- block:
- name: APT | Install apt-transport-https
apt:
pkg: apt-transport-https
update_cache: yes
cache_valid_time: 3600
- name: APT_KEY | Install GPG key
apt_key:
url: 'https://packages.sury.org/php/apt.gpg'
- name: APT_REPOSITORY | Add APT repository
apt_repository:
repo: 'deb https://packages.sury.org/php {{ ansible_distribution_release }} main'
when: sury | default(false)
- name: APT | Install needed packages
2017-10-03 22:57:35 +07:00
apt:
pkg: "{{ packages }}"
2017-10-03 22:57:35 +07:00
update_cache: yes
cache_valid_time: 3600
state: present
vars:
packages:
- cron
- curl
2019-02-20 21:06:59 +07:00
- daemonize
- fcgiwrap
- jq
- nghttp2
- strace
- vim
- unzip
2017-12-03 04:22:28 +07:00
- name: APT | Install PHP
2017-10-03 22:57:35 +07:00
apt:
pkg: "{{ item.version | php_fpm_package }}"
2017-10-03 22:57:35 +07:00
update_cache: yes
cache_valid_time: 3600
state: present
loop: "{{ nginx_php }}"
register: apt_php
2016-10-13 15:19:24 +07:00
- name: SERVICE | Force start fcgiwrap
service:
name: "fcgiwrap"
state: started
# Bypasses Ansible+Docker issue. With service module... php is not really started!
- name: COMMAND | Force start PHP
command: "service {{ item.version | php_fpm_service }} start"
args:
creates: "{{ item.version | php_default_upstream_socket }}"
warn: false
loop: "{{ nginx_php }}"
2017-12-03 04:22:28 +07:00
- name: GET_URL | Download ngrok
get_url:
url: "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
dest: "/tmp/ngrok.zip"
- name: UNARCHIVE | Uncompress ngrok
unarchive:
src: "/tmp/ngrok.zip"
dest: "/tmp"
remote_src: yes
2018-03-17 03:56:15 +07:00
- name: SET_FACT | ngrok_path
set_fact:
ngrok_path: '/tmp/ngrok'
- name: USER | Create PHP User foo
user:
name: foo
system: yes
- name: INCLUDE_ROLE | HanXHX.php
include_role:
name: "{{ playbook_dir }}/HanXHX.php"
vars:
2019-12-26 23:35:00 +07:00
php_version: "{{ nginx_php.0.version }}"
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'