79 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
 | 
						|
 - name: Ensure directory permissions
 | 
						|
   become: yes
 | 
						|
   file:
 | 
						|
     state: directory
 | 
						|
     path: "{{ item }}"
 | 
						|
     owner: inspircd
 | 
						|
     group: ircd
 | 
						|
     mode: 0750
 | 
						|
   loop:
 | 
						|
     - "/var/log/inspircd"
 | 
						|
     - "/etc/inspircd"
 | 
						|
     - "/etc/inspircd/data/"
 | 
						|
 | 
						|
 - name: Generate dhparam
 | 
						|
   become: yes
 | 
						|
   command:
 | 
						|
     cmd: openssl dhparam -out /etc/inspircd/dhparams.pem 2048
 | 
						|
     creates: /etc/inspircd/dhparams.pem
 | 
						|
 | 
						|
 - name: Permissions on dhparam
 | 
						|
   become: yes
 | 
						|
   file:
 | 
						|
     state: file
 | 
						|
     path: /etc/inspircd/dhparams.pem
 | 
						|
     owner: inspircd
 | 
						|
     group: ircd
 | 
						|
     mode: 0640
 | 
						|
 | 
						|
 - name: Add inspircd user to ssl
 | 
						|
   become: yes
 | 
						|
   user:
 | 
						|
       name: inspircd
 | 
						|
       groups: ssl,ircd
 | 
						|
       append: yes
 | 
						|
 | 
						|
 - name: Copy config and fill in attributes
 | 
						|
   register: templatefiles
 | 
						|
   become: yes
 | 
						|
   template:
 | 
						|
     src: "inspircd/{{ item }}.j2"
 | 
						|
     dest: "/etc/inspircd/{{ item }}"
 | 
						|
     owner: inspircd
 | 
						|
     group: ircd
 | 
						|
     mode: 0600
 | 
						|
   loop:
 | 
						|
     - inspircd.conf
 | 
						|
     - modules.conf
 | 
						|
     - links.conf
 | 
						|
     - opers.conf
 | 
						|
     - rules.txt
 | 
						|
     - motd.txt
 | 
						|
 | 
						|
 - name: Ensure tracking files
 | 
						|
   become: yes
 | 
						|
   file:
 | 
						|
     dest: "/etc/inspircd/{{ item }}"
 | 
						|
     owner: inspircd
 | 
						|
     group: ircd
 | 
						|
     mode: 0600
 | 
						|
   loop:
 | 
						|
     - 'data/xline.db'
 | 
						|
     - 'data/permchannels.conf'
 | 
						|
 | 
						|
 - name: Ensure service running
 | 
						|
   become: yes
 | 
						|
   service:
 | 
						|
     name: inspircd
 | 
						|
     state: started
 | 
						|
     enabled: yes
 | 
						|
 | 
						|
 - name: Reload on config change
 | 
						|
   become: yes
 | 
						|
   when: templatefiles.changed
 | 
						|
   service:
 | 
						|
     name: inspircd
 | 
						|
     state: reloaded
 |