Created
August 5, 2022 02:54
-
-
Save jms/5788b90fbeb1f5bc51ab8c055c0537a1 to your computer and use it in GitHub Desktop.
ansible-bender-no-python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ansible-bender build --python-interpreter /usr/bin/python3 playbooks/build-container.yml | |
| --- | |
| - name: Build latest-bash container using ansible-bender | |
| hosts: all | |
| # Alpine doesn't have Python installation by default we collect these | |
| # later after we have one | |
| gather_facts: False | |
| vars: | |
| ansible_bender: | |
| base_image: alpine:latest | |
| target_image: | |
| name: latest-bash | |
| cmd: bash | |
| pre_tasks: | |
| - name: Install Python for Ansible runtime | |
| raw: apk add python3 | |
| - name: Gather facts after Python runtime is available | |
| setup: | |
| post_tasks: | |
| - name: Remove unneeded Python | |
| raw: apk del python3 | |
| - name: Drop apk cache | |
| raw: ash -c 'rm /var/cache/apk/*' | |
| tasks: | |
| - name: Install GNU Bash | |
| apk: | |
| name: bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment