Deploy akaunting
This commit is contained in:
parent
8f870683e1
commit
6574ede7ac
|
@ -0,0 +1,2 @@
|
|||
.vagrant
|
||||
*.log
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- hosts: akaunting
|
||||
roles:
|
||||
- mariadb
|
||||
- nginx
|
||||
- php-fpm
|
||||
- akaunting
|
||||
|
||||
vars_files:
|
||||
- ../defaults/main.yml
|
17
README.md
17
README.md
|
@ -1,2 +1,17 @@
|
|||
# Akaunting
|
||||
# Akaunting - Ansible Role
|
||||
This role covers deployment, configuration and software updates of Akaunting. This role is released under MIT Licence and we give no warranty for this piece of software. Currently supported OS - Debian.
|
||||
|
||||
You can deploy test instance using `Vagrantfile` attached to the role.
|
||||
`vagrant up`
|
||||
|
||||
`ansible-playbook -b Playbooks/akaunting.yml`
|
||||
|
||||
Then you can access Akaunting from your computer on http://192.168.33.31
|
||||
|
||||
|
||||
## Playbook
|
||||
The playbook includes mariadb, php-fpm and nginx roles and deploys entire stack needed to run Akaunting. Additional roles are also available in the Ansible roles repos in git.
|
||||
|
||||
|
||||
## CHANGELOG
|
||||
- **07.04.2021** - Create the role
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure("2") do |config|
|
||||
#config.ssh.insert_key = false
|
||||
config.vm.define "akaunting" do |akaunting|
|
||||
akaunting.vm.box = "generic/debian10"
|
||||
akaunting.vm.provider :libvirt do |libvirt|
|
||||
libvirt.memory = 256
|
||||
end
|
||||
akaunting.vm.network "forwarded_port", guest: 80, host: 8888, host_ip: "192.168.33.31"
|
||||
akaunting.vm.network "forwarded_port", guest: 443, host: 4443, host_ip: "192.168.33.31"
|
||||
akaunting.vm.network "private_network", ip: "192.168.33.31"
|
||||
|
||||
end
|
||||
end
|
|
@ -0,0 +1,151 @@
|
|||
---
|
||||
|
||||
akaunting_user: 'www-data'
|
||||
akaunting_group: 'www-data'
|
||||
akaunting_app_dir: '/var/www/akaunting'
|
||||
akaunting_version: '2.1.9'
|
||||
|
||||
akaunting_db_driver: 'mysql'
|
||||
akaunting_db_name: 'akaunting'
|
||||
akaunting_db_host: 'localhost'
|
||||
akaunting_db_port: '3306'
|
||||
akaunting_db_user: 'admin'
|
||||
akaunting_db_passwd: 'changeme'
|
||||
|
||||
akaunting_pkgs: '{{ php_pkgs }}'
|
||||
|
||||
#PHP Vars
|
||||
php_version: '7.3'
|
||||
php_etc_path: '/etc/php'
|
||||
install_php: 'true'
|
||||
pool_listen: '/var/run/php/php{{ php_version }}-fpm.sock'
|
||||
|
||||
php_pkgs:
|
||||
- php{{ php_version }}-common
|
||||
- php{{ php_version }}-bcmath
|
||||
- php{{ php_version }}-json
|
||||
- php{{ php_version }}-mbstring
|
||||
- php{{ php_version }}-tokenizer
|
||||
- php{{ php_version }}-xml
|
||||
- php{{ php_version }}-zip
|
||||
- openssl
|
||||
- php{{ php_version }}-fpm # mandatory?
|
||||
- php{{ php_version }}-mysql
|
||||
- php{{ php_version }}-imagick
|
||||
- php{{ php_version }}-gd
|
||||
- php{{ php_version }}-curl
|
||||
- php{{ php_version }}-bz2
|
||||
- php{{ php_version }}-intl
|
||||
- unzip
|
||||
|
||||
#nginx
|
||||
nginx_default_vhost: 'akaunting'
|
||||
nginx_default_vhost_ssl: 'akaunting'
|
||||
nginx_www_dir: '/var/www/'
|
||||
nginx_vhosts:
|
||||
|
||||
- name: 'akaunting'
|
||||
template: 'akaunting'
|
||||
proto: 'http'
|
||||
listen: '80'
|
||||
root: 'akaunting'
|
||||
index: 'index.php'
|
||||
use_access_log: 'true'
|
||||
use_error_log: 'true'
|
||||
nginx_error_log_level: 'warn'
|
||||
upstream_params:
|
||||
- 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'
|
||||
- 'fastcgi_index index.php;'
|
||||
- 'include /etc/nginx/fastcgi_params;'
|
||||
- 'fastcgi_pass unix:{{ pool_listen }};'
|
||||
state: 'enable'
|
||||
letsencrypt: 'false'
|
||||
|
||||
# MARIADB
|
||||
# MARIADB CONFIG
|
||||
mariadb_root_password: 'changeme'
|
||||
mariadb_default_config:
|
||||
- name: 'client'
|
||||
config:
|
||||
- port = {{mariadb_client_port}}
|
||||
- socket = /var/run/mysqld/mysqld.sock
|
||||
- default-character-set = utf8mb4
|
||||
- name: 'mysqld_safe'
|
||||
config:
|
||||
- safe_socket = /var/run/mysqld/mysqld.sock
|
||||
- safe_nice = 0
|
||||
- name: 'mysqld'
|
||||
config:
|
||||
- user = mysql
|
||||
- pid_file = /var/run/mysqld/mysqld.pid
|
||||
- socket = /var/run/mysqld/mysqld.sock
|
||||
- port = 3306
|
||||
- basedir = /usr
|
||||
- datadir = "{{mariadb_datadir}}"
|
||||
- tmpdir = /tmp
|
||||
- init_connect ='SET collation_connection = utf8mb4_unicode_ci'
|
||||
- init_connect ='SET NAMES utf8mb4'
|
||||
- character-set-server = utf8mb4
|
||||
- collation-server = utf8mb4_unicode_ci
|
||||
- skip_external_locking = True
|
||||
- bind_address = {{ akaunting_db_host }}
|
||||
- key_buffer = 16M
|
||||
- max_allowed_packet = 16M
|
||||
- thread_stack = 192K
|
||||
- thread_cache_size = 16
|
||||
- myisam_recover = BACKUP
|
||||
- max_connections = 1000
|
||||
- query_cache_limit = 1M
|
||||
- query_cache_size = 16M
|
||||
- general_log_file = /var/log/mysql/mysql.log
|
||||
- general_log = 0
|
||||
- slow_query_log = 1
|
||||
- slow_query_log_file = /var/log/mysql/mysql-slow.log
|
||||
- long_query_time = 1
|
||||
- log_queries_not_using_indexes = False
|
||||
- default_storage_engine = InnoDB
|
||||
- innodb_buffer_pool_size = 1024M
|
||||
- innodb_log_file_size = 128M
|
||||
- innodb_log_buffer_size = 8M
|
||||
- innodb_thread_concurrency = 64
|
||||
- innodb_read_io_threads = 16
|
||||
- innodb_write_io_threads = 16
|
||||
- innodb_file_per_table = 1
|
||||
- innodb_open_files = 400
|
||||
- innodb_io_capacity = 600
|
||||
- innodb_lock_wait_timeout = 60
|
||||
- innodb_flush_method = O_DIRECT
|
||||
- innodb_doublewrite = 0
|
||||
- innodb_use_native_aio = 0
|
||||
- innodb_large_prefix = on
|
||||
- server_id = 1
|
||||
- log_bin = /var/log/mysql/mysql-bin.log
|
||||
- expire_logs_days = 2
|
||||
- max_binlog_size = 10M
|
||||
- binlog_format = row
|
||||
- query_cache_type = 1
|
||||
- query_cache_limit = 256K
|
||||
- query_cache_min_res_unit = 2k
|
||||
- query_cache_size = 300M
|
||||
- tmp_table_size= 64M
|
||||
- max_heap_table_size= 64M
|
||||
|
||||
- name: 'mysqldump'
|
||||
config:
|
||||
- quick
|
||||
#- quotes-names
|
||||
- max_allowed_packet = 16M
|
||||
- name: 'isamchk'
|
||||
config:
|
||||
- key_buffer = 16M
|
||||
|
||||
mariadb_databases:
|
||||
- name: '{{ akaunting_db_name }}'
|
||||
collation: 'utf8mb4_unicode_ci'
|
||||
encoding: 'utf8mb4'
|
||||
|
||||
mariadb_users:
|
||||
- name: '{{ akaunting_db_user }}'
|
||||
host: '{{ akaunting_db_host }}'
|
||||
password: '{{ akaunting_db_passwd }}'
|
||||
priv: '{{ akaunting_db_name }}.*:ALL'
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
|
||||
- name: '[Install] - Create app dir'
|
||||
file:
|
||||
path: '{{ akaunting_app_dir }}/{{ akaunting_version }}'
|
||||
state: 'directory'
|
||||
owner: '{{ akaunting_user }}'
|
||||
group: '{{ akaunting_group }}'
|
||||
|
||||
- name: '[Install] - Check if the app is already installed'
|
||||
stat:
|
||||
path: '{{ akaunting_app_dir }}/{{ akaunting_version }}/akaunting'
|
||||
register: akaunting_installed
|
||||
|
||||
- name: '[Install] - Download akaunting release'
|
||||
unarchive:
|
||||
src: 'https://github.com/akaunting/akaunting/releases/download/{{ akaunting_version }}/Akaunting_{{ akaunting_version }}-Stable.zip'
|
||||
dest: '{{ akaunting_app_dir }}'
|
||||
owner: '{{ akaunting_user }}'
|
||||
group: '{{ akaunting_group }}'
|
||||
remote_src: yes
|
||||
when: akaunting_installed.stat.exists == false
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
|
||||
- name: '[Deps] - Install Dependencies'
|
||||
apt:
|
||||
name: '{{ akaunting_pkgs }}'
|
||||
update_cache: yes
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
|
||||
- name: Include install deps
|
||||
include: installdeps.yml
|
||||
|
||||
- name: Include install app
|
||||
include: installapp.yml
|
Loading…
Reference in New Issue