Initial commit
This commit is contained in:
commit
2a21752463
3 changed files with 111 additions and 0 deletions
53
playbook.yml
Normal file
53
playbook.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
- hosts: localhost
|
||||
tasks:
|
||||
- name: create required directories
|
||||
become: true
|
||||
file:
|
||||
path: '{{ item }}'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: sonny
|
||||
group: sonny
|
||||
loop:
|
||||
- '{{ app_dir }}'
|
||||
- '{{ data_dir }}'
|
||||
- '{{ postgres_dir }}'
|
||||
|
||||
- name: copy docker-compose file
|
||||
template:
|
||||
src: 'templates/docker-compose.j2'
|
||||
dest: '{{ app_dir }}/docker-compose.yml'
|
||||
|
||||
- name: stop forgejo
|
||||
command: docker compose --file docker-compose.yml down
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
- name: pull {{ image_tag }}
|
||||
command: docker compose --file docker-compose.yml pull
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
- name: start forgejo
|
||||
command: docker compose --file docker-compose.yml up --detach
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
vars:
|
||||
app_dir: '/srv/docker/forgejo'
|
||||
data_dir: '/home/sonny/vm/forgejo/data'
|
||||
postgres_dir: '/home/sonny/vm/forgejo/postgres'
|
||||
|
||||
image_tag: 'codeberg.org/forgejo/forgejo:9'
|
||||
|
||||
postgres_user: forgejo
|
||||
postgres_name: forgejo
|
||||
postgres_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
38616139663030376462383464343866313865653837386335646331313265373530653534663866
|
||||
3839613831616630363338366635303836353335353433630a376665366632663435633837376265
|
||||
62636164343965663866663530366561326136383937663439383033653935303238636463656364
|
||||
3439656234643262330a356264336637386465643234323832393233306539336162386239343538
|
||||
61363165363338653932336233346536646134313762396463666438663734643765303230356535
|
||||
63653963383433616563393339613665323335336537323965303630626566363762653830323933
|
||||
313334313532346261326436326563636235
|
||||
Reference in a new issue