Bertrand Lanson
6de372aabd
All checks were successful
test / Linting (push) Successful in 34s
test / Molecule tests (default, debian11) (push) Successful in 3m9s
test / Molecule tests (default, debian12) (push) Successful in 3m21s
test / Molecule tests (default, ubuntu2004) (push) Successful in 3m49s
test / Molecule tests (with_custom_conf, debian11) (push) Successful in 2m26s
test / Molecule tests (default, ubuntu2204) (push) Successful in 3m13s
test / Molecule tests (with_custom_conf, debian12) (push) Successful in 3m9s
test / Molecule tests (with_custom_conf, ubuntu2004) (push) Successful in 3m28s
test / Molecule tests (with_custom_conf, ubuntu2204) (push) Successful in 2m53s
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
---
|
|
# 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:
|
|
src: keepalived.env.j2
|
|
dest: "{{ deploy_keepalived_config_dir }}/keepalived.env"
|
|
owner: "{{ deploy_keepalived_user }}"
|
|
group: "{{ deploy_keepalived_group }}"
|
|
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: "root"
|
|
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: "root"
|
|
group: "{{ deploy_keepalived_script_user }}"
|
|
mode: "0700"
|
|
with_fileglob:
|
|
- "{{ deploy_keepalived_custom_scripts_src }}/*"
|
|
when: deploy_keepalived_custom_scripts_src
|