Build

mkdir ansible-builder
cd ansible-builder
python3 -m venv builder
. builder/bin/activate
pip install --upgrade pip
pip install wheel
pip install ansible
pip install ansible-builder
cat > CERTNPS-1.crt << EOF
-----BEGIN CERTIFICATE-----
MIIDdDCCAlygAwIBAgIQKgomIa8B6qxJXdRYnpH9szANBgkqhkiG9w0BAQUFADBB
MRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEjAQBgoJkiaJk/IsZAEZFgJhZDEUMBIG
A1UEAxMLQ0EtQ0VSVE5QUzEwIBcNMTAxMTA1MTM0NzMzWhgPMjA2MDExMDUxMzU3
MzFaMEExFTATBgoJkiaJk/IsZAEZFgVsb2NhbDESMBAGCgmSJomT8ixkARkWAmFk
MRQwEgYDVQQDEwtDQS1DRVJUTlBTMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAKrnP1BJOYjP1INXrrObgPBL49nT4feW4bMZX8K4dK7RbrtdK/XI9Re+
bDfZKzMHQmPzQ/FKciqOHQPIQTPu+tLT7fhAjP6Ts7ih0/oRMulUa7US82oHnUHg
LsHp+mul528ccWyV4Y/4w+UO1gTHGH6OgCExy6K4wgAFrDPY0XHfCkVkQFg05/tC
3IyJBURZgSjbtNlOXi3ouNjGpRNQcNaOSHytVuXtE2Opq6OpJsLOlsY0WFy66Omo
9EAM5AnkeszcCKmfdRfspfaNzuhwYY7gC+c1YVM/Y36y8OlTdRTvvU4pX8qiiyto
6oGT1/6UONFqRQFDcegRuF9Jg8etmd8CAwEAAaNmMGQwEwYJKwYBBAGCNxQCBAYe
BABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ6B
5vSY0zAjbeHoWuTVd399ASn4MBAGCSsGAQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEB
BQUAA4IBAQB4EArcn1ebdHa8kGkj4Mj4KXSBaBhBnNEkmF+CZqEd8VZ8IDKnQERz
1AeGMWYPEbLKPl69Vuezqr0/pgfN0onlRqyRd40NWlWWsauc0MMMQuabY8zjloUq
GW0MyDikM8k0ZE9f2dqbACPDmZ3fduC2GdBeY3EMJ/dhBa4t4wj4XHG4sKdtZWad
ejIKKbM6l2MJkX4cFJ8yiVjhmiVz9SXRJlpSFw/n0MP4qdmcNdxjT1l7iIQHyjdy
0ofjKLSHtHMExEOG7xd2a82kbkgolMUcAt+k6BCID9bTcGjlD+Dvg8wiGaY7mo8P
6Ru4lth/VTFDNaHK5Wyy/VneJait9Hoi
-----END CERTIFICATE-----
EOF
cat > execution-environment.yml << EOF
---
version: 1
dependencies:
  galaxy: requirements.yml
  python: requirements.txt
  system: bindep.txt

additional_build_steps:
  append:
    - RUN alternatives --set python /usr/bin/python3
    - COPY CERTNPS-1.crt /usr/share/pki/ca-trust-source/anchors/CERTNPS-1.crt
    - RUN update-ca-trust
    - COPY --from=quay.io/project-receptor/receptor /usr/bin/receptor /usr/bin/receptor
    - RUN mkdir -p /var/run/receptor
    - ADD run.sh /run.sh
    - CMD /run.sh
    - USER 1000
    - RUN git lfs install
EOF
cat > requirements.yml << EOF
---
collections:
  - ansible.windows
  - community.windows
  - community.vmware
EOF
cat > requirements.txt << EOF
urllib3
git+https://github.com/ansible/ansible-builder.git@devel#egg=ansible-builder
EOF
cat > bindep.txt << EOF
python38-devel [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]
EOF
mkdir context
cat > context/run.sh << EOF
#!/bin/bash
ansible-runner worker --private-data-dir=/runner
EOF
chmod +x context/run.sh
ansible-builder build --tag baumgart/awx-ee-cert:2022.05.09 --context ./context --container-runtime docker
docker push blah

Revision #3
Created 9 May 2022 20:40:47 by Jeremy Baumgartner
Updated 14 June 2022 15:05:49 by Jeremy Baumgartner