Explorar o código

update linode role for new fedora versions

Blaine Story hai 4 días
pai
achega
bda404fae3
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      roles/linode/tasks/main.yml

+ 17 - 0
roles/linode/tasks/main.yml

@@ -30,6 +30,21 @@
   when:
     - ansible_os_family == 'Fedora'
 
+- name: Check for systemd-oomd conf file
+  ansible.builtin.stat:
+    path: /etc/systemd/oomd.conf
+  register: oomd_conf
+
+
+- name: Create copy of oomd.conf
+  ansible.builtin.copy:
+    src: /usr/lib/systemd/oomd.conf
+    dest: /etc/systemd/oomd.conf
+    remote_src: yes
+  when:
+    - oomd_conf.stat.exists == False
+
+
 - name: Loosen up systemd-oomd defaults
   lineinfile:
     path: /etc/systemd/oomd.conf
@@ -37,11 +52,13 @@
     insertafter: '^#DefaultMemoryPressureLimit='
     line: DefaultMemoryPressureLimit=80%
 
+
 - name: Install fail2ban
   package:
     name: fail2ban
     state: present
 
+
 - name: Configure fail2ban
   template:
     src: ssh.local.j2