Skip to content

Commit

Permalink
all the stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Aug 25, 2021
1 parent 8ce1069 commit 043b560
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 91 deletions.
93 changes: 8 additions & 85 deletions docker/devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,91 +6,14 @@ COPY execute.sh /execute.sh
COPY playbook.yml /playbook.yml

RUN set -x && \
apk add --no-cache python3 py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml-dev && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community rust cargo && \
apk add --no-cache python3 py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml-dev rust cargo && \
pip3 install -U pip && \
pip3 install https://github.com/ansible/ansible/archive/devel.tar.gz jmespath netaddr && \
apk del openssl-dev python3-dev libffi-dev gcc make musl musl-dev git yaml pkgconf rust cargo

RUN set -x && \
ansible-galaxy collection install --pre \
amazon.aws \
ansible.netcommon \
ansible.posix \
ansible.windows \
arista.eos \
awx.awx \
azure.azcollection \
check_point.mgmt \
chocolatey.chocolatey \
cisco.aci \
cisco.asa \
cisco.intersight \
cisco.ios \
cisco.iosxr \
cisco.meraki \
cisco.mso \
cisco.nso \
cisco.nxos \
cisco.ucs \
cloudscale_ch.cloud \
community.aws \
community.azure \
community.crypto \
community.digitalocean \
community.docker \
community.general \
community.grafana \
community.hrobot \
community.kubernetes \
community.libvirt \
community.mongodb \
community.mysql \
community.network \
community.okd \
community.postgresql \
community.proxysql \
community.rabbitmq \
community.routeros \
community.skydive \
community.vmware \
community.windows \
community.zabbix \
containers.podman \
cyberark.conjur \
cyberark.pas \
dellemc.os10 \
dellemc.os6 \
dellemc.os9 \
f5networks.f5_modules \
fortinet.fortimanager \
fortinet.fortios \
frr.frr \
gluster.gluster \
google.cloud \
hetzner.hcloud \
ibm.qradar \
infinidat.infinibox \
junipernetworks.junos \
mellanox.onyx \
netapp.aws \
netapp.elementsw \
netapp_eseries.santricity \
netapp.ontap \
netbox.netbox \
ngine_io.cloudstack \
ngine_io.exoscale \
ngine_io.vultr \
openstack.cloud \
openvswitch.openvswitch \
ovirt.ovirt \
purestorage.flasharray \
purestorage.flashblade \
servicenow.servicenow \
splunk.es \
theforeman.foreman \
vyos.vyos \
wti.remote && \
python3 /tmp/clean_collections.py
pip3 install jmespath netaddr && \
pip3 install --no-compile ansible && \
pip3 install -U https://github.com/ansible/ansible/archive/devel.tar.gz && \
apk del py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml rust cargo && \
python3 /tmp/clean_collections.py && \
rm -rf /root/.cache && \
rm -rf /root/.cargo

CMD ["/bin/sh", "/execute.sh"]
7 changes: 6 additions & 1 deletion docker/devel/clean_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import os
import shutil
import ansible_collections

root = '/root/.ansible/collections/ansible_collections'
root = ansible_collections.__path__[0]

for namespace in os.listdir(root):
namespace = os.path.join(root, namespace)
Expand All @@ -21,3 +22,7 @@
shutil.rmtree(path)
else:
os.unlink(path)
else:
modules = os.path.join(path, 'modules')
if os.path.isdir(modules):
shutil.rmtree(modules)
14 changes: 9 additions & 5 deletions docker/stable/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM alpine
MAINTAINER Matt Martz <[email protected]>

COPY clean_collections.py /tmp/clean_collections.py
COPY execute.sh /execute.sh
COPY playbook.yml /playbook.yml

RUN set -x && \
apk add --no-cache python3 py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml-dev && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community rust cargo && \
apk add --no-cache python3 py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml-dev rust cargo && \
pip3 install -U pip && \
pip3 install ansible jmespath netaddr && \
apk del openssl-dev python3-dev libffi-dev gcc make musl musl-dev git yaml pkgconf rust cargo
apk del py3-pip openssl-dev python3-dev libffi-dev ca-certificates gcc make musl-dev git yaml rust cargo && \
python3 /tmp/clean_collections.py && \
rm -rf /root/.cache && \
rm -rf /root/.cargo

COPY execute.sh /execute.sh
COPY playbook.yml /playbook.yml

CMD ["/bin/sh", "/execute.sh"]
28 changes: 28 additions & 0 deletions docker/stable/clean_collections.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3

import os
import shutil
import ansible_collections

root = ansible_collections.__path__[0]

for namespace in os.listdir(root):
namespace = os.path.join(root, namespace)
if not os.path.isdir(namespace):
continue
for collection in os.listdir(namespace):
collection = os.path.join(namespace, collection)
if not os.path.isdir(collection):
continue
for path in os.listdir(collection):
path = os.path.join(collection, path)
basename = os.path.basename(path)
if basename != 'plugins':
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.unlink(path)
else:
modules = os.path.join(path, 'modules')
if os.path.isdir(modules):
shutil.rmtree(modules)

0 comments on commit 043b560

Please sign in to comment.