Skip to content

Commit

Permalink
feat: simplify meta_platforms dict
Browse files Browse the repository at this point in the history
  • Loading branch information
jomrr committed Feb 17, 2024
1 parent a3e3ca2 commit a10b67e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 7 additions & 3 deletions playbooks/templates/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ This role has no dependencies.
{% if meta_platforms %}
| OS Family | Distribution | Version | Container Image |
|-----------|--------------|---------|-----------------|
{% for platform in meta_platforms %}
{% for version in platform.versions %}
| {{ platform.os_family }} | {{ platform.distribution }} | {{ version }} | [{{ meta_namespace }}/molecule-{{ platform.distribution | lower }}:{{ version }}]( https://hub.docker.com/r/{{ meta_namespace }}/molecule-{{ platform.distribution | lower }}:{{ version }} ) |
{% for supported in meta_platforms %}
{% for tag in supported.tags %}
{% if loop.first %}
| {{ supported.os_family }} | {{ supported.distribution }} | {{ tag }} | [{{ meta_namespace }}/molecule-{{ supported.distribution | lower }}:{{ tag }}]( https://hub.docker.com/r/{{ meta_namespace }}/molecule-{{ supported.distribution | lower }}:{{ tag }} ) |
{% else %}
| | | {{ tag }} | [{{ meta_namespace }}/molecule-{{ supported.distribution | lower }}:{{ tag }}]( https://hub.docker.com/r/{{ meta_namespace }}/molecule-{{ supported.distribution | lower }}:{{ tag }} ) |
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
Expand Down
8 changes: 3 additions & 5 deletions playbooks/templates/meta_main.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ galaxy_info:
license: {{ meta_license }}
issue_tracker_url: {{ meta_issue_tracker_url }}
min_ansible_version: "{{ meta_min_ansible_version }}"
{% if not meta_platforms %}platforms: []{% endif %}
{% if meta_platforms %}
platforms:
{% if meta_platforms %}platforms:
{% for item in meta_platforms %}
- name: {{ item.platform.name }}
- name: {{ item.platform }}
versions:
{% for version in item.platform.versions %}
{% for version in item.versions %}
- {{ version }}
{% endfor %}
{% endfor %}
Expand Down

0 comments on commit a10b67e

Please sign in to comment.