add argument specs; add radicale; update meta

This commit is contained in:
Frank Adaemmer 2022-09-18 18:27:16 +02:00
parent 4a721d8e4d
commit 60f026239a
12 changed files with 156 additions and 12 deletions

View file

@ -0,0 +1,6 @@
---
argument_specs:
# roles/myapp/tasks/main.yml entry point
main:
short_description: Update all OS packages.
options: {}

View file

@ -41,18 +41,6 @@ galaxy_info:
version:
- any
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to

2
roles/radicale/README.md Normal file
View file

@ -0,0 +1,2 @@
# radicale
Build a radicale docker image and run a radicale docker container.

View file

@ -0,0 +1,13 @@
FROM alpine
RUN apk add --no-cache curl bash python3 py3-pip \
&& pip3 install 'radicale<3' passlib
COPY radicale.conf /radicale.conf
EXPOSE 5232/tcp
VOLUME ["/data"]
CMD radicale -C /radicale.conf
HEALTHCHECK CMD curl -f -L http://localhost:5232/ || exit 1

View file

@ -0,0 +1,27 @@
[server]
hosts = 0.0.0.0:5232
ssl = False
dns_lookup = False
realm = Password Required
[encoding]
request = utf-8
stock = utf-8
[auth]
type = htpasswd
htpasswd_filename = /data/users
htpasswd_encryption = md5
[rights]
type = owner_only
[storage]
type = multifilesystem
filesystem_folder = /data/collections
[logging]
#level=debug
debug=true
[headers]

View file

@ -0,0 +1,12 @@
---
argument_specs:
# roles/myapp/tasks/main.yml entry point
main:
short_description: Build a radicale docker image and run a radicale docker container.
options: {}
build:
short_description: Build a radicale docker image
options: {}
run:
short_description: Run a radicale docker container
options: {}

View file

@ -0,0 +1,40 @@
galaxy_info:
author: Frank Adaemmer <frank@adaemmer.com>
description: Build and run a radicale container
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: GPL-3.0-or-later
min_ansible_version: '2.9'
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: GenericLinux
version:
- any
galaxy_tags: [docker]
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

View file

@ -0,0 +1,17 @@
---
- name: Build radicale image
community.docker.docker_image:
name: radicale
tag: latest
build:
path: "{{ radicale_build_path | default('/srv/radicale') }}"
pull: true
nocache: "{{ force_recreate | default(false) }}"
source: build
force_source: true
state: present
become: true
register: imagebuild
retries: 3
delay: 60
until: imagebuild is not failed

View file

@ -0,0 +1,7 @@
---
# tasks file for radicale
- name: Build radicale image
ansible.builtin.import_tasks: build.yml
- name: Create radicale
ansible.builtin.import_tasks: run.yml

View file

@ -0,0 +1,25 @@
---
- name: Create radicale
community.docker.docker_container:
name: radicale
detach: true
image: radicale
labels:
com.centurylinklabs.watchtower.enable: 'true'
networks:
- name: webnet
network_mode: default
recreate: "{{ imagebuild.changed or (force_recreate | default(false)) }}"
comparisons:
image: strict
env: strict
volumes: strict
restart_policy: always
state: started
volumes:
- "{{ radicale_data_volume | default('radicale') }}:/data"
become: true
retries: 3
delay: 60
until: current_task is not failed
register: current_task

View file

@ -0,0 +1,2 @@
localhost

View file

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- radicale