commit ba88926e62566b22dd4846028aeab7e21cae9f23 Author: Laur Ivan Date: Fri Sep 29 15:17:33 2023 +0200 Initial commit. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..2da2ded --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: equinoxel +patreon: laurivan \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..960f91b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,49 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + + + +### Description + +[Description of the issue] + +### Steps to Reproduce + +1. [First Step] +2. [Second Step] +3. [and so on...] + +**Expected behavior:** +[What you expect to happen] + +**Actual behavior:** +[What actually happens] + +**Reproduces how often:** +[What percentage of the time does it reproduce?] + +### Environment + +- The release version/s you are using: +- OS: +- Ansible Version: +- Python Version: +- Others: +### Additional Information + +[Any additional information, configuration or data that might be necessary to reproduce the issue.] diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f3aad96 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,3 @@ +--- + +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9b2e2d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,31 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + + + +### Description + +[Description of the issue] + +### Why is this needed? + +[A clear and concise description of why do you think this is needed] + +### Additional Information + +[Any additional information, configuration or data.] diff --git a/.github/ISSUE_TEMPLATE/refactor.md b/.github/ISSUE_TEMPLATE/refactor.md new file mode 100644 index 0000000..8d7bff6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/refactor.md @@ -0,0 +1,27 @@ +--- +name: Refactor +about: Found anything to refactor in this project? +title: "[REFACTOR]" +labels: clean-up +assignees: '' + +--- + + + +### Description + +[Description of the issue] + +### Link/s to the specific code that needs a refactor (if applicable) + +[Links] \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 0000000..a5a9e07 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,27 @@ +--- +name: Support Request +about: Support request or question about this project +title: "[SUPPORT]" +labels: question +assignees: '' + +--- + + + +### Description + +[Description of the issue] + +### Additional Information + +Any additional information, configuration or data that might be necessary to reproduce the issue. \ No newline at end of file diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..c765ed1 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,33 @@ +--- +issues: + # Number of days of inactivity before an issue becomes stale + daysUntilStale: 90 + # Number of days of inactivity before a stale issue is closed + daysUntilClose: 7 + # Issues with these labels will never be considered stale + exemptLabels: + - "pinned" + - "security" + - "good first issue" + # Label to use when marking an issue as stale + staleLabel: wontfix + # Comment to post when marking an issue as stale. Set to `false` to disable + markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + # Comment to post when closing a stale issue. Set to `false` to disable + closeComment: false + +pulls: + # Number of days of inactivity before a pull request becomes stale + daysUntilStale: 90 + # Number of days of inactivity before a stale pull request is closed + daysUntilClose: 7 + # Comment to post when marking a pull request as stale. Set to `false` to disable + markComment: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + # Comment to post when closing a stale pull request. Set to `false` to disable + closeComment: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..7fa8755 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for macvlan diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..a5baf58 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for macvlan diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # 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: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # 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: 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 + # 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. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/molecule/default/create.yml b/molecule/default/create.yml new file mode 100644 index 0000000..371214e --- /dev/null +++ b/molecule/default/create.yml @@ -0,0 +1,36 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: 0600 diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml new file mode 100644 index 0000000..5ba2d23 --- /dev/null +++ b/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: 0600 + when: server.changed | default(false) | bool # noqa no-handler diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/tasks/create.yml b/tasks/create.yml new file mode 100644 index 0000000..e69de29 diff --git a/tasks/delete.yml b/tasks/delete.yml new file mode 100644 index 0000000..e69de29 diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..5c0336d --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for macvlan diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..ed82ef9 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,6 @@ +ansible==7.2.0 +molecule==4.0.4 +docker==6.1.3 +molecule-docker==2.1.0 +ansible-lint==6.14.4 +yamllint==1.30.0 \ No newline at end of file diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..adbca14 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - macvlan diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..e78d2cf --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for macvlan