Compare commits
9 Commits
0.1.2
...
transcaffe
Author | SHA1 | Date | |
---|---|---|---|
4cef4474b5
|
|||
cce1ed58d4
|
|||
205606a1cf
|
|||
a206695e69
|
|||
b6365008ad
|
|||
61ca04eb33
|
|||
ec20504550
|
|||
fc98913909
|
|||
89740427c2
|
@ -9,12 +9,18 @@ available.
|
|||||||
|
|
||||||
## Roles
|
## Roles
|
||||||
|
|
||||||
|
- [`fediwall`](roles/fediwall/README.md): deployment of [Fediwall](https://fediwall.social),
|
||||||
|
a media wall for mastodon inspired by mastowall.
|
||||||
|
|
||||||
- [`gotosocial`](roles/gotosocial/README.md): deployment of [GoToSocial.org](https://gotosocial.org/),
|
- [`gotosocial`](roles/gotosocial/README.md): deployment of [GoToSocial.org](https://gotosocial.org/),
|
||||||
an ActivityPub social network server, in a docker container.
|
an ActivityPub social network server, in a docker container.
|
||||||
|
|
||||||
- [`mastodon`](roles/mastodon/README.md): deployment using a container based
|
- [`mastodon`](roles/mastodon/README.md): deployment using a container based
|
||||||
setup, able to use webfinger delegation.
|
setup, able to use webfinger delegation.
|
||||||
|
|
||||||
|
- [`sharkey`](roles/sharkey/README.md): deployment of sharkey, a misskey-
|
||||||
|
fork with full mastodon API compatability.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[CNPLv7+](LICENSE.md): Cooperative Nonviolent Public License
|
[CNPLv7+](LICENSE.md): Cooperative Nonviolent Public License
|
||||||
|
@ -7,8 +7,14 @@ authors:
|
|||||||
description: Deploying fediverse software, mostly ActivityPub based
|
description: Deploying fediverse software, mostly ActivityPub based
|
||||||
dependencies:
|
dependencies:
|
||||||
"community.docker": "^4.0.0"
|
"community.docker": "^4.0.0"
|
||||||
|
"community.general": "^10.6.0"
|
||||||
license_file: LICENSE.md
|
license_file: LICENSE.md
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
repository: https://git.finally.coffee/finallycoffee/fediverse
|
repository: https://git.finally.coffee/finallycoffee/fediverse
|
||||||
issues: https://codeberg.org/finallycoffee/ansible-collection-fediverse/issues
|
issues: https://codeberg.org/finallycoffee/ansible-collection-fediverse/issues
|
||||||
|
tags:
|
||||||
|
- fediwall
|
||||||
|
- sharkey
|
||||||
|
- gotosocial
|
||||||
|
- mastodon
|
||||||
|
6
playbooks/fediwall.yml
Normal file
6
playbooks/fediwall.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Install and configure fediwall
|
||||||
|
hosts: "{{ fediwall_hosts | default('fediwall') }}"
|
||||||
|
become: "{{ fediwall_become | default(false) }}"
|
||||||
|
roles:
|
||||||
|
- role: fediwall
|
6
playbooks/sharkey.yml
Normal file
6
playbooks/sharkey.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Deploy sharkey
|
||||||
|
hosts: "{{ sharkey_hosts | default('sharkey') }}"
|
||||||
|
become: "{{ sharkey_become | default(false) }}"
|
||||||
|
roles:
|
||||||
|
- role: finallycoffee.fediverse.sharkey
|
4
roles/fediwall/README.md
Normal file
4
roles/fediwall/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# `finallycoffee.fediverse.fediwall` ansible role
|
||||||
|
|
||||||
|
Ansible role for [`fediwall`](https://fediwall.social) deployment.
|
||||||
|
|
50
roles/fediwall/defaults/main/config.yml
Normal file
50
roles/fediwall/defaults/main/config.yml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
fediwall_config_servers:
|
||||||
|
- mastodon.social
|
||||||
|
fediwall_config_tags:
|
||||||
|
- cats
|
||||||
|
fediwall_config_accounts: []
|
||||||
|
fediwall_config_load_public: false
|
||||||
|
fediwall_config_load_federated: false
|
||||||
|
fediwall_config_load_trends: false
|
||||||
|
fediwall_config_languages: []
|
||||||
|
fediwall_config_bad_words: []
|
||||||
|
fediwall_config_hide_sensitive: true
|
||||||
|
fediwall_config_hide_bots: true
|
||||||
|
fediwall_config_hide_replies: true
|
||||||
|
fediwall_config_hide_boosts: false
|
||||||
|
fediwall_config_limit: 20
|
||||||
|
fediwall_config_interval: 10
|
||||||
|
fediwall_config_title: "Fediwall"
|
||||||
|
fediwall_config_theme: "auto"
|
||||||
|
fediwall_config_show_infobar: true
|
||||||
|
fediwall_config_show_text: true
|
||||||
|
fediwall_config_show_media: true
|
||||||
|
fediwall_config_play_videos: true
|
||||||
|
|
||||||
|
fediwall_default_config:
|
||||||
|
servers: "{{ fediwall_config_servers }}"
|
||||||
|
tags: "{{ fediwall_config_tags }}"
|
||||||
|
accounts: "{{ fediwall_config_accounts }}"
|
||||||
|
loadPublic: "{{ fediwall_config_load_public }}"
|
||||||
|
loadFederated: "{{ fediwall_config_load_federated }}"
|
||||||
|
loadTrends: "{{ fediwall_config_load_trends }}"
|
||||||
|
languages: "{{ fediwall_config_languages }}"
|
||||||
|
badWords: "{{ fediwall_config_bad_words }}"
|
||||||
|
hideSensitive: "{{ fediwall_config_hide_sensitive }}"
|
||||||
|
hideBots: "{{ fediwall_config_hide_bots }}"
|
||||||
|
hideReplies: "{{ fediwall_config_hide_replies }}"
|
||||||
|
hideBoosts: "{{ fediwall_config_hide_boosts }}"
|
||||||
|
limit: "{{ fediwall_config_limit }}"
|
||||||
|
interval: "{{ fediwall_config_interval }}"
|
||||||
|
title: "{{ fediwall_config_title }}"
|
||||||
|
theme: "{{ fediwall_config_theme }}"
|
||||||
|
showInfobar: "{{ fediwall_config_show_infobar }}"
|
||||||
|
showText: "{{ fediwall_config_show_text }}"
|
||||||
|
showMedia: "{{ fediwall_config_show_media }}"
|
||||||
|
playVideos: "{{ fediwall_config_play_videos }}"
|
||||||
|
|
||||||
|
fediwall_config: {}
|
||||||
|
fediwall_final_config: >-2
|
||||||
|
{{ fediwall_default_config | default({}, true)
|
||||||
|
| combine(fediwall_config | default({}, true)) }}
|
45
roles/fediwall/defaults/main/container.yml
Normal file
45
roles/fediwall/defaults/main/container.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
fediwall_container_name: fediwall
|
||||||
|
fediwall_container_image_registry: ghcr.io
|
||||||
|
fediwall_container_image_namespace: defnull
|
||||||
|
fediwall_container_image_name: fediwall
|
||||||
|
fediwall_container_image_repository: >-2
|
||||||
|
{{
|
||||||
|
[
|
||||||
|
fediwall_container_image_registry | default([], true),
|
||||||
|
fediwall_container_image_namespace | default([], true),
|
||||||
|
fediwall_container_image_name
|
||||||
|
] | flatten | join('/')
|
||||||
|
}}
|
||||||
|
fediwall_container_image_tag: ~
|
||||||
|
fediwall_container_image_source: pull
|
||||||
|
fediwall_container_image_force_source: >-2
|
||||||
|
{{ fediwall_container_image_tag | default(false, true) | bool }}
|
||||||
|
fediwall_container_image: >-2
|
||||||
|
{{
|
||||||
|
[
|
||||||
|
fediwall_container_image_repository,
|
||||||
|
fediwall_container_image_tag | default(fediwall_version, true)
|
||||||
|
] | join(':')
|
||||||
|
}}
|
||||||
|
fediwall_container_env: ~
|
||||||
|
fediwall_container_user: ~
|
||||||
|
fediwall_container_ports: ~
|
||||||
|
fediwall_container_labels: ~
|
||||||
|
fediwall_container_volumes: []
|
||||||
|
fediwall_container_networks: ~
|
||||||
|
fediwall_container_network_mode: ~
|
||||||
|
fediwall_container_dns_servers: ~
|
||||||
|
fediwall_container_etc_hosts: ~
|
||||||
|
fediwall_container_memory: ~
|
||||||
|
fediwall_container_memory_swap: ~
|
||||||
|
fediwall_container_memory_reservation: ~
|
||||||
|
fediwall_container_restart_policy: "on-failure"
|
||||||
|
|
||||||
|
fediwall_container_config_file: "/usr/share/nginx/html/wall-config.json"
|
||||||
|
fediwall_container_base_volumes:
|
||||||
|
- "{{ fediwall_config_file }}:{{ fediwall_container_config_file }}:ro"
|
||||||
|
fediwall_container_final_volumes: >-2
|
||||||
|
{{ fediwall_container_base_volumes + fediwall_container_volumes }}
|
||||||
|
fediwall_container_state: >-2
|
||||||
|
{{ (fediwall_state == 'present') | ternary('started', 'absent') }}
|
8
roles/fediwall/defaults/main/main.yml
Normal file
8
roles/fediwall/defaults/main/main.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
fediwall_user: fediwall
|
||||||
|
fediwall_version: "1.4.0"
|
||||||
|
fediwall_config_file: "/etc/fediwall/config.json"
|
||||||
|
fediwall_config_file_path: "{{ fediwall_config_file | dirname }}"
|
||||||
|
|
||||||
|
fediwall_state: "present"
|
||||||
|
fediwall_deployment_method: "docker"
|
26
roles/fediwall/tasks/deploy-docker.yml
Normal file
26
roles/fediwall/tasks/deploy-docker.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure container image '{{ fediwall_container_image }}' is {{ fediwall_state }}
|
||||||
|
community.docker.docker_image:
|
||||||
|
name: "{{ fediwall_container_image }}"
|
||||||
|
state: "{{ fediwall_state }}"
|
||||||
|
source: "{{ fediwall_container_image_source }}"
|
||||||
|
force_source: "{{ fediwall_container_image_force_source }}"
|
||||||
|
|
||||||
|
- name: Ensure container '{{ fediwall_container_name }}' is {{ fediwall_container_state }}
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: "{{ fediwall_container_name }}"
|
||||||
|
image: "{{ fediwall_container_image }}"
|
||||||
|
env: "{{ fediwall_container_env | default(omit, true) }}"
|
||||||
|
user: "{{ fediwall_container_user | default(omit, true) }}"
|
||||||
|
ports: "{{ fediwall_container_ports | default(omit, true) }}"
|
||||||
|
labels: "{{ fediwall_container_labels | default(omit, true) }}"
|
||||||
|
volumes: "{{ fediwall_container_final_volumes | default(omit, true) }}"
|
||||||
|
networks: "{{ fediwall_container_networks | default(omit, true) }}"
|
||||||
|
network_mode: "{{ fediwall_container_network_mode | default(omit, true) }}"
|
||||||
|
dns_servers: "{{ fediwall_container_dns_servers | default(omit, true) }}"
|
||||||
|
etc_hosts: "{{ fediwall_container_etc_hosts | default(omit, true) }}"
|
||||||
|
memory: "{{ fediwall_container_memory | default(omit, true) }}"
|
||||||
|
memory_swap: "{{ fediwall_container_memory_swap | default(omit, true) }}"
|
||||||
|
memory_reservation: "{{ fediwall_container_memory_reservation | default(omit, true) }}"
|
||||||
|
restart_policy: "{{ fediwall_container_restart_policy }}"
|
||||||
|
state: "{{ fediwall_container_state }}"
|
43
roles/fediwall/tasks/main.yml
Normal file
43
roles/fediwall/tasks/main.yml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure 'fediwall_state' is valid
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-2
|
||||||
|
Unsupported state '{{ fediwall_state }}'. Supported
|
||||||
|
states are {{ fediwall_states | map(quote) | join(', ') }}
|
||||||
|
when: fediwall_state not in fediwall_states
|
||||||
|
|
||||||
|
- name: Ensure 'fediwall_deployment_method' is valid
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-2
|
||||||
|
Unsupported deployment method '{{ fediwall_deployment_method }}'.
|
||||||
|
upported deployment methods are {{ fediwall_deployment_methods | join(', ') }}
|
||||||
|
when: fediwall_deployment_method not in fediwall_deployment_methods
|
||||||
|
|
||||||
|
- name: Ensure user '{{ fediwall_user }}' is {{ fediwall_state }}
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ fediwall_user }}"
|
||||||
|
state: "{{ fediwall_state }}"
|
||||||
|
system: "{{ fediwall_user_system | default(true, true) }}"
|
||||||
|
create_home: "{{ fediwall_user_system | default(false, true) }}"
|
||||||
|
|
||||||
|
- name: Ensure configuration folder '{{ fediwall_config_file_path }}' is {{ fediwall_state }}
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ fediwall_config_file_path }}"
|
||||||
|
state: directory
|
||||||
|
when: fediwall_state == 'present'
|
||||||
|
|
||||||
|
- name: Ensure configuration in '{{ fediwall_config_file }}' is {{ fediwall_state }}
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: "{{ fediwall_final_config | to_nice_json(indent=2) }}"
|
||||||
|
dest: "{{ fediwall_config_file }}"
|
||||||
|
state: "{{ fediwall_state }}"
|
||||||
|
|
||||||
|
- name: Ensure configuration folder is {{ fediwall_state }}
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ fediwall_config_file_path }}"
|
||||||
|
state: absent
|
||||||
|
when: fediwall_state == 'absent'
|
||||||
|
|
||||||
|
- name: Deploy using {{ fediwall_deployment_method }}
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: "deploy-{{ fediwall_deployment_method }}.yml"
|
6
roles/fediwall/vars/main.yml
Normal file
6
roles/fediwall/vars/main.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fediwall_states:
|
||||||
|
- "present"
|
||||||
|
- "absent"
|
||||||
|
fediwall_deployment_methods:
|
||||||
|
- "docker"
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
gotosocial_user: "gotosocial"
|
gotosocial_user: "gotosocial"
|
||||||
gotosocial_version: "0.17.4"
|
gotosocial_version: "0.19.0"
|
||||||
gotosocial_base_path: "/opt/gotosocial"
|
gotosocial_base_path: "/opt/gotosocial"
|
||||||
gotosocial_config_path: "{{ gotosocial_base_path }}/config"
|
gotosocial_config_path: "{{ gotosocial_base_path }}/config"
|
||||||
gotosocial_template_path: "{{ gotosocial_base_path }}/templates"
|
gotosocial_template_path: "{{ gotosocial_base_path }}/templates"
|
||||||
|
@ -3,7 +3,7 @@ mastodon_user: mastodon
|
|||||||
mastodon_base_path: /opt/mastodon
|
mastodon_base_path: /opt/mastodon
|
||||||
mastodon_domain: ~
|
mastodon_domain: ~
|
||||||
mastodon_web_domain: ~
|
mastodon_web_domain: ~
|
||||||
mastodon_version: "4.3.2"
|
mastodon_version: "4.3.8"
|
||||||
mastodon_git_upstream_url: "https://github.com/mastodon/mastodon.git"
|
mastodon_git_upstream_url: "https://github.com/mastodon/mastodon.git"
|
||||||
|
|
||||||
mastodon_data_path: "{{ mastodon_base_path }}/data"
|
mastodon_data_path: "{{ mastodon_base_path }}/data"
|
||||||
|
11
roles/sharkey/README.md
Normal file
11
roles/sharkey/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# `finallycoffee.fediverse.sharkey` ansible role
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
## Behind a proxy
|
||||||
|
|
||||||
|
The ansible role itself will respect system proxies (in the env var `HTTP_PROXY`/`https_proxy`).
|
||||||
|
|
||||||
|
To use this role with a registry like Artifactory or Nexus3,
|
||||||
|
set `sharkey_repo_server` to your registry server with full
|
||||||
|
protocol, hostname, port. For example `sharkey_repo_server: "https://my.orgs.registry.local:8443/sharkey-internet-proxy/"`
|
15
roles/sharkey/defaults/main/compose.yml
Normal file
15
roles/sharkey/defaults/main/compose.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
sharkey_compose_state: "{{ sharkey_state }}"
|
||||||
|
sharkey_compose_project_name: "sharkey"
|
||||||
|
sharkey_compose_project_src: "/etc/sharkey"
|
||||||
|
sharkey_compose_upstream_file: "{{ sharkey_compose_project_src }}/compose.upstream.yml"
|
||||||
|
sharkey_compose_file: "{{ sharkey_compose_project_src }}/compose.yml"
|
||||||
|
sharkey_compose_build: >-2
|
||||||
|
{{ (sharkey_container_image_source == 'pull') | ternary('never', 'policy') }}
|
||||||
|
sharkey_compose_build: "never"
|
||||||
|
|
||||||
|
sharkey_repo_server: "https://activitypub.software"
|
||||||
|
sharkey_repo_path: "Transfem-org/Sharkey"
|
||||||
|
sharkey_repo_tag: "{{ sharkey_version }}"
|
||||||
|
sharkey_compose_file_url: >-2
|
||||||
|
{{ sharkey_repo_server }}/{{ sharkey_repo_path }}/-/raw/{{ sharkey_version }}/compose_example.yml?ref_type=tags
|
3
roles/sharkey/defaults/main/config.yml
Normal file
3
roles/sharkey/defaults/main/config.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
sharkey_config_url: ~
|
||||||
|
sharkey_config_setup_password: ~
|
24
roles/sharkey/defaults/main/container.yml
Normal file
24
roles/sharkey/defaults/main/container.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
sharkey_container_name: sharkey
|
||||||
|
sharkey_container_image_registry: "registry.activitypub.software"
|
||||||
|
sharkey_container_iamge_namespace: "transfem-org"
|
||||||
|
sharkey_container_image_name: "sharkey"
|
||||||
|
sharkey_container_image_repository: >-2
|
||||||
|
{{
|
||||||
|
[
|
||||||
|
sharkey_container_image_registry | default([], true),
|
||||||
|
sharkey_container_iamge_namespace | default([], true),
|
||||||
|
sharkey_container_image_name
|
||||||
|
] | flatten | join('/')
|
||||||
|
}}
|
||||||
|
sharkey_container_image_tag: ~
|
||||||
|
sharkey_container_image_source: pull
|
||||||
|
sharkey_container_image_force_source: >-2
|
||||||
|
{{ sharkey_container_image_tag | default(false, true) | bool }}
|
||||||
|
sharkey_container_image: >-2
|
||||||
|
{{
|
||||||
|
[
|
||||||
|
sharkey_container_image_repository,
|
||||||
|
sharkey_container_image_tag | default(sharkey_version, true)
|
||||||
|
] | join(':')
|
||||||
|
}}
|
8
roles/sharkey/defaults/main/main.yml
Normal file
8
roles/sharkey/defaults/main/main.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
sharkey_user: sharkey
|
||||||
|
sharkey_version: "2025.4.3"
|
||||||
|
sharkey_config_dir: "/etc/sharkey"
|
||||||
|
sharkey_data_dir: "/var/lib/sharkey"
|
||||||
|
|
||||||
|
sharkey_state: present
|
||||||
|
sharkey_deployment_method: "docker-compose"
|
10
roles/sharkey/defaults/main/user.yml
Normal file
10
roles/sharkey/defaults/main/user.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
sharkey_user_system: true
|
||||||
|
sharkey_user_create_home: false
|
||||||
|
sharkey_user_groups: ~
|
||||||
|
sharkey_user_append_groups: >-2
|
||||||
|
{{ sharkey_user_groups | default(omit, true) }}
|
||||||
|
sharkey_user_uid: >-2
|
||||||
|
{{ sharkey_user_info.uid | default(sharkey_user) }}
|
||||||
|
sharkey_user_gid: >-2
|
||||||
|
{{ sharkey_user_info.group | default(sharkey_user) }}
|
14
roles/sharkey/tasks/check.yml
Normal file
14
roles/sharkey/tasks/check.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure 'sharkey_state' is valid
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-2
|
||||||
|
Unsupported sharkey_state '{{ sharkey_state }}'.
|
||||||
|
Supported values are {{ sharkey_states | join(', ') }}
|
||||||
|
when: sharkey_state not in sharkey_states
|
||||||
|
|
||||||
|
- name: Ensure 'sharkey_deployment_method' is valid
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-2
|
||||||
|
Unsupported sharkey_deployment_method '{{ sharkey_deployment_method }}.
|
||||||
|
Supported values are {{ sharkey_deployment_methods | join(', ') }}
|
||||||
|
when: sharkey_deployment_method not in sharkey_deployment_methods
|
7
roles/sharkey/tasks/configure-docker-compose.yml
Normal file
7
roles/sharkey/tasks/configure-docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure compose files are downloaded
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
# TODO: how to avoid redownloading default.yml when the role made changes?
|
||||||
|
url: "{{ sharkey_compose_file_url }}"
|
||||||
|
dest: "{{ sharkey_compose_upstream_file }}"
|
||||||
|
|
26
roles/sharkey/tasks/configure.yml
Normal file
26
roles/sharkey/tasks/configure.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure sharkey user '{{ sharkey_user }}' is {{ sharkey_state }}
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ sharkey_user }}"
|
||||||
|
state: "{{ sharkey_state }}"
|
||||||
|
system: "{{ sharkey_user_system }}"
|
||||||
|
create_home: "{{ sharkey_user_create_home }}"
|
||||||
|
groups: "{{ sharkey_user_groups }}"
|
||||||
|
append: "{{ sharkey_user_append_groups }}"
|
||||||
|
register: sharkey_user_info
|
||||||
|
|
||||||
|
- name: Ensure sharkey config directory '{{ sharkey_config_dir }}' is {{ sharkey_state }}
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ sharkey_config_dir }}"
|
||||||
|
state: "{{ (sharkey_state == 'present') | ternary('directory', 'absent') }}"
|
||||||
|
owner: "{{ sharkey_user_uid }}"
|
||||||
|
group: "{{ sharkey_user_gid }}"
|
||||||
|
mode: "0750"
|
||||||
|
|
||||||
|
- name: Ensure sharkey data directory '{{ sharkey_data_dir }}' is {{ sharkey_state }}
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ sharkey_data_dir }}"
|
||||||
|
state: "{{ (sharkey_state == 'present') | ternary('directory', 'absent') }}"
|
||||||
|
owner: "{{ sharkey_user_uid }}"
|
||||||
|
group: "{{ sharkey_user_gid }}"
|
||||||
|
mode: "0750"
|
14
roles/sharkey/tasks/deploy-docker-compose.yml
Normal file
14
roles/sharkey/tasks/deploy-docker-compose.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure sharkey container image '{{ sharkey_container_image }}' is {{ sharkey_state }}
|
||||||
|
community.docker.docker_image:
|
||||||
|
name: "{{ sharkey_container_image }}"
|
||||||
|
state: "{{ sharkey_state }}"
|
||||||
|
source: "{{ sharkey_container_image_source }}"
|
||||||
|
force_source: "{{ sharkey_container_image_force_source }}"
|
||||||
|
|
||||||
|
- name: Ensure docker compose project is {{ sharkey_compose_state }}
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_name: "{{ sharkey_compose_project_name }}"
|
||||||
|
project_src: "{{ sharkey_compose_project_src }}"
|
||||||
|
state: "{{ sharkey_compose_state }}"
|
||||||
|
build: "{{ sharkey_compose_build }}"
|
12
roles/sharkey/tasks/main.yml
Normal file
12
roles/sharkey/tasks/main.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: Check role prerequisites
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: check.yml
|
||||||
|
|
||||||
|
- name: Run common configuration tasks
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: configure.yml
|
||||||
|
|
||||||
|
- name: Deploy using {{ sharkey_deployment_method }}
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: "deploy-{{ sharkey_deployment_method }}.yml"
|
6
roles/sharkey/vars/main.yml
Normal file
6
roles/sharkey/vars/main.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
sharkey_states:
|
||||||
|
- present
|
||||||
|
- absent
|
||||||
|
sharkey_deployment_methods:
|
||||||
|
- "docker-compose"
|
Reference in New Issue
Block a user