You've already forked role_keepalived
Compare commits
13 Commits
main
...
c342aa9438
Author | SHA1 | Date | |
---|---|---|---|
c342aa9438 | |||
f3df32e2c2 | |||
c20f87e83a | |||
0d4cd47771 | |||
54e2b70bd6 | |||
ef4a4fcba4 | |||
006d302f61 | |||
0efc0c6887 | |||
954528bd4d | |||
2ae07d3c35 | |||
225a8c8021 | |||
570ceda411 | |||
434ec3ca1f |
@@ -21,14 +21,14 @@ keepalived_notify_is_fault: {}
|
|||||||
keepalived_notify_by_default: {}
|
keepalived_notify_by_default: {}
|
||||||
|
|
||||||
keepalived_track_scripts: []
|
keepalived_track_scripts: []
|
||||||
# Example:
|
# Exemple:
|
||||||
# - name: check_haproxy_8080
|
# - name: check_haproxy_8080
|
||||||
# command: /usr/bin/nc -zv 127.0.0.1 8080
|
# command: /usr/bin/nc -zv 127.0.0.1 8080
|
||||||
# - name: check_haproxy_8081
|
# - name: check_haproxy_8081
|
||||||
# command: /usr/bin/nc -zv 127.0.0.1 8081
|
# command: /usr/bin/nc -zv 127.0.0.1 8081
|
||||||
|
|
||||||
keepalived_track_processes: []
|
keepalived_track_processes: []
|
||||||
# Example:
|
# Exemple:
|
||||||
# - name: check_haproxy
|
# - name: check_haproxy
|
||||||
# search: /usr/sbin/haproxy
|
# search: /usr/sbin/haproxy
|
||||||
# quorum: 2
|
# quorum: 2
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# handlers file for keepalived
|
# handlers file for keepalived
|
||||||
|
|
||||||
- name: Restart keepalived.service
|
- name: Redémarrer keepalived.service
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
state: restarted
|
state: restarted
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
namespace: ykn
|
namespace: ykn
|
||||||
author: pulsar89.5
|
author: pulsar89.5
|
||||||
description: Deploy keepalived
|
description: Rôle de déploiement de keepalived
|
||||||
|
|
||||||
license: GPL-3.0-or-later
|
license: GPL-3.0-or-later
|
||||||
|
|
||||||
@@ -13,4 +13,12 @@ galaxy_info:
|
|||||||
- all
|
- all
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- role: nftables
|
||||||
- role: users
|
- role: users
|
||||||
|
vars:
|
||||||
|
users_role_keepalived:
|
||||||
|
- name: keepalived_script
|
||||||
|
comment: "Dedicated user for keepalived script"
|
||||||
|
update_password: on_create
|
||||||
|
password_lock: true
|
||||||
|
shell: /bin/bash
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
# tasks file for keepalived
|
|
||||||
|
|
||||||
- name: Deploy configuration
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: keepalived.j2
|
|
||||||
dest: /etc/keepalived/keepalived.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: u=rw,g=r,o=r
|
|
||||||
become: true
|
|
||||||
notify: Restart keepalived.service
|
|
||||||
|
|
||||||
- name: Deploy sudoers configuration
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: sudoers.j2
|
|
||||||
dest: /etc/sudoers.d/keepalived_script
|
|
||||||
owner: root
|
|
||||||
group: keepalived_script
|
|
||||||
mode: u=rwx,g=rx,o=
|
|
||||||
validate: /usr/sbin/visudo -cf %s
|
|
||||||
when:
|
|
||||||
- keepalived_notify_enable
|
|
||||||
- keepalived_sudoers_cmd | length > 0
|
|
||||||
become: true
|
|
||||||
notify: Restart keepalived.service
|
|
||||||
|
|
||||||
- name: Deploy notify script
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: notify.bash.j2
|
|
||||||
dest: /etc/keepalived/notify.bash
|
|
||||||
owner: root
|
|
||||||
group: keepalived_script
|
|
||||||
mode: u=rwx,g=rx,o=
|
|
||||||
when: keepalived_notify_enable
|
|
||||||
become: true
|
|
||||||
notify: Restart keepalived.service
|
|
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
# tasks file for keepalived
|
|
||||||
|
|
||||||
- name: Install keepalived
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name: keepalived
|
|
||||||
become: true
|
|
@@ -1,10 +1,42 @@
|
|||||||
---
|
---
|
||||||
# tasks file for keepalived
|
# tasks file for keepalived
|
||||||
|
|
||||||
- name: Import installation tasks
|
- name: Installer le paquet
|
||||||
ansible.builtin.import_tasks:
|
ansible.builtin.apt:
|
||||||
file: installation.yml
|
name: keepalived
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Import configuration tasks
|
- name: Déployer la configuration
|
||||||
ansible.builtin.import_tasks:
|
ansible.builtin.template:
|
||||||
file: configuration.yml
|
src: keepalived.j2
|
||||||
|
dest: /etc/keepalived/keepalived.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: u=rw,g=r,o=r
|
||||||
|
become: true
|
||||||
|
notify: Redémarrer keepalived.service
|
||||||
|
|
||||||
|
- name: Déployer le fichier de configuration de sudoers
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: sudoers.j2
|
||||||
|
dest: /etc/sudoers.d/keepalived_script
|
||||||
|
owner: root
|
||||||
|
group: keepalived_script
|
||||||
|
mode: u=rwx,g=rx,o=
|
||||||
|
validate: /usr/sbin/visudo -cf %s
|
||||||
|
when:
|
||||||
|
- keepalived_notify_enable
|
||||||
|
- keepalived_sudoers_cmd | length > 0
|
||||||
|
become: true
|
||||||
|
notify: Redémarrer keepalived.service
|
||||||
|
|
||||||
|
- name: Déployer les scripts
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: notify.bash.j2
|
||||||
|
dest: /etc/keepalived/notify.bash
|
||||||
|
owner: root
|
||||||
|
group: keepalived_script
|
||||||
|
mode: u=rwx,g=rx,o=
|
||||||
|
when: keepalived_notify_enable
|
||||||
|
become: true
|
||||||
|
notify: Redémarrer keepalived.service
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
# vars file for keepalived
|
|
||||||
|
|
||||||
users:
|
|
||||||
- name: keepalived_script
|
|
||||||
comment: "Dedicated user for keepalived script"
|
|
||||||
update_password: on_create
|
|
||||||
password_lock: true
|
|
||||||
shell: /bin/bash
|
|
Reference in New Issue
Block a user