deploy_keepalived/tasks/configure.yml

45 lines
1.5 KiB
YAML
Raw Normal View History

---
# 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"
owner: "{{ deploy_keepalived_user }}"
group: "{{ deploy_keepalived_group }}"
2024-03-09 22:36:26 +00:00
mode: "0600"
- name: "Copy keepalived.conf template"
ansible.builtin.template:
src: "{{ deploy_keepalived_custom_config_src if deploy_keepalived_use_custom_config else 'keepalived.conf.j2' }}"
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) }}"
owner: "{{ deploy_keepalived_script_user }}"
group: "{{ deploy_keepalived_script_user }}"
mode: "0700"
with_fileglob:
- "files/*"
- name: "Copy custom scripts"
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ deploy_keepalived_scripts_dir }}/{{ (item | basename) }}"
owner: "{{ deploy_keepalived_script_user }}"
group: "{{ deploy_keepalived_script_user }}"
mode: "0700"
with_fileglob:
- "{{ deploy_keepalived_custom_scripts_src }}/*"
when: deploy_keepalived_custom_scripts_src