diff --git a/roles/radicale/defaults/main.yml b/roles/radicale/defaults/main.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/radicale/meta/argument_specs.yml b/roles/radicale/meta/argument_specs.yml index ee38a4d..1151338 100644 --- a/roles/radicale/meta/argument_specs.yml +++ b/roles/radicale/meta/argument_specs.yml @@ -3,10 +3,47 @@ argument_specs: # roles/myapp/tasks/main.yml entry point main: short_description: Build a radicale docker image and run a radicale docker container. - options: {} + options: + radicale_data_volume: + description: Volume for radicale data + type: str + required: false + default: radicale + radicale_build_path: + description: Path to docker image build directory + type: str + required: false + default: /srv/build_containers/radicale + force_recreate: + description: Force build and recreate container + type: bool + required: false + default: false + build: short_description: Build a radicale docker image - options: {} + options: + radicale_build_path: + description: Path to docker image build directory + type: str + required: false + default: /srv/build_containers/radicale + force_recreate: + description: Force build + type: bool + required: false + default: false + run: short_description: Run a radicale docker container - options: {} + options: + radicale_data_volume: + description: Volume for radicale data + type: str + required: false + default: radicale + force_recreate: + description: Force recreate container + type: bool + required: false + default: false diff --git a/roles/radicale/meta/main.yml b/roles/radicale/meta/main.yml index 53ad9b6..d5e73cf 100644 --- a/roles/radicale/meta/main.yml +++ b/roles/radicale/meta/main.yml @@ -1,40 +1,12 @@ galaxy_info: author: Frank Adaemmer 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. diff --git a/roles/radicale/tasks/build.yml b/roles/radicale/tasks/build.yml index e55aff1..e97dbcf 100644 --- a/roles/radicale/tasks/build.yml +++ b/roles/radicale/tasks/build.yml @@ -1,10 +1,19 @@ --- +- name: Copy Dockerfile and config + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ radicale_build_path }}/{{ item }}" + mode: 0644 + loop: + - Dockerfile + - radicale.conf + - name: Build radicale image community.docker.docker_image: name: radicale tag: latest build: - path: "{{ radicale_build_path | default('/srv/radicale') }}" + path: "{{ radicale_build_path }}" pull: true nocache: "{{ force_recreate | default(false) }}" source: build