mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
add separate playbook for updating lemmy config
This commit is contained in:
parent
2775f7fadd
commit
0a970ae1da
2 changed files with 30 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
# local ansible configuration
|
||||
ansible/inventory
|
||||
ansible/passwords/
|
||||
ansible/lemmy-*.hjson
|
||||
|
||||
# docker build files
|
||||
docker/lemmy_mine.hjson
|
||||
|
|
29
ansible/update_config.yml
Normal file
29
ansible/update_config.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
tasks:
|
||||
- name: check if config file was already fetched from server before
|
||||
local_action: stat path='lemmy-{{domain}}.hjson'
|
||||
register: stat_local_config_file
|
||||
|
||||
- name: on first run, fetch lemmy config for local editing
|
||||
fetch:
|
||||
src: '{{lemmy_base_dir}}/lemmy.hjson'
|
||||
dest: 'lemmy-{{domain}}.hjson'
|
||||
flat: yes
|
||||
when: stat_local_config_file.stat.exists == False
|
||||
|
||||
- name: copy local lemmy config to server
|
||||
copy:
|
||||
src: 'lemmy-{{domain}}.hjson'
|
||||
dest: '{{lemmy_base_dir}}/lemmy.hjson'
|
||||
mode: '0600'
|
||||
owner: '1000'
|
||||
group: '1000'
|
||||
|
||||
|
||||
- name: restart lemmy to apply new config
|
||||
docker_compose:
|
||||
project_src: '{{lemmy_base_dir}}'
|
||||
state: present
|
||||
restarted: yes
|
Loading…
Reference in a new issue