From 0c4d2deaee4171564fb7487b8d53d2bb1aee4348 Mon Sep 17 00:00:00 2001 From: Alex Dworjan Date: Fri, 1 Dec 2023 11:29:23 -0500 Subject: [PATCH] added new role to build for dev spaces --- .ansible-sign/sha256sum.txt | 9 + .ansible-sign/sha256sum.txt.sig | 22 +- .../defaults/main.yml | 89 ++++++++ roles/build_shadowmandevspaces/tasks/main.yml | 83 +++++++ .../templates/.bashrc.j2 | 11 + .../templates/ansible.cfg.j2 | 19 ++ .../templates/bindep.txt.j2 | 7 + .../templates/execution-environment.yml.j2 | 208 ++++++++++++++++++ .../templates/requirements.txt.j2 | 7 + .../templates/requirements.yml.j2 | 21 ++ .../templates/shells.j2 | 4 + 11 files changed, 469 insertions(+), 11 deletions(-) create mode 100644 roles/build_shadowmandevspaces/defaults/main.yml create mode 100644 roles/build_shadowmandevspaces/tasks/main.yml create mode 100644 roles/build_shadowmandevspaces/templates/.bashrc.j2 create mode 100644 roles/build_shadowmandevspaces/templates/ansible.cfg.j2 create mode 100644 roles/build_shadowmandevspaces/templates/bindep.txt.j2 create mode 100644 roles/build_shadowmandevspaces/templates/execution-environment.yml.j2 create mode 100644 roles/build_shadowmandevspaces/templates/requirements.txt.j2 create mode 100644 roles/build_shadowmandevspaces/templates/requirements.yml.j2 create mode 100644 roles/build_shadowmandevspaces/templates/shells.j2 diff --git a/.ansible-sign/sha256sum.txt b/.ansible-sign/sha256sum.txt index e953a92..d497c52 100644 --- a/.ansible-sign/sha256sum.txt +++ b/.ansible-sign/sha256sum.txt @@ -21,6 +21,15 @@ e7282f4ae9f746f2f962f83e8362230b5796e3cecd1b7d7320a9cb024eb4c0d9 roles/build_sh dfc5b5bd8bca161bb5eb0070a57368a51aabe34f27a1265ce3b7051ea3fa0268 roles/build_shadowmande/templates/execution-environment.yml.j2 6f273601ee34e1968ff8708287f00723f16152ced76b9494d4d2bf312a5ead80 roles/build_shadowmande/templates/requirements.txt.j2 f46e5f6f46cb53820c812cec1a28a59825476c846d13f65fda8dde4105087f3a roles/build_shadowmande/templates/requirements.yml.j2 +bb79735d36584fceef8e28f77a85cb19d7bec94f71c0c834348f088293a1af53 roles/build_shadowmandevspaces/defaults/main.yml +b3e28a736267063aab070e2bbd0d38da5d889d9ea16844968395e54f62b2ae4f roles/build_shadowmandevspaces/tasks/main.yml +e78d092fe7df758f58cada57dfd2c97fadcc8dfbdc85f94db62c7b2742c3e5f7 roles/build_shadowmandevspaces/templates/.bashrc.j2 +9ba220badf4c14eb524d3ddcec9474e329147c880e50c14d5899367178613e33 roles/build_shadowmandevspaces/templates/ansible.cfg.j2 +17850229c3d90fd93f419d4a9f32b267207c52d5c1e5fceaf4a8470d8852945f roles/build_shadowmandevspaces/templates/bindep.txt.j2 +dfc5b5bd8bca161bb5eb0070a57368a51aabe34f27a1265ce3b7051ea3fa0268 roles/build_shadowmandevspaces/templates/execution-environment.yml.j2 +6f273601ee34e1968ff8708287f00723f16152ced76b9494d4d2bf312a5ead80 roles/build_shadowmandevspaces/templates/requirements.txt.j2 +f46e5f6f46cb53820c812cec1a28a59825476c846d13f65fda8dde4105087f3a roles/build_shadowmandevspaces/templates/requirements.yml.j2 +d819e57a6d12fd03b6a6efaac051889db057daf9d4fb1fde06e414c50ca6f69c roles/build_shadowmandevspaces/templates/shells.j2 2adf1aec14431be9889dfbed1b02225922bc7279c3e3aa940b5267dda717907c roles/build_shadowmanee/defaults/main.yml 2e3b21325488ff21a2e32fe9820e59089fd0f79df537373537db8ef03a40ec26 roles/build_shadowmanee/tasks/main.yml 9ba220badf4c14eb524d3ddcec9474e329147c880e50c14d5899367178613e33 roles/build_shadowmanee/templates/ansible.cfg.j2 diff --git a/.ansible-sign/sha256sum.txt.sig b/.ansible-sign/sha256sum.txt.sig index afa0c44..603abe3 100644 --- a/.ansible-sign/sha256sum.txt.sig +++ b/.ansible-sign/sha256sum.txt.sig @@ -1,14 +1,14 @@ -----BEGIN PGP SIGNATURE----- -iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVNRfgACgkQTiIiIXrU -DNFGcwv9E27tPzmZ4somALbAjJ86sSOnDBu0IQHdXt3ZU4Ye2Ea02kTrUigKE17q -hjqG33X6vfiJmoXA/64Q/YQzvtYoYPcN4NoTviJGkVmhF5Q6zis/m2p2B09mWCD4 -RHHrTj4wAT/8puMXeqIeFagi6bDYZnW7Bx5vDLkVVQew8cg2UNKf55S/FSzmGMzt -f8UfUAwJEpuwQWb/HFNi/yP/9IDfRbR7JMhZhXOcNZ352epTYrzMUWG5GFklziTI -eA8g2CeFTJb2z+am6viHP5D2QQtKU9LyojVhk+9f0YyUkEsD5BTpBiR0ZfZHbbAS -TrOgBWSHkSFdDMjyyubTOQmu9AExEdDx+c3rW6lpNZC/KsuP6MbbWmJ2X4oXWZDC -jkZ7xIcTo5XQlxONA2NZHAEfYgr7NOdDSRFr4HWaDIQ8vx7GdhLXWkGU8Leo40wu -q4zn3u3CaDKpboqWF9sfvEzyGXoL6pWlSPdy6U4rGFd1qC5SdrZuo8NZeVzVN0B2 -cC2OsWVG -=wS52 +iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVqCc4ACgkQTiIiIXrU +DNFHBgwArCxo9FM4VSLHk2RYQ+R0AfvSsLqmx9lhSurCErHQ6NTNp2bQjIkc8na5 +ee5ZmyqVz9Uso+B/sNei7q7RbB7xTaU02Z5trbTJ9sXbTqlcab/U/svInvScrQCL +CNecgAv8hNfn2Mc6yx4KKNCuyf4/kErP1EKuUrVwvMIrpyl9RFNEnz8EcEx9qxAP +cRWNucHsRRu1CQrxuIZf2EsE5AsL1NSgYuMWMBFfLmoCot0FzGakUTG+a1C2n1Cg +nRtrvozbLLD9a1rbvVWtahHybGuz+BCVHbtLGndxNSHH0s5iGFAHDXSwC+tPuSXH +knVOBulIU7Fg3xG6TvLuTI/mEEMN0qR+U2r65TSlUXAnG8h11CC2oMYEljZrNMGh +iB3b1UFFG6OOHg3Le06RjJdVFSoSSTW9ylGrDIpiSJsAnp3lWwWoT3LQ/jehsr22 +fVGJ10O0yM/0Y+UCDomv7FRODb51JgI+t+l9iGda0WklHAA23NuQEuekQGkm/oJr +IgUeStCS +=N8pD -----END PGP SIGNATURE----- diff --git a/roles/build_shadowmandevspaces/defaults/main.yml b/roles/build_shadowmandevspaces/defaults/main.yml new file mode 100644 index 0000000..c610621 --- /dev/null +++ b/roles/build_shadowmandevspaces/defaults/main.yml @@ -0,0 +1,89 @@ +--- +ee_version: 3 +dest_dir: /home/adworjan/ansible/builder/shadowmaneedev/ +pah_name: towerpah.shadowman.dev +image_name: shadowmaneedev +bindep_file: bindep.txt +python_requirements_file: requirements.txt +galaxy_requirements_file: requirements.yml +ee_base_image: towerpah.shadowman.dev/ansible-automation-platform/ee-minimal-rhel8:2.15 +ee_base_sig_name: registry.redhat.io/ansible-automation-platform/ee-minimal-rhel8:2.15 +galaxy_keyring: /home/adworjan/ansible/builder/shadowmanee/fullkeyring.kbx +ee_package_manager_path: /usr/bin/microdnf +ee_build_files: + - src: /home/adworjan/ansible/builder/shadowmaneedev/ansible.cfg + dest: configs + - src: /home/adworjan/ansible/builder/shadowmaneedev/.bashrc + dest: configs + - src: /home/adworjan/ansible/builder/shadowmaneedev/shells + dest: configs +ee_bindep: + - python3-jinja2 [platform:rpm] + - which [platform:rpm] + - git [platform:rpm] + - libcurl-devel [platform:rpm] + - gcc [platform:rpm] + - python39-devel [platform:rpm] + - openssl-devel [platform:rpm] + - libxml2-devel [platform:rpm] + - libxslt-devel [platform:rpm] +ee_python: + - scp + - pyats + - genie + - python-jenkins + - pan-os-python==1.8.0 + - pan-python==0.17.0 + - panos-upgrade-assurance==0.3.0 +ee_collections: + - name: ansible.windows + - name: community.windows + - name: microsoft.ad + - name: ansible.posix + - name: vmware.vmware_rest + version: 1.0.1 + - name: ansible.netcommon + - name: ansible.utils + - name: community.crypto + - name: community.general + - name: community.vmware + - name: cloud.terraform + - name: servicenow.itsm + - name: vyos.vyos + - name: cisco.ios + - name: arista.eos + - name: infra.osbuild + - name: azure.azcollection + - name: f5networks.f5_modules + - name: citrix.adc + - name: shadowman.reports + - name: redhat.rhv + - name: redhat.satellite + - name: redhat.insights + - name: ansible.controller + - name: paloaltonetworks.panos + - name: ibm.qradar + - name: containers.podman + - name: community.postgresql + - name: redhat.openshift +ee_prepend_galaxy: + - ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg +ee_prepend_builder: + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.13-for-rhel-8-x86_64-rpms" +ee_prepend_final: + - ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.13-for-rhel-8-x86_64-rpms" +ee_append_final: + - RUN microdnf install -y yum-utils + - RUN dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo + - RUN dnf install -y terraform + - RUN microdnf reinstall tzdata -y + - RUN git clone -b citrix.adc --single-branch https://github.com/netscaler/ansible-collection-netscaleradc.git /tmp/citrix + - RUN pip3 install /tmp/citrix/deps/nitro-python-1.0_kamet.tar.gz + - RUN rm -rf /tmp/citrix/ + - RUN rm -f /etc/ansible/ansible.cfg + - RUN microdnf clean all + - RUN dnf clean all + - COPY _build/configs/shells /etc/shells + - COPY _build/configs/.bashrc /home/runner/.bashrc + - RUN printf "export CONTAINER_NAME=ansibleee\n" >> /home/runner/.bashrc + - RUN for dir in /home/runner /home/runner/.ansible /home/runner/.ansible/tmp /runner /home/runner /runner/env /runner/inventory /runner/project /runner/artifacts ; do mkdir -m 0775 -p $dir ; chmod -R g+rwx $dir ; chgrp -R root $dir ; done && for file in /home/runner/.ansible/galaxy_token /etc/passwd /etc/group ; do touch $file ; chmod g+rw $file ; chgrp root $file ; done diff --git a/roles/build_shadowmandevspaces/tasks/main.yml b/roles/build_shadowmandevspaces/tasks/main.yml new file mode 100644 index 0000000..bc76a22 --- /dev/null +++ b/roles/build_shadowmandevspaces/tasks/main.yml @@ -0,0 +1,83 @@ +--- +- name: Pull builder images + containers.podman.podman_image: + name: "{{ item }}" + username: "{{ pah_user }}" + password: "{{ pah_pass }}" + force: true + loop: + - "{{ ee_base_image }}" + # - "{{ ee_builder_image }}" + when: ee_version == 1 or ee_version == 3 + +- name: Login to PAH + containers.podman.podman_login: + username: "{{ pah_user }}" + password: "{{ pah_pass }}" + registry: "{{ pah_name }}" + when: ee_version == 2 + +- name: Delete old EE + containers.podman.podman_image: + name: "{{ pah_name }}/{{ image_name }}" + state: absent + force: true + +- name: Template out builder files + ansible.builtin.template: + src: "{{ item }}.j2" + dest: "{{ dest_dir }}{{ item }}" + owner: root + group: root + mode: '0644' + loop: + - ansible.cfg + - bindep.txt + - execution-environment.yml + - requirements.txt + - requirements.yml + - shells + - .bashrc + +- name: Build new EE on version 1 or 3 without signature verification + ansible.builtin.command: + cmd: 'ansible-builder build -t {{ pah_name }}/{{ image_name }} --prune-images --galaxy-keyring={{ galaxy_keyring }}' + chdir: "{{ dest_dir }}" + changed_when: true + when: ee_version == 1 or ee_version == 3 + +- name: Build new EE with container signature verification on version 2 + ansible.builtin.command: + cmd: 'ansible-builder build -t {{ pah_name }}/{{ image_name }} --prune-images --galaxy-keyring={{ galaxy_keyring }} --container-policy=system' + chdir: "{{ dest_dir }}" + changed_when: true + when: ee_version == 2 + +- name: Create new tag on EE based on date time of creation + containers.podman.podman_tag: + image: "{{ pah_name }}/{{ image_name }}" + target_names: + - "{{ pah_name }}/{{ image_name }}:{{ ansible_date_time.iso8601_basic_short }}" + +- name: Push new EE + containers.podman.podman_image: + name: "{{ pah_name }}/{{ image_name }}" + tag: "{{ item }}" + push: true + username: "{{ pah_user }}" + password: "{{ pah_pass }}" + loop: + - "{{ ansible_date_time.iso8601_basic_short }}" + - latest + +- name: Remove extra tag + containers.podman.podman_image: + name: "{{ pah_name }}/{{ image_name }}" + tag: "{{ ansible_date_time.iso8601_basic_short }}" + state: absent + +- name: Update Execution Environment Version in Controller with new version + ansible.controller.execution_environment: + name: "Automation Hub Shadowman execution environment" + image: "{{ pah_name }}/{{ image_name }}:{{ ansible_date_time.iso8601_basic_short }}" + delegate_to: localhost diff --git a/roles/build_shadowmandevspaces/templates/.bashrc.j2 b/roles/build_shadowmandevspaces/templates/.bashrc.j2 new file mode 100644 index 0000000..bf21305 --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/.bashrc.j2 @@ -0,0 +1,11 @@ +#!/bin/bash +PROMPT_COMMAND=__prompt_command + +__prompt_command() { + local RC="$?" + RC_MSG="" + if [ "$RC" != 0 ]; then + RC_MSG="\[$(tput sgr0)\]\[\033[38;5;9m\]$RC\[$(tput sgr0)\]" + fi + PS1="\[\033[38;5;56m\]\u\[$(tput sgr0)\]\[\033[38;5;8m\]@\[$(tput sgr0)\]\[\033[38;5;130m\]${CONTAINER_NAME}\[$(tput sgr0)\]: \[$(tput sgr0)\]\[\033[38;5;25m\]\w\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;28m\]\$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')\[$(tput sgr0)\]$RC_MSG\n\\$ \[$(tput sgr0)\]" +} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/ansible.cfg.j2 b/roles/build_shadowmandevspaces/templates/ansible.cfg.j2 new file mode 100644 index 0000000..54396f5 --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/ansible.cfg.j2 @@ -0,0 +1,19 @@ +[galaxy] +server_list = automation_hub_cert,automation_hub_pub,automation_hub_comm,automation_hub_val +ignore_certs = yes + +[galaxy_server.automation_hub_cert] +url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/rh-certified/ +token={{ lookup('env', 'AH_API_TOKEN') }} + +[galaxy_server.automation_hub_pub] +url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/published/ +token={{ lookup('env', 'AH_API_TOKEN') }} + +[galaxy_server.automation_hub_comm] +url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/community/ +token={{ lookup('env', 'AH_API_TOKEN') }} + +[galaxy_server.automation_hub_val] +url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/validated/ +token={{ lookup('env', 'AH_API_TOKEN') }} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/bindep.txt.j2 b/roles/build_shadowmandevspaces/templates/bindep.txt.j2 new file mode 100644 index 0000000..25a935e --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/bindep.txt.j2 @@ -0,0 +1,7 @@ +{% if ee_bindep is defined %} +{% if ee_bindep|length %} +{% for item in ee_bindep %} +{{ item }} +{% endfor %} +{% endif %} +{% endif %} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/execution-environment.yml.j2 b/roles/build_shadowmandevspaces/templates/execution-environment.yml.j2 new file mode 100644 index 0000000..c22d8b5 --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/execution-environment.yml.j2 @@ -0,0 +1,208 @@ +--- +version: {{ ee_version }} + +{% if ( (galaxy_cli_opts is defined) or + ( (ee_base_image is defined or ee_builder_image is defined) and + ee_version == 1 ) ) %} +build_arg_defaults: +{% if galaxy_cli_opts is defined %} +{% if galaxy_cli_opts|length %} + ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: "{{ galaxy_cli_opts }}" +{% endif %} +{% endif %} +{% endif %} +{% if ee_version == 1 %} +{% if ee_base_image is defined %} +{% if ee_base_image|length %} + EE_BASE_IMAGE: {{ ee_base_image }} +{% endif %} +{% endif %} +{% if ee_builder_image is defined %} +{% if ee_builder_image|length %} + EE_BUILDER_IMAGE: {{ ee_builder_image }} +{% endif %} +{% endif %} +{% endif %} + +{% if ansible_config is defined %} +ansible_config: '{{ ansible_config }}' +{% endif %} + +{% if (ee_bindep is defined and ee_bindep|length ) or + (ee_ansible_core is defined and ee_ansible_core|length ) or + (ee_ansible_runner is defined and ee_ansible_runner|length ) or + (ee_python_interpreter is defined and ee_python_interpreter|length ) or + (ee_python is defined and ee_python|length ) or + (ee_collections is defined and ee_collections|length) %} +dependencies: +{% if ee_ansible_core is defined %} +{% if ee_ansible_core|length %} + ansible_core: + package_pip: {{ ee_ansible_core }} +{% endif %} +{% endif %} +{% if ee_ansible_runner is defined %} +{% if ee_ansible_runner|length %} + ansible_runner: + package_pip: {{ ee_ansible_runner }} +{% endif %} +{% endif %} +{% if ee_python_interpreter.package_system is defined or ee_python_interpreter.python_path is defined %} +{% if ee_python_interpreter|length %} + python_interpreter: +{% if ee_python_interpreter.package_system is defined %} + package_system: {{ ee_python_interpreter.package_system }} +{% endif %} +{% if ee_python_interpreter.python_path is defined %} + python_path: {{ ee_python_interpreter.python_path }} +{% endif %} +{% endif %} +{% endif %} +{% if ee_collections is defined %} +{% if ee_collections|length %} + galaxy: {{ galaxy_requirements_file }} +{% endif %} +{% endif %} +{% if ee_python is defined %} +{% if ee_python|length %} + python: {{ python_requirements_file }} +{% endif %} +{% endif %} +{% if ee_bindep is defined %} +{% if ee_bindep|length %} + system: {{ bindep_file }} +{% endif %} +{% endif %} +{% endif %} + +{% if ee_build_files is defined %} +{% if ee_build_files|length %} +additional_build_files: +{% for item in ee_build_files %} + - src: {{ item.src }} + dest: {{ item.dest }} +{% endfor %} +{% endif %} +{% endif %} + +{% if ee_version == 1 or ee_version == 2 %} +{% if (ee_prepend is defined and ee_prepend|length) or (ee_append is defined and ee_append|length) %} +additional_build_steps: +{% if (ee_prepend is defined and ee_prepend|length) %} prepend: +{% for item in ee_prepend %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_append is defined and ee_append|length) %} append: +{% for item in ee_append %} + - {{ item }} +{% endfor %} +{% endif %} +{% endif %} +{% endif %} +{% if ee_version == 3 %} +{% if (ee_prepend_base is defined and ee_prepend_base|length) or + (ee_append_base is defined and ee_append_base|length) or + (ee_prepend_galaxy is defined and ee_prepend_galaxy|length) or + (ee_append_galaxy is defined and ee_append_galaxy|length) or + (ee_prepend_builder is defined and ee_prepend_builder|length) or + (ee_append_builder is defined and ee_append_builder|length) or + (ee_prepend_final is defined and ee_prepend_final|length) or + (ee_append_final is defined and ee_append_final|length) %} +additional_build_steps: +{% if (ee_prepend_base is defined and ee_prepend_base|length) %} prepend_base: +{% for item in ee_prepend_base %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_append_base is defined and ee_append_base|length) %} append_base: +{% for item in ee_append_base %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_prepend_galaxy is defined and ee_prepend_galaxy|length) %} prepend_galaxy: +{% for item in ee_prepend_galaxy %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_append_galaxy is defined and ee_append_galaxy|length) %} append_galaxy: +{% for item in ee_append_galaxy %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_prepend_builder is defined and ee_prepend_builder|length) %} prepend_builder: +{% for item in ee_prepend_builder %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_append_builder is defined and ee_append_builder|length) %} append_builder: +{% for item in ee_append_builder %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_prepend_final is defined and ee_prepend_final|length) %} prepend_final: +{% for item in ee_prepend_final %} + - {{ item }} +{% endfor %} +{% endif %} +{% if (ee_append_final is defined and ee_append_final|length) %} append_final: +{% for item in ee_append_final %} + - {{ item }} +{% endfor %} +{% endif %} +{% endif %} + +{% if ee_container_init is defined or + ee_package_manager_path is defined or + ee_skip_ansible_check is defined or + ee_relax_passwd_permissions is defined or + ee_workdir is defined or + ee_user is defined %} +options: +{% if ee_container_init is defined %} + container_init: + package_pip: ee_container_init.package_pip + entrypoint: ee_container_init.entrypoint + cmd: ee_container_init.cmd +{% endif %} +{% if ee_package_manager_path is defined %} + package_manager_path: {{ ee_package_manager_path }} +{% endif %} +{% if ee_skip_ansible_check is defined %} + skip_ansible_check: {{ ee_skip_ansible_check }} +{% endif %} +{% if ee_relax_passwd_permissions is defined %} + relax_passwd_permissions: {{ ee_relax_passwd_permissions }} +{% endif %} +{% if ee_workdir is defined %} + workdir: {{ ee_workdir }} +{% endif %} +{% if ee_user is defined %} + user: {{ ee_user }} +{% endif %} +{% endif %} +{% endif %} + +{% if ee_version == 2 or ee_version == 3%} +{% if (ee_base_image is defined) or (ee_builder_image is defined) %} +images: + {%- if ee_base_image is defined %} + + base_image: + name: {{ ee_base_image }} + {%- if ee_base_sig_name is defined %} + + signature_original_name: {{ ee_base_sig_name }} + {%- endif %} + {%- endif %} + {%- if ee_builder_image is defined %} + + builder_image: + name: {{ ee_builder_image }} + {%- if ee_builder_sig_name is defined %} + + signature_original_name: {{ ee_builder_sig_name }} + {%- endif %} + {%- endif %} +{% endif %} +{% endif %} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/requirements.txt.j2 b/roles/build_shadowmandevspaces/templates/requirements.txt.j2 new file mode 100644 index 0000000..10f35c4 --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/requirements.txt.j2 @@ -0,0 +1,7 @@ +{% if ee_python is defined %} +{% if ee_python|length %} +{% for item in ee_python %} +{{ item }} +{% endfor %} +{% endif %} +{% endif %} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/requirements.yml.j2 b/roles/build_shadowmandevspaces/templates/requirements.yml.j2 new file mode 100644 index 0000000..956945d --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/requirements.yml.j2 @@ -0,0 +1,21 @@ +--- +{% if ee_roles is defined %} +{% if ee_roles|length %} +roles: +{% for item in ee_roles %} +- name: {{ item.name }} + {% if item.version is defined %}version: {{ item.version }}{% endif %} +{% endfor %} +{% endif %} +{% endif %} +{% if ee_collections is defined %} +{% if ee_collections|length %} +collections: +{% for item in ee_collections %} +- name: {{ item.name }} +{% if item.version is defined %} + version: {{ item.version }} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} \ No newline at end of file diff --git a/roles/build_shadowmandevspaces/templates/shells.j2 b/roles/build_shadowmandevspaces/templates/shells.j2 new file mode 100644 index 0000000..ccf8e66 --- /dev/null +++ b/roles/build_shadowmandevspaces/templates/shells.j2 @@ -0,0 +1,4 @@ +/bin/bash +/usr/bin/bash +/bin/sh +/usr/bin/sh \ No newline at end of file