mirror of
https://gitea.0xace.cc/ansible-galaxy/keepalived.git
synced 2025-04-05 14:41:56 +00:00
fix config override
This commit is contained in:
parent
d1676ed538
commit
19476a0d84
@ -4,6 +4,7 @@
|
|||||||
name: keepalived
|
name: keepalived
|
||||||
masked: yes
|
masked: yes
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Install keepalived
|
- name: Install keepalived
|
||||||
package:
|
package:
|
||||||
@ -11,7 +12,9 @@
|
|||||||
state: present
|
state: present
|
||||||
register: keepalived_setup
|
register: keepalived_setup
|
||||||
|
|
||||||
- block:
|
- name: Template keepalived.conf
|
||||||
|
when: keepalived_config_override is not defined
|
||||||
|
block:
|
||||||
- name: Merge config for keepalived
|
- name: Merge config for keepalived
|
||||||
set_fact:
|
set_fact:
|
||||||
keepalived_config: "{{ keepalived_default_config | combine(keepalived_config, recursive=true) }}"
|
keepalived_config: "{{ keepalived_default_config | combine(keepalived_config, recursive=true) }}"
|
||||||
@ -22,7 +25,6 @@
|
|||||||
dest: "/etc/keepalived/keepalived.conf"
|
dest: "/etc/keepalived/keepalived.conf"
|
||||||
notify:
|
notify:
|
||||||
- Restart keepalived
|
- Restart keepalived
|
||||||
when: not keepalived_config_override
|
|
||||||
|
|
||||||
- name: Override keepalived config
|
- name: Override keepalived config
|
||||||
copy:
|
copy:
|
||||||
@ -30,7 +32,29 @@
|
|||||||
dest: "/etc/keepalived/keepalived.conf"
|
dest: "/etc/keepalived/keepalived.conf"
|
||||||
notify:
|
notify:
|
||||||
- Restart keepalived
|
- Restart keepalived
|
||||||
when: keepalived_config_override
|
when: keepalived_config_override is defined
|
||||||
|
|
||||||
|
- name: Create dir for scripts
|
||||||
|
file:
|
||||||
|
name: /etc/keepalived/scripts
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Create scripts for keepalived
|
||||||
|
copy:
|
||||||
|
content: "{{ item.data }}"
|
||||||
|
dest: "/etc/keepalived/scripts/{{ item.name }}"
|
||||||
|
mode: 0755
|
||||||
|
loop: "{{ keepalived_scripts }}"
|
||||||
|
notify:
|
||||||
|
- Restart keepalived
|
||||||
|
when: keepalived_scripts is defined
|
||||||
|
|
||||||
|
- name: Unmask Keepalived after install for Debian OS family
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: keepalived
|
||||||
|
masked: no
|
||||||
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Enable and start keepalived service
|
- name: Enable and start keepalived service
|
||||||
systemd:
|
systemd:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user