-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexecution-environment.yml
69 lines (55 loc) · 2.54 KB
/
execution-environment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
version: 3
dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
ansible_core:
package_pip: ansible-core==2.17.4
ansible_runner:
package_pip: ansible-runner==2.4.0
python_interpreter:
package_system: "python3.11"
python_path: "/usr/bin/python3.11"
images:
base_image:
name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest
options:
package_manager_path: /usr/bin/microdnf
additional_build_files:
- src: ansible.cfg
dest: configs
additional_build_steps:
append_base: |
RUN echo "Target architecture is: $TARGETARCH"
# Configure Terraform Repo
RUN curl -o /etc/yum.repos.d/hashicorp.repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
# Configure Azure CLI Repo
RUN rpm -i https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
# Configure Google Cloud Repo
RUN echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el\$releasever-\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" | tee /etc/yum.repos.d/google-cloud-sdk.repo
prepend_galaxy: |
COPY _build/configs/ansible.cfg /etc/ansible/ansible.cfg
ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/published/
ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN
append_final: |
# Use Python 3.11 as default
RUN rm -f /bin/python3
RUN ln -s /bin/python3.11 /bin/python3
# Install the Azure Connected Machine Extension
RUN az config set extension.use_dynamic_install=yes_without_prompt
RUN az extension add --name connectedmachine -y
# Install AWS CLI
RUN if [ $TARGETARCH == "arm64" ]; then curl -L "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "/tmp/awscliv2.zip"; else curl -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"; fi
RUN unzip /tmp/awscliv2.zip -d /tmp/
RUN chmod 755 /tmp/aws/install
RUN /tmp/aws/install
RUN rm -rf /tmp/*
# Install OCI CLI
RUN /usr/bin/python3.11 -m venv /home/runner/oracle-cli --clear --upgrade-deps
ENV VIRTUAL_ENV /home/runner/oracle-cli
RUN /home/runner/oracle-cli/bin/pip3 install oci-cli
ENV VIRTUAL_ENV ""
# Output collections list for debugging
RUN ansible-galaxy collection list