From 84357b6fc578112a13f232cc067a8485379257e8 Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Sat, 12 Mar 2022 00:20:43 +0100 Subject: [PATCH] Fix: Execution environment files (#466) --- .gitignore | 2 +- ansible_collections/arista/cvp/bindep.txt | 7 ++++++ .../arista/cvp/meta/execution-environment.yml | 23 ++++--------------- execution-environment.yml | 19 ++++++--------- 4 files changed, 19 insertions(+), 32 deletions(-) create mode 100644 ansible_collections/arista/cvp/bindep.txt diff --git a/.gitignore b/.gitignore index 5573afd3e..915455ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -53,7 +53,7 @@ assets *context/ *_build/ Containerfile - +Dockerfile # Translations *.mo diff --git a/ansible_collections/arista/cvp/bindep.txt b/ansible_collections/arista/cvp/bindep.txt new file mode 100644 index 000000000..a0c3a98bd --- /dev/null +++ b/ansible_collections/arista/cvp/bindep.txt @@ -0,0 +1,7 @@ +make +wget +curl +less +git +vim +sshpass diff --git a/ansible_collections/arista/cvp/meta/execution-environment.yml b/ansible_collections/arista/cvp/meta/execution-environment.yml index f805c46e1..b38ea2fa5 100644 --- a/ansible_collections/arista/cvp/meta/execution-environment.yml +++ b/ansible_collections/arista/cvp/meta/execution-environment.yml @@ -1,24 +1,9 @@ # execution-environment.yml +# Read by ansible-builder when this collection is a dependency for an execution-environment --- version: 1 -build_arg_defaults: - EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest' - dependencies: - galaxy: ../collections.yml - python: ../requirements.txt - -additional_build_steps: - prepend: | - RUN pip install --upgrade pip setuptools - RUN yum install -y \ - make \ - wget \ - curl \ - less \ - git \ - vim \ - sshpass - append: - - RUN ansible-galaxy collection install arista.cvp + galaxy: collections.yml + python: requirements.txt + system: bindep.txt diff --git a/execution-environment.yml b/execution-environment.yml index 526260242..4880e25b5 100644 --- a/execution-environment.yml +++ b/execution-environment.yml @@ -1,25 +1,20 @@ # execution-environment.yml +# Used to create image from cloned directory instead of galaxy +# Run from root of repo +# Example: +# ansible-builder build --container-runtime=docker --tag=arista-cvp-runner --verbosity 3 -c . --- version: 1 build_arg_defaults: - EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest' + EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:stable-2.12-latest' + ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--force --verbose' dependencies: galaxy: ansible_collections/arista/cvp/collections.yml python: ansible_collections/arista/cvp/requirements.txt + system: ansible_collections/arista/cvp/bindep.txt additional_build_steps: - prepend: | - RUN pip install --upgrade pip setuptools - RUN yum install -y \ - make \ - wget \ - curl \ - less \ - git \ - vim \ - sshpass append: - COPY ansible_collections/arista/cvp/ /usr/share/ansible/collections/ansible_collections/arista/cvp - - RUN ls -la /usr/share/ansible/collections/ansible_collections/arista