Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove need for defaults, update Ubuntu support list #5

Merged
merged 6 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,30 @@ Zint, first delete `/usr/local/bin/zint`, then install the new version.

## Role Variables

See example playbook.
If these variables are not supplied, the role will just pull the latest version.

```yaml
zint_version: 2.13.0
zint_source: "https://sourceforge.net/projects/zint/files/zint/{{ zint_version }}/zint-{{ zint_version }}-src.tar.gz/download"
zint_source_checksum: 'sha256:a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8'
```

## Dependencies

None

## Example Playbook

```yaml
# Just download latest
- hosts: servers
- roles:
- name: Install Zint from source
role: acromedia.zint
tags:
- zint

# ...or download a specific version
- hosts: servers
- roles:
- name: Install Zint from source
Expand All @@ -33,12 +49,13 @@ None
zint_source_checksum: 'sha256:bd286d863bc60d65a805ec3e46329c5273a13719724803b0ac02e5b5804c596a'
tags:
- zint
```

## License

GPLv3

## Author Information

Acro Media Inc.
https://www.acromedia.com/
Acro Commerce Inc.
https://www.acrocommerce.com/
4 changes: 0 additions & 4 deletions defaults/main.yml

This file was deleted.

2 changes: 2 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ galaxy_info:
- name: Ubuntu
versions:
- focal
- jammy
- noble
namespace: acromedia
role_name: zint
galaxy_tags: []
Expand Down
1 change: 0 additions & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- name: Verify utilities are available
command: >
{{ item }}
with_items:
with_items:
- zint --help

19 changes: 19 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
- set_fact:
zint_local_source_base: /usr/local/src/zint

- name: Set zint version if not defined by sending a request to SourceForge
# https://sourceforge.net/projects/zint/best_release.json
uri:
url: "https://sourceforge.net/projects/zint/best_release.json"
return_content: yes
register: zint_version_result
when: zint_version is not defined

- set_fact:
# version can be grabbed from release.filename, which looks like /zint/<version>/zint-<version>-src.tar.gz
zint_version: "{{ zint_version_result.json.release.filename.split('/')[2] }}"
zint_source_checksum: "md5:{{ zint_version_result.json.release.md5sum }}"
when: zint_version is not defined

- name: Set source URL if not defined
set_fact:
zint_source: "https://sourceforge.net/projects/zint/files/zint/{{ zint_version }}/zint-{{ zint_version }}-src.tar.gz/download"
when: zint_source is not defined

- set_fact:
zint_local_source_gz: "{{ zint_local_source_base }}/zint-{{ zint_version }}.tar.gz"
zint_local_source_dir: "{{ zint_local_source_base }}/zint-{{ zint_version }}-src"
Expand Down
Loading