[ini]
This commit is contained in:
commit
935ab02d44
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Ansible Collection - fenris.zeitbild
|
||||
|
||||
Documentation for the collection.
|
||||
39
galaxy.yml
Normal file
39
galaxy.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
namespace: fenris
|
||||
|
||||
name: davina
|
||||
|
||||
version: 1.0.0
|
||||
|
||||
readme: README.md
|
||||
|
||||
authors:
|
||||
- Royd Falk <roydfalk@folksprak.org>
|
||||
|
||||
# description: your collection description
|
||||
|
||||
license:
|
||||
- GPL-2.0-or-later
|
||||
|
||||
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
|
||||
# mutually exclusive with 'license'
|
||||
license_file: ''
|
||||
|
||||
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
|
||||
# requirements as 'namespace' and 'name'
|
||||
tags: []
|
||||
|
||||
dependencies: {}
|
||||
|
||||
repository: http://forgejo.ramsch.sx/davina/
|
||||
|
||||
# The URL to any online docs
|
||||
# documentation: http://docs.example.com
|
||||
|
||||
# The URL to the homepage of the collection/project
|
||||
# homepage: http://example.com
|
||||
|
||||
# The URL to the collection issue tracker
|
||||
# issues: http://example.com/issue/tracker
|
||||
|
||||
build_ignore: []
|
||||
|
||||
52
meta/runtime.yml
Normal file
52
meta/runtime.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
# Collections must specify a minimum required ansible version to upload
|
||||
# to galaxy
|
||||
# requires_ansible: '>=2.9.10'
|
||||
|
||||
# Content that Ansible needs to load from another location or that has
|
||||
# been deprecated/removed
|
||||
# plugin_routing:
|
||||
# action:
|
||||
# redirected_plugin_name:
|
||||
# redirect: ns.col.new_location
|
||||
# deprecated_plugin_name:
|
||||
# deprecation:
|
||||
# removal_version: "4.0.0"
|
||||
# warning_text: |
|
||||
# See the porting guide on how to update your playbook to
|
||||
# use ns.col.another_plugin instead.
|
||||
# removed_plugin_name:
|
||||
# tombstone:
|
||||
# removal_version: "2.0.0"
|
||||
# warning_text: |
|
||||
# See the porting guide on how to update your playbook to
|
||||
# use ns.col.another_plugin instead.
|
||||
# become:
|
||||
# cache:
|
||||
# callback:
|
||||
# cliconf:
|
||||
# connection:
|
||||
# doc_fragments:
|
||||
# filter:
|
||||
# httpapi:
|
||||
# inventory:
|
||||
# lookup:
|
||||
# module_utils:
|
||||
# modules:
|
||||
# netconf:
|
||||
# shell:
|
||||
# strategy:
|
||||
# terminal:
|
||||
# test:
|
||||
# vars:
|
||||
|
||||
# Python import statements that Ansible needs to load from another location
|
||||
# import_redirection:
|
||||
# ansible_collections.ns.col.plugins.module_utils.old_location:
|
||||
# redirect: ansible_collections.ns.col.plugins.module_utils.new_location
|
||||
|
||||
# Groups of actions/modules that take a common set of options
|
||||
# action_groups:
|
||||
# group_name:
|
||||
# - module1
|
||||
# - module2
|
||||
31
plugins/README.md
Normal file
31
plugins/README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Collections Plugins Directory
|
||||
|
||||
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
|
||||
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
|
||||
would contain module utils and modules respectively.
|
||||
|
||||
Here is an example directory of the majority of plugins currently supported by Ansible:
|
||||
|
||||
```
|
||||
└── plugins
|
||||
├── action
|
||||
├── become
|
||||
├── cache
|
||||
├── callback
|
||||
├── cliconf
|
||||
├── connection
|
||||
├── filter
|
||||
├── httpapi
|
||||
├── inventory
|
||||
├── lookup
|
||||
├── module_utils
|
||||
├── modules
|
||||
├── netconf
|
||||
├── shell
|
||||
├── strategy
|
||||
├── terminal
|
||||
├── test
|
||||
└── vars
|
||||
```
|
||||
|
||||
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible-core/2.14/plugins/plugins.html).
|
||||
17
roles/davina/defaults/main.json
Normal file
17
roles/davina/defaults/main.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"var_davina_backend_directory": "/opt/davina",
|
||||
"var_davina_backend_user": "davina",
|
||||
"var_davina_backend_git_repository_url": "https://forgejo.ramsch.sx/davina/backend",
|
||||
"var_davina_backend_git_reference": "main",
|
||||
"var_davina_backend_auth": {
|
||||
"kind": "none",
|
||||
"data": null
|
||||
},
|
||||
"var_davina_backend_source": {
|
||||
"kind": "ics_feed",
|
||||
"data": {
|
||||
"url": "",
|
||||
"combine": true
|
||||
}
|
||||
}
|
||||
}
|
||||
78
roles/davina/tasks/main.json
Normal file
78
roles/davina/tasks/main.json
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
[
|
||||
{
|
||||
"name": "packages",
|
||||
"become": true,
|
||||
"ansible.builtin.apt": {
|
||||
"update_cache": true,
|
||||
"pkg": [
|
||||
"git",
|
||||
"make",
|
||||
"rsync",
|
||||
"nodejs"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user and directory",
|
||||
"become": true,
|
||||
"ansible.builtin.user": {
|
||||
"name": "{{var_davina_backend_user}}",
|
||||
"create_home": true,
|
||||
"home": "{{var_davina_backend_directory}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "program | fetch",
|
||||
"become": true,
|
||||
"become_user": "{{var_davina_backend_user}}",
|
||||
"ansible.builtin.git": {
|
||||
"repo": "{{var_davina_backend_git_repository_url}}",
|
||||
"version": "{{var_davina_backend_git_reference}}",
|
||||
"dest": "/tmp/davina-backend-repo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "program | build",
|
||||
"become": true,
|
||||
"become_user": "{{var_davina_backend_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "/tmp/davina-backend-repo",
|
||||
"cmd": "tools/build"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "program | deploy",
|
||||
"become": true,
|
||||
"become_user": "{{var_davina_backend_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "/tmp/davina-backend-repo",
|
||||
"cmd": "tools/deploy localhost --target-directory={{var_davina_backend_directory}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "conf",
|
||||
"become": true,
|
||||
"ansible.builtin.template": {
|
||||
"src": "conf.json.j2",
|
||||
"dest": "{{var_davina_backend_directory}}/conf.json",
|
||||
"owner": "{{var_davina_backend_user}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemd unit",
|
||||
"become": true,
|
||||
"ansible.builtin.template": {
|
||||
"src": "systemd_unit.j2",
|
||||
"dest": "/etc/systemd/system/davina.service"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "run",
|
||||
"become": true,
|
||||
"ansible.builtin.systemd_service": {
|
||||
"name": "davina",
|
||||
"enabled": true,
|
||||
"state": "restarted"
|
||||
}
|
||||
}
|
||||
]
|
||||
8
roles/davina/templates/conf.json.j2
Normal file
8
roles/davina/templates/conf.json.j2
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"auth": {{ var_davina_backend_auth | json }},
|
||||
"source": {{ var_davina_backend_source | json }},
|
||||
"settings": {
|
||||
"timezone": "UTC"
|
||||
}
|
||||
}
|
||||
|
||||
14
roles/davina/templates/systemd_unit.j2
Normal file
14
roles/davina/templates/systemd_unit.j2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=davina
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory={{var_davina_backend_directory}}
|
||||
ExecStart={{var_davina_backend_directory}}/davina serve
|
||||
Type=simple
|
||||
Restart=always
|
||||
User={{var_davina_backend_user}}
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
RequiredBy=network.target
|
||||
Loading…
Reference in a new issue