On 10/04/2021 12:24, Andrey Gangan wrote:
On 10/04/2021 12:24, Andrey Gangan wrote:
I am experimenting with building a custom container. I am a windows guy so I have tasks that I want to run with powershell. As a play I have included the steps to curl the Microsoft repository and yum it in the image. It compiles. So I am going to Upload and have a play 😊. It beats the previous example I had before
I started with the awx-ee repo, and updated the last few lines of
the execution-environment.yml as follows to get helm, kubectl and
the Azure 'az' cli tool into my EE. It seems like I need the
latest (not released) ansible-runner to actually use it locally
though (last release of ansible-runner with significant changes is
actually a year old, and doesn't seem to mention docker anywhere).
version: 1
dependencies:
galaxy: _build/requirements.yml
system: _build/bindep.txt
additional_build_steps:
append:
- RUN alternatives --set python /usr/bin/python3
- COPY --from=quay.io/project-receptor/receptor:0.9.7
/usr/bin/receptor /usr/bin/receptor
- RUN mkdir -p /var/run/receptor
- ADD run.sh /run.sh
- CMD /run.sh
- RUN pip install virtualenv
- RUN virtualenv /opt/azure-cli
- RUN /opt/azure-cli/bin/pip install azure-cli
- RUN ln -s /opt/azure-cli/bin/az /usr/bin/az
- RUN curl https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz
| tar --strip-components=1 -C /usr/bin -xzf - linux-amd64/helm
- RUN curl -L -o /usr/bin/kubectl
https://storage.googleapis.com/kubernetes-release/release/v1.20.5/bin/linux/amd64/kubectl
&& chmod a+x /usr/bin/kubectl
- USER 1000
- RUN git lfs install
With that built, I can run playbooks with latest git ansible-runner and this runner/env/settings:
---
container_image: awx-ee-az-cli-helm
containerized: true
process_isolation_executable: docker
process_isolation: true
ansible-runner run -p test-playbook.yaml runner
So far, it doesn't appear to pass in envvars to the container
though (defined in runner/env/envvars)