2024-03-09 21:34:20 +00:00
|
|
|
---
|
|
|
|
# task/configure file for deploy_keepalived
|
|
|
|
- name: "Configure for host installation"
|
|
|
|
when: deploy_keepalived_deploy_method == 'host'
|
|
|
|
block:
|
|
|
|
- name: "Create keepalived environment file"
|
|
|
|
ansible.builtin.template:
|
2024-03-09 22:36:26 +00:00
|
|
|
src: keepalived.env.j2
|
|
|
|
dest: "{{ deploy_keepalived_config_dir }}/keepalived.env"
|
2024-03-09 21:34:20 +00:00
|
|
|
owner: "{{ deploy_keepalived_user }}"
|
|
|
|
group: "{{ deploy_keepalived_group }}"
|
2024-03-09 22:36:26 +00:00
|
|
|
mode: "0600"
|
2024-03-09 21:34:20 +00:00
|
|
|
|
|
|
|
- name: "Copy keepalived.conf template"
|
|
|
|
ansible.builtin.template:
|
2024-03-11 18:29:02 +00:00
|
|
|
src: "{{ deploy_keepalived_custom_config_src if deploy_keepalived_use_custom_config else 'keepalived.conf.j2' }}"
|
2024-03-09 21:34:20 +00:00
|
|
|
dest: "{{ deploy_keepalived_config_dir }}/keepalived.conf"
|
|
|
|
owner: "{{ deploy_keepalived_user }}"
|
|
|
|
group: "{{ deploy_keepalived_group }}"
|
|
|
|
mode: "0600"
|
|
|
|
notify:
|
|
|
|
- "systemctl-enable-keepalived"
|
|
|
|
- "systemctl-restart-keepalived"
|
|
|
|
|
|
|
|
- name: "Copy default notify script"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ deploy_keepalived_scripts_dir }}/{{ (item | basename) }}"
|
2024-04-29 18:23:50 +00:00
|
|
|
owner: "root"
|
2024-03-10 18:42:38 +00:00
|
|
|
group: "{{ deploy_keepalived_script_user }}"
|
2024-03-09 21:34:20 +00:00
|
|
|
mode: "0700"
|
|
|
|
with_fileglob:
|
|
|
|
- "files/*"
|
|
|
|
|
|
|
|
- name: "Copy custom scripts"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ deploy_keepalived_scripts_dir }}/{{ (item | basename) }}"
|
2024-04-29 18:23:50 +00:00
|
|
|
owner: "root"
|
2024-03-10 18:42:38 +00:00
|
|
|
group: "{{ deploy_keepalived_script_user }}"
|
2024-03-09 21:34:20 +00:00
|
|
|
mode: "0700"
|
|
|
|
with_fileglob:
|
|
|
|
- "{{ deploy_keepalived_custom_scripts_src }}/*"
|
|
|
|
when: deploy_keepalived_custom_scripts_src
|