Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Last active February 2, 2021 02:27
Show Gist options
  • Save dmsimard/0a4375f1fa16877996f641459e73b84a to your computer and use it in GitHub Desktop.
Save dmsimard/0a4375f1fa16877996f641459e73b84a to your computer and use it in GitHub Desktop.
deps to galaxy requirements.yml
#!/usr/bin/env python3
import argparse
import yaml
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--depsfile", help="Path to the ansible.deps file", required=True)
args = parser.parse_args()
return args
def main():
args = get_args()
with open(args.depsfile) as f:
deps = f.readlines()
deps = [x.strip() for x in deps]
galaxy_reqs = []
for dep in deps:
if not dep.startswith("#") and not dep.startswith("_"):
collection, version = dep.split(":")
galaxy_reqs.append(dict(name=collection, version=version.strip()))
print(yaml.dump(galaxy_reqs, default_flow_style=False))
if __name__ == "__main__":
main()
# Generated by ./deps-to-galaxy.py
# From https://github.com/ansible-community/ansible-build-data/blob/main/2.10/ansible-2.10.6.deps
- name: amazon.aws
version: 1.3.0
- name: ansible.netcommon
version: 1.4.1
- name: ansible.posix
version: 1.1.1
- name: ansible.windows
version: 1.3.0
- name: arista.eos
version: 1.2.0
- name: awx.awx
version: 14.1.0
- name: azure.azcollection
version: 1.3.1
- name: check_point.mgmt
version: 1.0.6
- name: chocolatey.chocolatey
version: 1.0.2
- name: cisco.aci
version: 1.1.1
- name: cisco.asa
version: 1.0.4
- name: cisco.intersight
version: 1.0.10
- name: cisco.ios
version: 1.2.1
- name: cisco.iosxr
version: 1.2.0
- name: cisco.meraki
version: 2.1.3
- name: cisco.mso
version: 1.1.0
- name: cisco.nso
version: 1.0.2
- name: cisco.nxos
version: 1.3.1
- name: cisco.ucs
version: 1.6.0
- name: cloudscale_ch.cloud
version: 1.3.1
- name: community.aws
version: 1.3.0
- name: community.azure
version: 1.0.0
- name: community.crypto
version: 1.4.0
- name: community.digitalocean
version: 1.0.0
- name: community.docker
version: 1.2.0
- name: community.fortios
version: 1.0.0
- name: community.general
version: 1.3.5
- name: community.google
version: 1.0.0
- name: community.grafana
version: 1.1.0
- name: community.hashi_vault
version: 1.0.0
- name: community.hrobot
version: 1.1.0
- name: community.kubernetes
version: 1.1.1
- name: community.kubevirt
version: 1.0.0
- name: community.libvirt
version: 1.0.0
- name: community.mongodb
version: 1.1.2
- name: community.mysql
version: 1.2.0
- name: community.network
version: 1.3.1
- name: community.okd
version: 1.0.1
- name: community.postgresql
version: 1.1.0
- name: community.proxysql
version: 1.0.0
- name: community.rabbitmq
version: 1.0.1
- name: community.routeros
version: 1.1.0
- name: community.skydive
version: 1.0.0
- name: community.vmware
version: 1.6.0
- name: community.windows
version: 1.2.0
- name: community.zabbix
version: 1.2.0
- name: containers.podman
version: 1.4.1
- name: cyberark.conjur
version: 1.1.0
- name: cyberark.pas
version: 1.0.5
- name: dellemc.os10
version: 1.0.2
- name: dellemc.os6
version: 1.0.6
- name: dellemc.os9
version: 1.0.3
- name: f5networks.f5_modules
version: 1.7.1
- name: fortinet.fortimanager
version: 1.0.5
- name: fortinet.fortios
version: 1.1.8
- name: frr.frr
version: 1.0.3
- name: gluster.gluster
version: 1.0.1
- name: google.cloud
version: 1.0.1
- name: hetzner.hcloud
version: 1.2.1
- name: ibm.qradar
version: 1.0.3
- name: infinidat.infinibox
version: 1.2.4
- name: junipernetworks.junos
version: 1.2.1
- name: mellanox.onyx
version: 1.0.0
- name: netapp.aws
version: 20.9.0
- name: netapp.elementsw
version: 20.11.0
- name: netapp.ontap
version: 20.12.0
- name: netapp_eseries.santricity
version: 1.1.0
- name: netbox.netbox
version: 1.2.1
- name: ngine_io.cloudstack
version: 1.1.0
- name: ngine_io.exoscale
version: 1.0.0
- name: ngine_io.vultr
version: 1.0.0
- name: openstack.cloud
version: 1.2.1
- name: openvswitch.openvswitch
version: 1.1.0
- name: ovirt.ovirt
version: 1.2.4
- name: purestorage.flasharray
version: 1.5.1
- name: purestorage.flashblade
version: 1.4.0
- name: servicenow.servicenow
version: 1.0.3
- name: splunk.es
version: 1.0.2
- name: theforeman.foreman
version: 1.5.1
- name: vyos.vyos
version: 1.1.0
- name: wti.remote
version: 1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment