You've already forked role_keepalived
feat: Create role
This commit is contained in:
37
tasks/configuration.yml
Normal file
37
tasks/configuration.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
# 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
|
7
tasks/installation.yml
Normal file
7
tasks/installation.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# tasks file for keepalived
|
||||
|
||||
- name: Install keepalived
|
||||
ansible.builtin.apt:
|
||||
name: keepalived
|
||||
become: true
|
10
tasks/main.yml
Normal file
10
tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# tasks file for keepalived
|
||||
|
||||
- name: Import installation tasks
|
||||
ansible.builtin.import_tasks:
|
||||
file: installation.yml
|
||||
|
||||
- name: Import configuration tasks
|
||||
ansible.builtin.import_tasks:
|
||||
file: configuration.yml
|
Reference in New Issue
Block a user