ngircd/tasks/main.yaml
changeset 113 d843011c249d
parent 48 4b18b1523ec2
--- a/ngircd/tasks/main.yaml	Fri Jul 03 12:01:00 2020 -0500
+++ b/ngircd/tasks/main.yaml	Sat Jul 04 11:00:20 2020 -0500
@@ -5,29 +5,11 @@
   apt: name="ngircd"
   notify: restart ngircd
 
-- name: config server name
-  become: yes
-  lineinfile:
-    path: "/etc/ngircd/ngircd.conf"
-    regexp: '^	Name ='
-    line: "	Name = {{ngircd_name}}"
-  notify: restart ngircd
-
-- name: config server local listen
+- name: configure ngircd
   become: yes
-  lineinfile:
-    path: "/etc/ngircd/ngircd.conf"
-    regexp: '^	Listen ='
-    line: "	Listen = 127.0.0.1"
-    insertafter: "^	;Listen ="
-  notify: restart ngircd
-
-- name: config motd
-  become: yes
-  lineinfile:
-    path: "/etc/ngircd/ngircd.conf"
-    regexp: '^	Info ='
-    line: "	Info = {{ngircd_motd}}"
+  template:
+    src: "ngircd.conf.j2"
+    dest: "/etc/ngircd/ngircd.conf"
   notify: restart ngircd
 
 - name: copy motd file
@@ -35,9 +17,8 @@
   copy:
     src: "{{ngircd_motd_src}}"
     dest: "/etc/ngircd/ngircd.motd"
-    mode: "0644"
   notify: restart ngircd
 
 - name: start ngircd service
   become: yes
-  systemd: name="ngircd" state="started" daemon_reload="yes"
+  systemd: name="ngircd" state="started" enabled="yes" daemon_reload="yes"