From b0731b4390062504f049f0d1ce44cdff2d919dd9 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 15 Jul 2021 10:50:13 -0400 Subject: [PATCH] make config and solanum seperate playbooks --- config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ solanum.yml | 43 ------------------------------------------- 2 files changed, 46 insertions(+), 43 deletions(-) create mode 100644 config.yml diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..9832cba --- /dev/null +++ b/config.yml @@ -0,0 +1,46 @@ +- hosts: vulpineawoo + remote_user: root + + tasks: + - name: check for ssl cert + stat: + path: /home/ircd/ircd/etc/ssl.pem + register: ssl_exists + + - name: get ssl fingerprint + command: /home/ircd/ircd/bin/solanum-mkfingerprint sha512 /home/ircd/ircd/etc/ssl.pem + register: ssl_fingerprint + when: ssl_exists.stat.exists + + - name: create ircd.conf + template: + src: ircd.j2 + dest: /home/ircd/ircd/etc/ircd.conf + + - name: create ircd.motd + template: + src: motd.j2 + dest: /home/ircd/ircd/etc/ircd.motd + + - name: create openrc service + template: + src: openrc.j2 + dest: /etc/init.d/solanum + mode: 0755 + when: ansible_distribution == 'Alpine' + + - name: create systemd service + template: + src: systemd.j2 + dest: /etc/systemd/system/solnum.service + mode: 0755 + when: ansible_distribution == 'Debian' + + - name: enable service + service: + name: solanum + state: started + enabled: yes + + - name: reload solanum + command: killall -1 solanum diff --git a/solanum.yml b/solanum.yml index 669441c..d762826 100644 --- a/solanum.yml +++ b/solanum.yml @@ -59,46 +59,3 @@ become: yes become_user: ircd - - name: check for ssl cert - stat: - path: /home/ircd/ircd/etc/ssl.pem - register: ssl_exists - - - name: get ssl fingerprint - command: /home/ircd/ircd/bin/solanum-mkfingerprint sha512 /home/ircd/ircd/etc/ssl.pem - register: ssl_fingerprint - when: ssl_exists.stat.exists - - - name: create ircd.conf - template: - src: ircd.j2 - dest: /home/ircd/ircd/etc/ircd.conf - - - name: create ircd.motd - template: - src: motd.j2 - dest: /home/ircd/ircd/etc/ircd.motd - - - name: create openrc service - template: - src: openrc.j2 - dest: /etc/init.d/solanum - mode: 0755 - when: ansible_distribution == 'Alpine' - - - name: create systemd service - template: - src: systemd.j2 - dest: /etc/systemd/system/solnum.service - mode: 0755 - when: ansible_distribution == 'Debian' - - - name: enable service - service: - name: solanum - state: started - enabled: yes - - - name: reload solanum - command: killall -1 solanum -