[INFO] Création du rôle
This commit is contained in:
24
templates/hugo.service.j2
Normal file
24
templates/hugo.service.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=HuGO project {{ hugo_base_url }}
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
ConditionFileNotEmpty={{ hugo_data_path }}/config.yaml
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory={{ hugo_data_path }}
|
||||
{% if hugo_nginx_enabled %}
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/hugo --cleanDestinationDir --baseURL {{ hugo_base_url }}
|
||||
ExecStartPost=/usr/bin/rsync --delete-after --recursive --partial {{ hugo_data_path }}/public/ {{ hugo_nginx_docroot }}/
|
||||
{% else %}
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/hugo server --cleanDestinationDir --appendPort=false --bind={{ hugo_server_listen }} --port={{ hugo_server_port }} --baseURL={{ hugo_base_url }}
|
||||
Restart=always
|
||||
RestartSec=2s
|
||||
{% endif %}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
12
templates/hugo.timer.j2
Normal file
12
templates/hugo.timer.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=HuGO to reload {{ hugo_base_url }}
|
||||
ConditionFileNotEmpty={{ hugo_data_path }}/config.yaml
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user