feature: initial commit
Install Firefly III without importer.
This commit is contained in:
commit
5ee23c3a7e
10
.ansible-lint
Normal file
10
.ansible-lint
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- ./molecule
|
||||
- ./.travis.yml
|
||||
- ./.github
|
||||
parseable: true
|
||||
skip_list:
|
||||
- '204'
|
||||
use_default_rules: true
|
||||
verbosity: 1
|
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.yml linguist-detectable=true
|
||||
*.yaml linguist-detectable=true
|
||||
*.html linguist-detectable=false
|
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
github: equinoxel
|
||||
patreon: laurivan
|
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:**
|
||||
[What you expect to happen]
|
||||
|
||||
**Actual behavior:**
|
||||
[What actually happens]
|
||||
|
||||
**Reproduces how often:**
|
||||
[What percentage of the time does it reproduce?]
|
||||
|
||||
### Environment
|
||||
|
||||
- The release version/s you are using:
|
||||
- OS:
|
||||
- Ansible Version:
|
||||
- Python Version:
|
||||
- Others:
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data that might be necessary to reproduce the issue.]
|
3
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
3
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
blank_issues_enabled: false
|
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Why is this needed?
|
||||
|
||||
[A clear and concise description of why do you think this is needed]
|
||||
|
||||
### Additional Information
|
||||
|
||||
[Any additional information, configuration or data.]
|
27
.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/refactor.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Refactor
|
||||
about: Found anything to refactor in this project?
|
||||
title: "[REFACTOR]"
|
||||
labels: clean-up
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Link/s to the specific code that needs a refactor (if applicable)
|
||||
|
||||
[Links]
|
27
.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/support_request.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Support Request
|
||||
about: Support request or question about this project
|
||||
title: "[SUPPORT]"
|
||||
labels: question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
PREREQUISITES
|
||||
|
||||
Have you read Idealista's Code of Conduct? By filling an Issue, you are expected to comply with it,
|
||||
including treating everyone with respect: https://github.com/idealista/idealista/blob/master/CODE_OF_CONDUCT.md
|
||||
|
||||
Check that your issue isn't already filled: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aidealista
|
||||
|
||||
Check that there is not already provided the described functionality
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
[Description of the issue]
|
||||
|
||||
### Additional Information
|
||||
|
||||
Any additional information, configuration or data that might be necessary to reproduce the issue.
|
33
.github/stale.yml
vendored
Normal file
33
.github/stale.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
issues:
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 90
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- "pinned"
|
||||
- "security"
|
||||
- "good first issue"
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
|
||||
pulls:
|
||||
# Number of days of inactivity before a pull request becomes stale
|
||||
daysUntilStale: 90
|
||||
# Number of days of inactivity before a stale pull request is closed
|
||||
daysUntilClose: 7
|
||||
# Comment to post when marking a pull request as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale pull request. Set to `false` to disable
|
||||
closeComment: false
|
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
tests/playbook.retry
|
||||
tests/.cache
|
||||
__pycache__
|
||||
.pytest_cache
|
||||
.molecule
|
||||
.cache
|
||||
.venv
|
||||
|
||||
*.iml
|
||||
.idea
|
||||
.project
|
||||
|
||||
*.pyc
|
||||
**/.vscode
|
25
.travis.yml
Normal file
25
.travis.yml
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.9"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- pip install -I pipenv
|
||||
- pipenv sync
|
||||
env:
|
||||
jobs:
|
||||
- MOLECULE_DISTRO=debian:buster-slim
|
||||
- MOLECULE_DISTRO=debian:bullseye-slim
|
||||
script:
|
||||
- pipenv run molecule test --all
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
email:
|
||||
if: branch = main
|
||||
on_success: change
|
||||
on_failure: always
|
||||
recipients:
|
||||
- laur.ivan@gmail.com
|
33
.yamllint
Normal file
33
.yamllint
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
# Based on ansible-lint config
|
||||
extends: default
|
||||
|
||||
ignore: |
|
||||
molecule/**/tests/
|
||||
.venv
|
||||
.github
|
||||
.travis.yml
|
||||
|
||||
rules:
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
brackets:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
colons:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
commas:
|
||||
max-spaces-after: -1
|
||||
level: error
|
||||
empty-lines:
|
||||
max: 3
|
||||
level: error
|
||||
hyphens:
|
||||
level: error
|
||||
key-duplicates: enable
|
||||
line-length: disable
|
||||
new-lines:
|
||||
type: unix
|
||||
truthy: disable
|
18
CHANGELOG.md
Normal file
18
CHANGELOG.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||
|
||||
## [Unreleased](https://github.com/equinoxel/ansible-role-firefly/tree/develop)
|
||||
### Changed
|
||||
### Added
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
## [X.Y.Z](https://github.com/equinoxel/ansible-role-firefly/tree/X.Y.Z)
|
||||
### [Full Changelog](https://github.com/equinoxel/ansible-role-firefly/compare/1.0.0...X.Y.Z)
|
||||
### Changed
|
||||
*[#<issue_number>](https://github.com/equinoxel/ansible-role-firefly/issues/<issue_number>) \<Change description\>* @\<author\>
|
||||
|
||||
## [1.0.0](https://github.com/equinoxel/ansible-role-firefly/tree/1.0.0)
|
||||
- Initial release
|
10
LICENSE
Normal file
10
LICENSE
Normal file
@ -0,0 +1,10 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © 2023 Laur IVAN
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
47
README.md
Normal file
47
README.md
Normal file
@ -0,0 +1,47 @@
|
||||
# Firefly Ansible role
|
||||
|
||||
This role installs Firefly via Docker compose.
|
||||
|
||||
## Requirements
|
||||
|
||||
None
|
||||
|
||||
## Role Variables
|
||||
|
||||
All variables are listed below (see also `defaults/main.yml`).
|
||||
|
||||
```yml
|
||||
---
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
You need a machine with docker and docker-compose installed.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
```yml
|
||||
- hosts: servers
|
||||
roles:
|
||||
- 'laurivan.Firefly'
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT](https://opensource.org/licenses/MIT) license - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||
![MIT License](https://img.shields.io/badge/license-MIT%20License-brightgreen)
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2023 by [Laur Ivan](https://www.laurivan.com).
|
||||
|
||||
## Built With
|
||||
|
||||
![Ansible](https://img.shields.io/badge/ansible-5.2.0-green.svg)
|
||||
![Molecule](https://img.shields.io/badge/molecule-3.4.0-green.svg)
|
||||
![Goss](https://img.shields.io/badge/goss-0.3.16-green.svg)
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
43
defaults/main.yml
Normal file
43
defaults/main.yml
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
|
||||
## General
|
||||
firefly_image: firefly:latest
|
||||
|
||||
firefly_http_port_app: 30000
|
||||
firefly_http_port_importer: 30001
|
||||
|
||||
firefly_timezone: "Europe/Brussels"
|
||||
|
||||
# Map coordinates
|
||||
firefly_map_lat: 51.983333
|
||||
firefly_map_long: 5.916667
|
||||
firefly_map_zoom: 6
|
||||
|
||||
# App key must be 32 chars long
|
||||
firefly_app_key: "12345678901234567890123456789012"
|
||||
firefly_owner_email: "user@domain.com"
|
||||
|
||||
firefly_db_password: "changeme"
|
||||
|
||||
firefly_app_name: "Firefly III"
|
||||
# Cronjob token, must be 32 chars long
|
||||
firefly_static_cron_token: "12345678901234567890123456789012"
|
||||
|
||||
# Firefly paths
|
||||
firefly_root_path: /var/local
|
||||
firefly_data_base: "{{ firefly_root_path }}/firefly"
|
||||
firefly_config_path: "{{ firefly_root_path }}/conf/firefly"
|
||||
|
||||
# Add other paths here to make sure they're created automatically
|
||||
#
|
||||
firefly_skeleton_paths:
|
||||
- "{{ firefly_config_path }}"
|
||||
|
||||
# Add more templates to be copied into the config
|
||||
firefly_configuration_files:
|
||||
- "docker-compose.yml"
|
||||
- "env.firefly.conf"
|
||||
- "env.db.conf"
|
||||
|
||||
# Documentation
|
||||
firefly_documentation_link: "https://www.laurivan.com"
|
2
handlers/main.yml
Normal file
2
handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# Handlers for firefly
|
26
meta/main.yml
Normal file
26
meta/main.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
|
||||
galaxy_info:
|
||||
author: Laur Ivan (laur.ivan@gmail.com)
|
||||
namespace: laurivan
|
||||
company: "N/A"
|
||||
role_name: firefly
|
||||
description: Firefly Role
|
||||
min_ansible_version: "2.4"
|
||||
min_ansible_container_version: "2.4"
|
||||
license: MIT
|
||||
galaxy_tags:
|
||||
- firefly
|
||||
- finance
|
||||
- manager
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- bullseye
|
||||
- buster
|
||||
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- bionic
|
||||
- focal
|
||||
- jammy
|
23
molecule/default/cleanup.yml
Normal file
23
molecule/default/cleanup.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Clean up
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: Check if the docker-compose file exists.
|
||||
ansible.builtin.stat:
|
||||
path: "{{ firefly_config_path | expanduser | realpath }}/docker-compose.yml"
|
||||
register: docker_compose_file
|
||||
|
||||
- name: Remove docker-compose.
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ firefly_config_path | expanduser | realpath }}/"
|
||||
build: false
|
||||
state: absent
|
||||
when: docker_compose_file.stat.exists
|
||||
become: false
|
||||
|
||||
- name: Remove the docker-compose file
|
||||
ansible.builtin.file:
|
||||
path: "{{ firefly_config_path | expanduser | realpath }}/docker-compose.yml"
|
||||
state: absent
|
||||
when: docker_compose_file.stat.exists
|
5
molecule/default/converge.yml
Normal file
5
molecule/default/converge.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: firefly_group
|
||||
roles:
|
||||
- role: "laurivan.firefly"
|
27
molecule/default/destroy.yml
Normal file
27
molecule/default/destroy.yml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Destroy
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
no_log: "{{ molecule_no_log }}"
|
||||
tasks:
|
||||
# Developer must implement.
|
||||
- name: Remove the docker image
|
||||
community.docker.docker_container:
|
||||
name: firefly
|
||||
state: absent
|
||||
|
||||
# Mandatory configuration for Molecule to function.
|
||||
|
||||
- name: Populate instance config
|
||||
ansible.builtin.set_fact:
|
||||
instance_conf: {}
|
||||
|
||||
- name: Dump instance config
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
# Molecule managed
|
||||
{{ instance_conf | to_json | from_json | to_yaml }}
|
||||
dest: "{{ molecule_instance_config }}"
|
||||
mode: 0600
|
||||
when: server.changed | default(false) | bool
|
37
molecule/default/molecule.yml
Normal file
37
molecule/default/molecule.yml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
ignore-certs: true
|
||||
ignore-errors: true
|
||||
role-file: molecule/requirements.yml
|
||||
requirements-file: molecule/requirements.yml
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
yamllint .
|
||||
ansible-lint .
|
||||
platforms:
|
||||
- name: firefly
|
||||
groups:
|
||||
- firefly_group
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
capabilities:
|
||||
- SYS_ADMIN
|
||||
tmpfs:
|
||||
- /tmp
|
||||
- /run
|
||||
- /run/lock
|
||||
volumes:
|
||||
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
|
||||
- '/var/run/docker.sock:/tmp/docker_mounted.sock'
|
||||
command: '/lib/systemd/systemd'
|
||||
stop_signal: 'RTMIN+3'
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
||||
verifier:
|
||||
name: ansible
|
38
molecule/default/prepare.yml
Normal file
38
molecule/default/prepare.yml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: Setup the test machine
|
||||
hosts: firefly
|
||||
tasks:
|
||||
- name: Check if /var/run/docker.sock already exists
|
||||
ansible.builtin.stat:
|
||||
path: "/var/run/docker.sock"
|
||||
register: docker_sock_stat
|
||||
|
||||
- name: Create docker.sock
|
||||
ansible.builtin.raw: touch /var/run/docker.sock
|
||||
become: true
|
||||
changed_when: false
|
||||
when: not docker_sock_stat.stat.exists
|
||||
|
||||
- name: Move docker.sock from tmp
|
||||
ansible.builtin.raw: >
|
||||
mount --move /tmp/docker_mounted.sock /var/run/docker.sock
|
||||
become: true
|
||||
changed_when: false
|
||||
when: not docker_sock_stat.stat.exists
|
||||
|
||||
- name: Update apt cache.
|
||||
ansible.builtin.apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Install python requests
|
||||
ansible.builtin.pip:
|
||||
name:
|
||||
- requests
|
||||
- docker
|
||||
- docker-compose
|
||||
|
||||
- name: Install docker
|
||||
vars:
|
||||
docker_service_manage: false
|
||||
ansible.builtin.include_role:
|
||||
name: geerlingguy.docker
|
4
molecule/default/requirements.yml
Normal file
4
molecule/default/requirements.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
roles:
|
||||
- geerlingguy.docker
|
||||
collections: []
|
12
molecule/default/tests/test_app.yml
Normal file
12
molecule/default/tests/test_app.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
## TODO: Remember to adapt goss tests to your convenience
|
||||
|
||||
|
||||
## Check if ports are really exposed
|
||||
# port:
|
||||
# # Check port at IPv6
|
||||
# # https://github.com/aelsabbahy/goss/issues/177
|
||||
# tcp6:<port>:
|
||||
# listening: true
|
||||
# ip:
|
||||
# - '::'
|
59
molecule/default/verify.yml
Normal file
59
molecule/default/verify.yml
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
# This is an example playbook to execute goss tests.
|
||||
# Tests need distributed to the appropriate ansible host/groups
|
||||
# prior to execution by `goss validate`.
|
||||
|
||||
- name: Verify firefly
|
||||
hosts:
|
||||
- firefly
|
||||
become: true
|
||||
vars:
|
||||
goss_version: v0.3.16
|
||||
goss_arch: amd64
|
||||
goss_dst: /usr/local/bin/goss
|
||||
goss_sha256sum: 827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb
|
||||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
|
||||
goss_test_directory: /tmp
|
||||
goss_format: documentation
|
||||
|
||||
vars_files:
|
||||
- ../../defaults/main.yml
|
||||
|
||||
tasks:
|
||||
- name: Download and install Goss
|
||||
get_url:
|
||||
url: "{{ goss_url }}"
|
||||
dest: "{{ goss_dst }}"
|
||||
checksum: "sha256:{{ goss_sha256sum }}"
|
||||
mode: 0755
|
||||
register: download_goss
|
||||
until: download_goss is succeeded
|
||||
retries: 3
|
||||
|
||||
- name: Copy Goss tests to remote
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ goss_test_directory }}/{{ item | basename }}"
|
||||
with_fileglob:
|
||||
- "tests/test_*.yml"
|
||||
|
||||
- name: Register test files
|
||||
shell: "ls {{ goss_test_directory }}/test_*.yml"
|
||||
register: test_files
|
||||
|
||||
- name: Execute Goss tests
|
||||
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}"
|
||||
register: test_results
|
||||
with_items: "{{ test_files.stdout_lines }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Display details about the Goss results
|
||||
debug:
|
||||
msg: "{{ item.stdout_lines }}"
|
||||
with_items: "{{ test_results.results }}"
|
||||
|
||||
- name: Fail when tests fail
|
||||
fail:
|
||||
msg: "Goss failed to validate"
|
||||
when: item.rc != 0
|
||||
with_items: "{{ test_results.results }}"
|
23
tasks/config.yml
Normal file
23
tasks/config.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: "FIREFLY | Set up directories"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ item }}"
|
||||
owner: "{{ ansible_effective_user_id }}"
|
||||
group: "{{ ansible_effective_group_id }}"
|
||||
mode: "0750"
|
||||
with_items:
|
||||
- "{{ firefly_skeleton_paths }}"
|
||||
tags:
|
||||
- firefly_configure
|
||||
become: true
|
||||
|
||||
- name: "FIREFLY | Write configuration files"
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ firefly_config_path | expanduser | realpath }}/{{ item }}"
|
||||
mode: '0640'
|
||||
with_items:
|
||||
- "{{ firefly_configuration_files }}"
|
||||
tags:
|
||||
- firefly_configure
|
7
tasks/install.yml
Normal file
7
tasks/install.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: "FIREFLY | Ensure firefly is running"
|
||||
community.docker.docker_compose:
|
||||
project_src: "{{ firefly_config_path | expanduser | realpath }}"
|
||||
build: false
|
||||
tags:
|
||||
- firefly_install
|
11
tasks/main.yml
Normal file
11
tasks/main.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: "FIREFLY | Configure"
|
||||
ansible.builtin.import_tasks: config.yml
|
||||
tags:
|
||||
- firefly_configure
|
||||
|
||||
- name: "FIREFLY | Install"
|
||||
ansible.builtin.import_tasks: install.yml
|
||||
tags:
|
||||
- firefly_install
|
42
templates/docker-compose.yml.j2
Normal file
42
templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,42 @@
|
||||
# firefly docker compose
|
||||
version: '3.9'
|
||||
services:
|
||||
app:
|
||||
image: fireflyiii/core:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- firefly_iii_upload:/var/www/html/storage/upload
|
||||
env_file: env.firefly.conf
|
||||
networks:
|
||||
- firefly_iii
|
||||
ports:
|
||||
- "{{ firefly_http_port_app }}:8080"
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: mariadb
|
||||
hostname: fireflyiiidb
|
||||
restart: always
|
||||
env_file: env.db.conf
|
||||
networks:
|
||||
- firefly_iii
|
||||
volumes:
|
||||
- firefly_iii_db:/var/lib/mysql
|
||||
|
||||
cron:
|
||||
#
|
||||
# To make this work, set STATIC_CRON_TOKEN in your .env file or as an environment variable and replace REPLACEME below
|
||||
# The STATIC_CRON_TOKEN must be *exactly* 32 characters long
|
||||
#
|
||||
image: alpine
|
||||
command: sh -c "echo \"0 3 * * * wget -qO- http://app:8080/api/v1/cron/{{ firefly_static_cron_token }}\" | crontab - && crond -f -L /dev/stdout"
|
||||
networks:
|
||||
- firefly_iii
|
||||
|
||||
volumes:
|
||||
firefly_iii_upload:
|
||||
firefly_iii_db:
|
||||
|
||||
networks:
|
||||
firefly_iii:
|
||||
driver: bridge
|
4
templates/env.db.conf.j2
Normal file
4
templates/env.db.conf.j2
Normal file
@ -0,0 +1,4 @@
|
||||
MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||
MYSQL_USER=firefly
|
||||
MYSQL_PASSWORD={{ firefly_db_password }}
|
||||
MYSQL_DATABASE=firefly
|
316
templates/env.firefly.conf.j2
Normal file
316
templates/env.firefly.conf.j2
Normal file
@ -0,0 +1,316 @@
|
||||
# You can leave this on "local". If you change it to production most console commands will ask for extra confirmation.
|
||||
# Never set it to "testing".
|
||||
APP_ENV=local
|
||||
|
||||
# Set to true if you want to see debug information in error screens.
|
||||
APP_DEBUG=false
|
||||
|
||||
# This should be your email address.
|
||||
# If you use Docker or similar, you can set this variable from a file by using SITE_OWNER_FILE
|
||||
# The variable is used in some errors shown to users who aren't admin.
|
||||
SITE_OWNER={{ firefly_owner_email }}
|
||||
|
||||
# The encryption key for your sessions. Keep this very secure.
|
||||
# Change it to a string of exactly 32 chars or use something like `php artisan key:generate` to generate it.
|
||||
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
|
||||
#
|
||||
# Avoid the "#" character in your APP_KEY, it may break things.
|
||||
#
|
||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
|
||||
# Firefly III will launch using this language (for new users and unauthenticated visitors)
|
||||
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang
|
||||
#
|
||||
# If text is still in English, remember that not everything may have been translated.
|
||||
DEFAULT_LANGUAGE=en_US
|
||||
|
||||
# The locale defines how numbers are formatted.
|
||||
# by default this value is the same as whatever the language is.
|
||||
DEFAULT_LOCALE=equal
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
# For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
TZ=Europe/Amsterdam
|
||||
|
||||
# TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
|
||||
# Set it to ** and reverse proxies work just fine.
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
# The log channel defines where your log entries go to.
|
||||
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
|
||||
# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
|
||||
# A rotating log option is 'daily', creates 5 files that (surprise) rotate.
|
||||
# A cool option is 'papertrail' for cloud logging
|
||||
# Default setting 'stack' will log to 'daily' and to 'stdout' at the same time.
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
#
|
||||
# Used when logging to papertrail:
|
||||
#
|
||||
PAPERTRAIL_HOST=
|
||||
PAPERTRAIL_PORT=
|
||||
|
||||
# Log level. You can set this from least severe to most severe:
|
||||
# debug, info, notice, warning, error, critical, alert, emergency
|
||||
# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably
|
||||
# nothing will get logged, ever.
|
||||
APP_LOG_LEVEL=notice
|
||||
|
||||
# Audit log level.
|
||||
# Set this to "emergency" if you dont want to store audit logs, leave on info otherwise.
|
||||
AUDIT_LOG_LEVEL=info
|
||||
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
# Use "pgsql" for PostgreSQL
|
||||
# Use "mysql" for MySQL and MariaDB.
|
||||
# Use "sqlite" for SQLite.
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=db
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=firefly
|
||||
DB_USERNAME=firefly
|
||||
DB_PASSWORD={{ firefly_db_password }}
|
||||
# leave empty or omit when not using a socket connection
|
||||
DB_SOCKET=
|
||||
|
||||
# MySQL supports SSL. You can configure it here.
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
MYSQL_USE_SSL=false
|
||||
MYSQL_SSL_VERIFY_SERVER_CERT=true
|
||||
# You need to set at least of these options
|
||||
MYSQL_SSL_CAPATH=/etc/ssl/certs/
|
||||
MYSQL_SSL_CA=
|
||||
MYSQL_SSL_CERT=
|
||||
MYSQL_SSL_KEY=
|
||||
MYSQL_SSL_CIPHER=
|
||||
|
||||
# PostgreSQL supports SSL. You can configure it here.
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
PGSQL_SSL_MODE=prefer
|
||||
PGSQL_SSL_ROOT_CERT=null
|
||||
PGSQL_SSL_CERT=null
|
||||
PGSQL_SSL_KEY=null
|
||||
PGSQL_SSL_CRL_FILE=null
|
||||
|
||||
# more PostgreSQL settings
|
||||
PGSQL_SCHEMA=public
|
||||
|
||||
# If you're looking for performance improvements, you could install memcached or redis
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
|
||||
# If you set either of the options above to 'redis', you might want to update these settings too
|
||||
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
|
||||
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
|
||||
|
||||
# can be tcp, unix or http
|
||||
REDIS_SCHEME=tcp
|
||||
|
||||
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
|
||||
REDIS_PATH=
|
||||
|
||||
# use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise.
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PORT=6379
|
||||
|
||||
# Use only with Redis 6+ with proper ACL set. Leave empty otherwise.
|
||||
REDIS_USERNAME=
|
||||
REDIS_PASSWORD=
|
||||
|
||||
# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
|
||||
REDIS_DB="0"
|
||||
REDIS_CACHE_DB="1"
|
||||
|
||||
# Cookie settings. Should not be necessary to change these.
|
||||
# If you use Docker or similar, you can set COOKIE_DOMAIN_FILE to set
|
||||
# the value from a file instead of from an environment variable
|
||||
# Setting samesite to "strict" may give you trouble logging in.
|
||||
COOKIE_PATH="/"
|
||||
COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
COOKIE_SAMESITE=lax
|
||||
|
||||
# If you want Firefly III to email you, update these settings
|
||||
# For instructions, see: https://docs.firefly-iii.org/advanced-installation/email
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
MAIL_MAILER=log
|
||||
MAIL_HOST=null
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
|
||||
# Other mail drivers:
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
MAILGUN_DOMAIN=
|
||||
MAILGUN_SECRET=
|
||||
|
||||
# If you are on EU region in mailgun, use api.eu.mailgun.net, otherwise use api.mailgun.net
|
||||
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
|
||||
MAILGUN_ENDPOINT=api.mailgun.net
|
||||
|
||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||
MANDRILL_SECRET=
|
||||
SPARKPOST_SECRET=
|
||||
|
||||
# Firefly III can send you the following messages.
|
||||
SEND_ERROR_MESSAGE=true
|
||||
|
||||
# These messages contain (sensitive) transaction information:
|
||||
SEND_REPORT_JOURNALS=true
|
||||
|
||||
# Set this value to true if you want to set the location
|
||||
# of certain things, like transactions. Since this involves an external service, it's optional
|
||||
# and disabled by default.
|
||||
ENABLE_EXTERNAL_MAP=false
|
||||
|
||||
# Set this value to true if you want Firefly III to download currency exchange rates
|
||||
# from the internet. These rates are hosted by the creator of Firefly III inside
|
||||
# an Azure Storage Container.
|
||||
# Not all currencies may be available. Rates may be wrong.
|
||||
ENABLE_EXTERNAL_RATES=false
|
||||
|
||||
# The map will default to this location:
|
||||
MAP_DEFAULT_LAT={{ firefly_map_lat }}
|
||||
MAP_DEFAULT_LONG={{ firefly_map_long }}
|
||||
MAP_DEFAULT_ZOOM={{ firefly_map_zoom }}
|
||||
|
||||
#
|
||||
# Firefly III authentication settings
|
||||
#
|
||||
|
||||
#
|
||||
# Firefly III supports a few authentication methods:
|
||||
# - 'web' (default, uses built in DB)
|
||||
# - 'remote_user_guard' for Authelia etc
|
||||
# Read more about these settings in the documentation.
|
||||
# https://docs.firefly-iii.org/advanced-installation/authentication
|
||||
#
|
||||
# LDAP is no longer supported :(
|
||||
#
|
||||
AUTHENTICATION_GUARD=web
|
||||
|
||||
#
|
||||
# Remote user guard settings
|
||||
#
|
||||
AUTHENTICATION_GUARD_HEADER=REMOTE_USER
|
||||
AUTHENTICATION_GUARD_EMAIL=
|
||||
|
||||
#
|
||||
# Firefly III generates a basic keypair for your OAuth tokens.
|
||||
# If you want, you can overrule the key with your own (secure) value.
|
||||
# It's also possible to set PASSPORT_PUBLIC_KEY_FILE or PASSPORT_PRIVATE_KEY_FILE
|
||||
# if you're using Docker secrets or similar solutions for secret management
|
||||
#
|
||||
PASSPORT_PRIVATE_KEY=
|
||||
PASSPORT_PUBLIC_KEY=
|
||||
|
||||
#
|
||||
# Extra authentication settings
|
||||
#
|
||||
CUSTOM_LOGOUT_URL=
|
||||
|
||||
# You can disable the X-Frame-Options header if it interferes with tools like
|
||||
# Organizr. This is at your own risk. Applications running in frames run the risk
|
||||
# of leaking information to their parent frame.
|
||||
DISABLE_FRAME_HEADER=false
|
||||
|
||||
# You can disable the Content Security Policy header when you're using an ancient browser
|
||||
# or any version of Microsoft Edge / Internet Explorer (which amounts to the same thing really)
|
||||
# This leaves you with the risk of not being able to stop XSS bugs should they ever surface.
|
||||
# This is at your own risk.
|
||||
DISABLE_CSP_HEADER=false
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set valid analytics tracker information here.
|
||||
# Nobody uses this except for me on the demo site. But hey, feel free to use this if you want to.
|
||||
# Do not prepend the TRACKER_URL with http:// or https://
|
||||
# The only tracker supported is Matomo.
|
||||
# You can set the following variables from a file by appending them with _FILE:
|
||||
TRACKER_SITE_ID=
|
||||
TRACKER_URL=
|
||||
|
||||
#
|
||||
# Firefly III supports webhooks. These are security sensitive and must be enabled manually first.
|
||||
#
|
||||
ALLOW_WEBHOOKS=false
|
||||
|
||||
#
|
||||
# The static cron job token can be useful when you use Docker and wish to manage cron jobs.
|
||||
# 1. Set this token to any 32-character value (this is important!).
|
||||
# 2. Use this token in the cron URL instead of a user's command line token.
|
||||
#
|
||||
# For more info: https://docs.firefly-iii.org/firefly-iii/advanced-installation/cron/
|
||||
#
|
||||
# You can set this variable from a file by appending it with _FILE
|
||||
#
|
||||
STATIC_CRON_TOKEN={{ firefly_static_cron_token }}
|
||||
|
||||
# You can fine tune the start-up of a Docker container by editing these environment variables.
|
||||
# Use this at your own risk. Disabling certain checks and features may result in lots of inconsistent data.
|
||||
# However if you know what you're doing you can significantly speed up container start times.
|
||||
# Set each value to true to enable, or false to disable.
|
||||
|
||||
# Set this to true to build all locales supported by Firefly III.
|
||||
# This may take quite some time (several minutes) and is generally not recommended.
|
||||
# If you wish to change or alter the list of locales, start your Docker container with
|
||||
# `docker run -v locale.gen:/etc/locale.gen -e DKR_BUILD_LOCALE=true`
|
||||
# and make sure your preferred locales are in your own locale.gen.
|
||||
DKR_BUILD_LOCALE=false
|
||||
|
||||
# Check if the SQLite database exists. Can be skipped if you're not using SQLite.
|
||||
# Won't significantly speed up things.
|
||||
DKR_CHECK_SQLITE=true
|
||||
|
||||
# Run database creation and migration commands. Disable this only if you're 100% sure the DB exists
|
||||
# and is up to date.
|
||||
DKR_RUN_MIGRATION=true
|
||||
|
||||
# Run database upgrade commands. Disable this only when you're 100% sure your DB is up-to-date
|
||||
# with the latest fixes (outside of migrations!)
|
||||
DKR_RUN_UPGRADE=true
|
||||
|
||||
# Verify database integrity. Includes all data checks and verifications.
|
||||
# Disabling this makes Firefly III assume your DB is intact.
|
||||
DKR_RUN_VERIFY=true
|
||||
|
||||
# Run database reporting commands. When disabled, Firefly III won't go over your data to report current state.
|
||||
# Disabling this should have no impact on data integrity or safety but it won't warn you of possible issues.
|
||||
DKR_RUN_REPORT=true
|
||||
|
||||
# Generate OAuth2 keys.
|
||||
# When disabled, Firefly III won't attempt to generate OAuth2 Passport keys. This won't be an issue, IFF (if and only if)
|
||||
# you had previously generated keys already and they're stored in your database for restoration.
|
||||
DKR_RUN_PASSPORT_INSTALL=true
|
||||
|
||||
# Leave the following configuration vars as is.
|
||||
# Unless you like to tinker and know what you're doing.
|
||||
APP_NAME={{ firefly_app_name }}
|
||||
BROADCAST_DRIVER=log
|
||||
QUEUE_DRIVER=sync
|
||||
CACHE_PREFIX=firefly
|
||||
PUSHER_KEY=
|
||||
IPINFO_TOKEN=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
DEMO_USERNAME=
|
||||
DEMO_PASSWORD=
|
||||
IS_HEROKU=false
|
||||
FIREFLY_III_LAYOUT=v1
|
||||
|
||||
#
|
||||
# If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable.
|
||||
# It won't work. It doesn't do ANYTHING. Don't believe the lies you read online. I'm not joking.
|
||||
# This configuration value WILL NOT HELP.
|
||||
#
|
||||
# Notable exception to this rule is Synology, which, according to some users, will use APP_URL to rewrite stuff.
|
||||
#
|
||||
# This variable is ONLY used in some of the emails Firefly III sends around. Nowhere else.
|
||||
# So when configuring anything WEB related this variable doesn't do anything. Nothing
|
||||
#
|
||||
# If you're stuck I understand you get desperate but look SOMEWHERE ELSE.
|
||||
#
|
||||
APP_URL=http://localhost
|
7
test-requirements.txt
Normal file
7
test-requirements.txt
Normal file
@ -0,0 +1,7 @@
|
||||
urllib3==1.26.15
|
||||
ansible==7.2.0
|
||||
molecule==4.0.4
|
||||
docker==6.0.1
|
||||
molecule-docker==2.1.0
|
||||
ansible-lint==6.14.4
|
||||
yamllint==1.30.0
|
Loading…
Reference in New Issue
Block a user