Need help prepare plugin for pull request

Hello, everyone.

I have made a plugin that I am finding extremely useful and would like to share, but I might need a bit of help preparing it for a proper pull request as I haven’t done that before.

It is a lookup plugin that merges all lists whose name maches a regex into one list. It is called matching_vars.

group_vars/mongodb.yml:
`
mongodb_rpms:

  • mongodb
  • pymongo
    `

group_vars/redis.yml:
`
redis_rpms:

  • redis
    `

roles/yum-install:
`

  • name: Install software
    yum:
    name: "{{ item }}
    with_maching_vars: “.*_rpms$” # <— The magic happens here
    `

playbook setup_devserver.yml:
`

  • hosts: devservers
    roles:

  • { role: yum-install, tags: yum }

  • hosts: devservers:&mongodb
    roles:

  • { role: mongodb, tags: mongodb }

  • hosts: devservers:&mongodb
    roles:

  • { role: mongodb, tags: mongodb }

`

I’m using this pattern all over now to define things as what services a role installs:
`
mongodb_services:

  • mongod
    `

Ports that needs to be opened
`
mongodb_firewall_ports:

  • protocol: tcp
    port: 27017
  • protocol: tcp
    port: 28017

`

And then have a firewalld role or other firewall generator.

Some background
In our setup we select roles based on groups with same name and have moved the roles’ defaults to group_vars. This allows us to extract current vars with a simple debug var=hostvars[ansible_hostname] and also build documentation of the different systems current state. It also has allowed us to split the responsibility for installation of software and configuring the software into different roles. (Because on different systems we have not always permission to install software ourselves and have to deliver the packages to a share). As much information about the systems in ansible lets us use it as a source for documentation. All roles have a common structure that allows easy extraction of information.