some preps to make lbs.
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s
This commit is contained in:
@@ -45,6 +45,14 @@
|
||||
|
||||
|
||||
|
||||
- name: Проверяем наличие персонального конфига на мастер-ноде
|
||||
ansible.builtin.stat:
|
||||
# Папка files лежит в корне, откуда вы запускаете playbook,
|
||||
# поэтому здесь пишем прямой путь от корня запуска.
|
||||
path: "files/angie/{{ inventory_hostname }}.conf"
|
||||
delegate_to: localhost
|
||||
register: remote_config_file
|
||||
|
||||
- name: Копировать конфиг Angie только если есть персональный файл
|
||||
ansible.builtin.copy:
|
||||
src: "files/angie.{{ inventory_hostname }}.conf"
|
||||
@@ -53,5 +61,13 @@
|
||||
group: root
|
||||
mode: '0644'
|
||||
# Проверяем, существует ли файл на мастер-ноде. Если нет — таска просто скипнется
|
||||
when: query('ansible.builtin.fileglob', '../../files/angie.' ~ inventory_hostname ~ '.conf') | length > 0
|
||||
# when: query('ansible.builtin.fileglob', '../../files/angie.' ~ inventory_hostname ~ '.conf') | length > 0
|
||||
when: remote_config_file.stat.exists
|
||||
notify: Restart Angie
|
||||
|
||||
|
||||
handlers:
|
||||
- name: Restart Angie
|
||||
ansible.builtin.service:
|
||||
name: angie
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user