infrastructure/roles/davina_core/tasks/main.json

73 lines
1.4 KiB
JSON
Raw Normal View History

2025-09-16 13:43:50 +02:00
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"git",
"make",
"rsync",
2025-09-21 17:49:43 +02:00
"nodejs",
"php-xml",
"php-curl",
"php-mstring"
2025-09-16 13:43:50 +02:00
]
}
},
{
"name": "user and directory",
"become": true,
"ansible.builtin.user": {
2025-09-25 23:55:37 +02:00
"name": "{{var_davina_core_user}}",
2025-09-16 13:43:50 +02:00
"create_home": true,
2025-09-25 23:55:37 +02:00
"home": "{{var_davina_core_directory}}"
2025-09-16 13:43:50 +02:00
}
},
2025-09-18 13:44:07 +02:00
{
"name": "adjust data directory",
"become": true,
"ansible.builtin.file": {
"group": "www-data",
"mode": "g+rwx"
}
},
2025-09-16 13:43:50 +02:00
{
"name": "program | fetch",
"become": true,
2025-09-25 23:55:37 +02:00
"become_user": "{{var_davina_core_user}}",
2025-09-16 13:43:50 +02:00
"ansible.builtin.git": {
2025-09-25 23:55:37 +02:00
"repo": "{{var_davina_core_git_repository_url}}",
"version": "{{var_davina_core_git_reference}}",
2025-09-16 13:43:50 +02:00
"dest": "/tmp/davina-backend-repo"
}
},
{
"name": "program | build",
"become": true,
2025-09-25 23:55:37 +02:00
"become_user": "{{var_davina_core_user}}",
2025-09-16 13:43:50 +02:00
"ansible.builtin.command": {
"chdir": "/tmp/davina-backend-repo",
"cmd": "tools/build"
}
},
{
"name": "program | deploy",
"become": true,
2025-09-25 23:55:37 +02:00
"become_user": "{{var_davina_core_user}}",
2025-09-16 13:43:50 +02:00
"ansible.builtin.command": {
"chdir": "/tmp/davina-backend-repo",
2025-09-25 23:55:37 +02:00
"cmd": "tools/deploy localhost --target-directory={{var_davina_core_directory}}"
2025-09-16 13:43:50 +02:00
}
},
{
"name": "conf",
"become": true,
"ansible.builtin.template": {
"src": "conf.json.j2",
2025-09-25 23:55:37 +02:00
"dest": "{{var_davina_core_directory}}/conf.json",
"owner": "{{var_davina_core_user}}"
2025-09-16 13:43:50 +02:00
}
}
]