diff --git a/defaults/main.yml b/defaults/main.yml index e2605c2..cfc06d7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,14 +21,14 @@ keepalived_notify_is_fault: {} keepalived_notify_by_default: {} keepalived_track_scripts: [] -# Exemple: +# Example: # - name: check_haproxy_8080 # command: /usr/bin/nc -zv 127.0.0.1 8080 # - name: check_haproxy_8081 # command: /usr/bin/nc -zv 127.0.0.1 8081 keepalived_track_processes: [] -# Exemple: +# Example: # - name: check_haproxy # search: /usr/sbin/haproxy # quorum: 2 diff --git a/handlers/main.yml b/handlers/main.yml index 3f262cb..156ea70 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,13 +1,6 @@ --- # handlers file for keepalived -- name: Apply installation - ansible.builtin.command: - argv: - - /usr/bin/rpm-ostree - - apply-live - become: true - - name: Restart keepalived.service become: true ansible.builtin.systemd: diff --git a/meta/main.yml b/meta/main.yml index 929ee49..d4cb895 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,7 +1,7 @@ galaxy_info: namespace: ykn author: pulsar89.5 - description: Rôle de déploiement de keepalived + description: Deploy keepalived license: GPL-3.0-or-later @@ -13,12 +13,4 @@ galaxy_info: - all dependencies: - - role: nftables - 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 diff --git a/tasks/installation.yml b/tasks/installation.yml index d5570f3..5a3ce5e 100644 --- a/tasks/installation.yml +++ b/tasks/installation.yml @@ -4,22 +4,4 @@ - 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: /usr/sbin/dnsmasq - when: ansible_facts['pkg_mgr'] == "atomic_container" - become: true - notify: Apply installation - -- name: Flush handlers - meta: flush_handlers diff --git a/tasks/main.yml b/tasks/main.yml index cd1f556..06e7530 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,8 @@ --- # tasks file for keepalived -- name: Include installation tasks - ansible.builtin.include_tasks: +- name: Import installation tasks + ansible.builtin.import_tasks: file: installation.yml - name: Import configuration tasks diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..3f3c6cb --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,9 @@ +--- +# vars file for keepalived + +users: + - name: keepalived_script + comment: "Dedicated user for keepalived script" + update_password: on_create + password_lock: true + shell: /bin/bash