Compare commits
No commits in common. "d63e0ede094e009fbe1f519b8cf22c594d803aac" and "c342aa9438122da05298b41f6c044df59941f083" have entirely different histories.
d63e0ede09
...
c342aa9438
@ -1,14 +1,7 @@
|
|||||||
---
|
---
|
||||||
# handlers file for keepalived
|
# handlers file for keepalived
|
||||||
|
|
||||||
- name: Apply installation
|
- name: Redémarrer keepalived.service
|
||||||
ansible.builtin.command:
|
|
||||||
argv:
|
|
||||||
- /usr/bin/rpm-ostree
|
|
||||||
- apply-live
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Restart keepalived.service
|
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
state: restarted
|
state: restarted
|
||||||
|
@ -15,3 +15,10 @@ galaxy_info:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- role: nftables
|
- 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,25 +0,0 @@
|
|||||||
---
|
|
||||||
# tasks file for keepalived
|
|
||||||
|
|
||||||
- name: Install keepalived
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name: keepalived
|
|
||||||
when: ansible_facts['pkg_mgr'] == "apt"
|
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Install keepalived
|
|
||||||
ansible.builtin.command:
|
|
||||||
argv:
|
|
||||||
- /usr/bin/rpm-ostree
|
|
||||||
- install
|
|
||||||
- --allow-inactive
|
|
||||||
- --assumeyes
|
|
||||||
- --idempotent
|
|
||||||
- keepalived
|
|
||||||
creates: /sysroot/ostree/repo/refs/heads/rpmostree/pkg/keepalived
|
|
||||||
when: ansible_facts['pkg_mgr'] == "atomic_container"
|
|
||||||
become: true
|
|
||||||
notify: Apply installation
|
|
||||||
|
|
||||||
- name: Flush handlers
|
|
||||||
meta: flush_handlers
|
|
@ -1,10 +1,42 @@
|
|||||||
---
|
---
|
||||||
# tasks file for keepalived
|
# tasks file for keepalived
|
||||||
|
|
||||||
- name: Include installation tasks
|
- name: Installer le paquet
|
||||||
ansible.builtin.include_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
|
|
Loading…
x
Reference in New Issue
Block a user