Skip to content

Commit 6976c86

Browse files
committed
Make sure web directories exist and have the correct owner.
Fix webhook changed-check and up telegram-bot-manager to 1.0.0
1 parent d3f7010 commit 6976c86

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

tasks/install.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
---
2+
- name: Ensure working directory exists.
3+
file:
4+
path: "{{ item.working_dir }}"
5+
state: directory
6+
owner: "{{ php_telegram_bot_websrv_user }}"
7+
group: "{{ php_telegram_bot_websrv_user }}"
8+
with_items: "{{ php_telegram_bot_bots }}"
9+
10+
- name: Ensure public folder for simple bots exists.
11+
file:
12+
path: "{{ item.working_dir }}/public"
13+
state: directory
14+
owner: "{{ php_telegram_bot_websrv_user }}"
15+
group: "{{ php_telegram_bot_websrv_user }}"
16+
with_items: "{{ php_telegram_bot_bots }}"
17+
when: item.project_repo is not defined and item.manager_path is not defined
18+
219
- name: Fetch all project bot repositories.
320
become: yes
421
become_user: "{{ php_telegram_bot_websrv_user }}"
@@ -11,15 +28,6 @@
1128
when: item.project_repo is defined
1229
ignore_errors: yes
1330

14-
- name: Ensure public folder for simple bots exists.
15-
file:
16-
path: "{{ item.working_dir }}/public"
17-
state: directory
18-
owner: "{{ php_telegram_bot_websrv_user }}"
19-
group: "{{ php_telegram_bot_websrv_user }}"
20-
with_items: "{{ php_telegram_bot_bots }}"
21-
when: item.project_repo is not defined and item.manager_path is not defined
22-
2331
- name: Create all simple bot projects.
2432
become: yes
2533
become_user: "{{ php_telegram_bot_websrv_user }}"

tasks/webhook.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
with_items: "{{ php_telegram_bot_bots_installed.results }}"
77
when: item.item.webhook is defined
88
register: php_telegram_bot_set_webhook
9-
changed_when: php_telegram_bot_set_webhook.content == "Webhook is already deleted\nWebhook was set\n"
9+
changed_when: php_telegram_bot_set_webhook.content is defined and php_telegram_bot_set_webhook.content == "Webhook is already deleted\nWebhook was set\n"
1010
ignore_errors: yes

templates/manager.default.php.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Dotenv\Dotenv;
44
use Longman\TelegramBot\Exception;
55
use Longman\TelegramBot\TelegramLog;
6-
use NPM\TelegramBotManager\BotManager;
6+
use TelegramBot\TelegramBotManager\BotManager;
77

88
// Composer autoloader.
99
require_once __DIR__ . '/../vendor/autoload.php';

0 commit comments

Comments
 (0)