Skip to content

Commit

Permalink
Merge pull request #41 from theohbrothers/enhancement/install-ansible…
Browse files Browse the repository at this point in the history
…-for-variants-with-only-ansible-core-installed

Enhancement: Install `ansible` for variants with only `ansible-core` installed
  • Loading branch information
leojonathanoh authored Sep 12, 2023
2 parents 85bdabc + dcd6d45 commit 6a3b11a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Docker image variants' definitions
# Since v2.10, ansible has been split into two packages, namely ansible-core and ansible
# See: https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#where-did-all-the-modules-go
# See: https://wiki.archlinux.org/index.php?title=Ansible&action=history
$local:VARIANTS_MATRIX = @(
# Since v2.10, ansible has been split into two packages, namely ansible and ansible-core.
# See: https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#where-did-all-the-modules-go
# See: https://wiki.archlinux.org/index.php?title=Ansible&action=history
@{
package = 'ansible-core'
package_version = '2.14.5'
Expand Down
9 changes: 9 additions & 0 deletions generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ RUN echo "I am running on `$BUILDPLATFORM, building for `$TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -eq '3.6' ) { '=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ); \
"@
$( if ($VARIANT['_metadata']['package'] -eq 'ansible-core') {
@"
apk add ansible; \
"@
})
@"
ansible --version
RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.11.6-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.11.6; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.11.6-sops-ssh-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.11.6; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.13.6-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.13.6; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.13.6-sops-ssh-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.13.6; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.14.5-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.14.5; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
1 change: 1 addition & 0 deletions variants/v2.14.5-sops-ssh-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core~=2.14.5; \
apk add ansible; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down

0 comments on commit 6a3b11a

Please sign in to comment.