ansible/playbooks/apps/ghost-config.yaml

81 lines
4.4 KiB
YAML
Raw Normal View History

2024-10-12 12:30:02 +02:00
---
- name: Ghost config
hosts: servers
gather_facts: false
tasks:
- name: Write config files
ansible.builtin.template:
src: templates/ghost-config/{{ item.filename }}
dest: /mnt/data/{{ item.site }}/config.production.json
mode: "0664"
notify:
- Restart service
loop_control:
label: "{{ item.site }}"
loop:
- filename: gabnotes-org-config.json.j2
site: gabnotes.org
db_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
66306233626430393737653333313461666665363936376465623137656561356431373666363032
6537313234336331626464336434343462623264633463330a353165396163653666636333633537
33353464393836623861633238663336336465326435613638613734613433386537663635666332
6338343039393737310a356335666632303062353336613364323165633239323032346239376262
32323862393264326162383761653163353731363331326337633461643364373936
mail_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
61313164316335333431656136326636353535643363623665326565303961356234353362646261
3339616561643434376163613962366631303863313263310a323330316230333864636232386632
36363966303861396161373031343865323639383634323131633761666137663766353165333265
3630333962383338650a326166383635636533656363613865323065396537396664663132303766
62346530353634383935303031343737326335326361313765393664613236356364313161373834
35396435303337643330393266376139616164613730643037303039633337343262303335616366
373032363533393263323835363666623966
- filename: voyages-coccomagnard-fr-config.json.j2
site: voyages.coccomagnard.fr
db_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33623632396330303536366136313438623138366231333063613539303538303761386264623239
3266366633343936356564636131303939636330336335390a313430346536666239656562393238
32373533373663656435306239643638313937623631366262393462306138323061333961363938
3239373062613138660a393933393436633166303837303263356232336666386336346366373934
38346330616639646666616161613865643461643965333237353936663933336533
mail_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33386530613164633962393133316231613664623761336237353335336430313637356430306430
3837373934336361636461343338643737653839396336340a633130613038666534653865303338
64343366663330653737653638326263383836343762386332346339366465363966346432333631
6665396333303462620a636335663266316566636536613630313336636463646430333935373965
62653636613263303066333833623637653532663939656339376636356261666235656562336661
36376233386235393164363064373733623330306362343039623465303134313434366433383863
656136646536333065616631336235623430
- filename: voyages-lois-augendre-info-config.json.j2
site: voyages-lois.augendre.info
db_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30623130336131633738353931653239623133326265363862353530303232633333383462663330
3935333936383663326162653864623630396363666131390a393532336531663262616431396165
33303236363739636665616636326262336532623234666263363563633962343734613565373031
3139313038663432370a623363366436643862343734393334306162376634366637616536303035
32653739373732613930376336636332343333643436633261616561633034623566
mail_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
35353737376566653462393530613034353763643166626432613836663638636562303762343133
6132313762353565646531613336663336313765623430310a616438613433333632343933373330
62356661626437306265313061636634613263613633353433653330653862633639376462353637
3739313432356262330a626432386536663638646539323861356564616436386464366333303564
35303230623365636362323733623531343335376361313430373936663836353132643834643664
6163326436323961636462616430366364626532323861656436
register: config_files
handlers:
- name: Restart service
ansible.builtin.command:
cmd: ghost restart
chdir: /mnt/data/{{ item.item.site }}
when: item.changed
changed_when: true
loop: "{{ config_files.results }}"
loop_control:
label: "{{ item.item.site }}"