-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconverge.yml
95 lines (95 loc) · 3.55 KB
/
converge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
- name: Converge
hosts: instance
become: true
pre_tasks:
- name: Create project groups
ansible.builtin.group:
name: "test_symfonyapp"
state: present
- name: Create project app user test_symfonyapp
ansible.builtin.user:
name: "test_symfonyapp"
password: "*"
home: "/test_symfony/.app"
createhome: true
group: "test_symfonyapp"
append: true
tasks:
- name: Include php versions role
ansible.builtin.include_role:
name: geerlingguy.php-versions
vars:
php_version: "8.2"
- name: Include php role
ansible.builtin.include_role:
name: geerlingguy.php
vars:
php_version: "8.2"
php_install_recommends: false
php_enable_php_fpm: true
php_webserver_daemon: "nginx"
php_date_timezone: "Europe/Paris"
php_expose_php: false
php_fpm_pool_user: test_symfonyapp
php_fpm_pool_group: test_symfonyapp
- name: Include nginx role
ansible.builtin.include_role:
name: geerlingguy.nginx
vars:
nginx_remove_default_vhost: true
nginx_worker_processes: "{{ ansible_processor_vcpus|default(ansible_processor_count) }}"
nginx_vhosts:
- listen: "80"
server_name: "localhost"
index: "/"
extra_parameters: |
root /test_symfony/project_root/www/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
- name: Include steamengine role
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
steamengine_project_name: test_symfony
steamengine_project_type: symfony
steamengine_build_url: https://delivery.steamulo.org/SteamEngineV2_tests/symfony5-4_test.zip
steamengine_build_checksum: sha1:daaa9a3b4e6e0b33bf3d7883ff8b6bf5d35433b9
steamengine_project_configuration:
APP_ENV: dev
MESSENGER_TRANSPORT_DSN: in-memory://
steamengine_wrapper_scripts_extra:
- name: cache_clear_dev
description: "Clear symfony cache"
command: "{{ steamengine_php_bin_path }} bin/console cache:clear --env=dev"
run_as_app_user: true
run_in_project_root_path_web: true
steamengine_wrapper_scripts_post_deploy:
- "cache_clear"
- "cache_clear_dev"
steamengine_persistent_directories:
- path: "protected_upload"
symlink_src: "project_root/www/upload"
steamengine_crons:
- name: "cache_clear_cron"
description: "Cache clear Daily"
command: "{{ steamengine_php_bin_path }} bin/console cache:clear --env=prod"
run_as_app_user: true
run_in_project_root_path_web: true
special_time: daily
steamengine_extra_services:
- name: messenger
description: "Symfony Messenger: Sync & Queued Message Handling"
command: "{{ steamengine_php_bin_path }} bin/console messenger:consume async --limit=10 --env=prod"