-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add playbook and template for meta/main.yml
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# play: ansible-collection-meta | ||
# file: playbooks/meta.yml | ||
|
||
- name: "Play: generate meta/main.yml for roles inventory" | ||
hosts: all | ||
become: false | ||
gather_facts: true | ||
tasks: | ||
- name: "Ensure that role and meta directory exist" | ||
ansible.builtin.file: | ||
path: "{{ ansible_chroot_dir }}/meta" | ||
state: directory | ||
mode: "0755" | ||
|
||
- name: "Install ansible-lint" | ||
ansible.builtin.pip: | ||
name: ansible-lint | ||
state: present | ||
extra_args: "--user --upgrade" | ||
|
||
- name: "Generate meta/main.yml for role {{ meta_role_name }}" | ||
ansible.builtin.template: | ||
src: "main.yml.j2" | ||
dest: "{{ ansible_chroot_dir }}/meta/main.yml" | ||
mode: "0755" | ||
validate: "ansible-lint --strict %s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
# role: {{ meta_role_name }} | ||
# file: meta/main.yml | ||
|
||
galaxy_info: | ||
namespace: {{ meta_namespace }} | ||
role_name: {{ meta_role_name }} | ||
author: {{ meta_author }} | ||
company: {{ meta_company }} | ||
description: {{ meta_role_description }} | ||
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: | ||
{% for platform in meta_platforms %} | ||
- name: {{ platform.name }} | ||
versions: | ||
{% for version in platform.versions %} | ||
- {{ version }} | ||
{% endfor %} | ||
{% endfor %} | ||
{% endif %} | ||
{% if not meta_galaxy_tags %}galaxy_tags: []{% endif %} | ||
{% if meta_galaxy_tags %} | ||
galaxy_tags: | ||
{% for tag in meta_galaxy_tags %} | ||
- {{ tag }} | ||
{% endfor %} | ||
{% endif %} |