initial
This commit is contained in:
commit
7820343da6
3
files/hugo.openrc
Normal file
3
files/hugo.openrc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command=/srv/hugo/generate.sh
|
6
files/webhook.openrc
Normal file
6
files/webhook.openrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
pidfile="/run/$RC_SVCNAME.pid"
|
||||||
|
command="/usr/bin/webhook"
|
||||||
|
command_args="-hooks /srv/hugo/hooks.json -verbose"
|
||||||
|
command_background="yes"
|
3
meta/main.yml
Normal file
3
meta/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: webserver
|
49
tasks/main.yml
Normal file
49
tasks/main.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
- name: install software
|
||||||
|
package: name={{ install_software }} state=present update_cache=yes
|
||||||
|
|
||||||
|
- name: generate ssh key
|
||||||
|
openssh_keypair:
|
||||||
|
path: "/root/.ssh/id_rsa"
|
||||||
|
type: rsa
|
||||||
|
size: 2048
|
||||||
|
state: present
|
||||||
|
force: no
|
||||||
|
|
||||||
|
- name: read ssh key
|
||||||
|
command: "cat /root/.ssh/id_rsa.pub"
|
||||||
|
register: key
|
||||||
|
|
||||||
|
- name: show ssh public key
|
||||||
|
debug:
|
||||||
|
msg: "{{ key.stdout }}"
|
||||||
|
|
||||||
|
- name: checkout site
|
||||||
|
git:
|
||||||
|
repo: https://git.br0tkasten.de/br0tkasten/www.br0tkasten.de.git
|
||||||
|
dest: /srv/hugo
|
||||||
|
version: master
|
||||||
|
|
||||||
|
- name: deploy hugo init script
|
||||||
|
copy:
|
||||||
|
src: hugo.openrc
|
||||||
|
dest: /etc/init.d/hugo
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: enable hugo service
|
||||||
|
service:
|
||||||
|
name: hugo
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: deploy webhook init script
|
||||||
|
copy:
|
||||||
|
src: webhook.openrc
|
||||||
|
dest: /etc/init.d/webhook
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: start & enable webhook
|
||||||
|
service:
|
||||||
|
name: webhook
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
5
vars/main.yml
Normal file
5
vars/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
install_software:
|
||||||
|
- git
|
||||||
|
- hugo
|
||||||
|
- webhook
|
Loading…
x
Reference in New Issue
Block a user