Skip to content

Commit

Permalink
Merge pull request #44 from theohbrothers/enhancement/change-to-ansib…
Browse files Browse the repository at this point in the history
…le-community-package-for-ansible-core-2.10-variants

Enhancement: Change to `ansible` community package for `ansible-core >= 2.10` variants
  • Loading branch information
leojonathanoh authored Sep 20, 2023
2 parents 39c7122 + 3e85a31 commit abc2381
Show file tree
Hide file tree
Showing 24 changed files with 839 additions and 54 deletions.
546 changes: 513 additions & 33 deletions .github/workflows/ci-master-pr.yml

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Dockerized `ansible` with useful tools.

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:v2.14.5-alpine-3.18`, `:latest` | [View](variants/v2.14.5-alpine-3.18) |
| `:v2.14.5-sops-ssh-alpine-3.18` | [View](variants/v2.14.5-sops-ssh-alpine-3.18) |
| `:v2.13.6-alpine-3.17` | [View](variants/v2.13.6-alpine-3.17) |
| `:v2.13.6-sops-ssh-alpine-3.17` | [View](variants/v2.13.6-sops-ssh-alpine-3.17) |
| `:v2.11.6-alpine-3.15` | [View](variants/v2.11.6-alpine-3.15) |
| `:v2.11.6-sops-ssh-alpine-3.15` | [View](variants/v2.11.6-sops-ssh-alpine-3.15) |
| `:v8.4.0-alpine-edge`, `:latest` | [View](variants/v8.4.0-alpine-edge) |
| `:v8.4.0-sops-ssh-alpine-edge` | [View](variants/v8.4.0-sops-ssh-alpine-edge) |
| `:v7.5.0-alpine-3.18` | [View](variants/v7.5.0-alpine-3.18) |
| `:v7.5.0-sops-ssh-alpine-3.18` | [View](variants/v7.5.0-sops-ssh-alpine-3.18) |
| `:v6.6.0-alpine-3.17` | [View](variants/v6.6.0-alpine-3.17) |
| `:v6.6.0-sops-ssh-alpine-3.17` | [View](variants/v6.6.0-sops-ssh-alpine-3.17) |
| `:v5.8.0-alpine-3.16` | [View](variants/v5.8.0-alpine-3.16) |
| `:v5.8.0-sops-ssh-alpine-3.16` | [View](variants/v5.8.0-sops-ssh-alpine-3.16) |
| `:v4.8.0-alpine-3.15` | [View](variants/v4.8.0-alpine-3.15) |
| `:v4.8.0-sops-ssh-alpine-3.15` | [View](variants/v4.8.0-sops-ssh-alpine-3.15) |
| `:v2.10.7-alpine-3.13` | [View](variants/v2.10.7-alpine-3.13) |
| `:v2.10.7-sops-ssh-alpine-3.13` | [View](variants/v2.10.7-sops-ssh-alpine-3.13) |
| `:v2.9.18-alpine-3.11` | [View](variants/v2.9.18-alpine-3.11) |
Expand Down
32 changes: 26 additions & 6 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
# See: https://wiki.archlinux.org/index.php?title=Ansible&action=history
$local:VARIANTS_MATRIX = @(
@{
package = 'ansible-core'
package_version = '2.14.5'
package = 'ansible'
package_version = '8.4.0'
distro = 'alpine'
distro_version = 'edge'
subvariants = @(
@{ components = @() }
@{ components = @( 'sops', 'ssh' ) }
)
}
@{
package = 'ansible'
package_version = '7.5.0'
distro = 'alpine'
distro_version = '3.18'
subvariants = @(
Expand All @@ -14,8 +24,8 @@ $local:VARIANTS_MATRIX = @(
)
}
@{
package = 'ansible-core'
package_version = '2.13.6'
package = 'ansible'
package_version = '6.6.0'
distro = 'alpine'
distro_version = '3.17'
subvariants = @(
Expand All @@ -24,8 +34,18 @@ $local:VARIANTS_MATRIX = @(
)
}
@{
package = 'ansible-core'
package_version = '2.11.6'
package = 'ansible'
package_version = '5.8.0'
distro = 'alpine'
distro_version = '3.16'
subvariants = @(
@{ components = @() }
@{ components = @( 'sops', 'ssh' ) }
)
}
@{
package = 'ansible'
package_version = '4.8.0'
distro = 'alpine'
distro_version = '3.15'
subvariants = @(
Expand Down
9 changes: 0 additions & 9 deletions generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ 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
16 changes: 16 additions & 0 deletions variants/v4.8.0-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.15
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=4.8.0; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v4.8.0-alpine-3.15/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
26 changes: 26 additions & 0 deletions variants/v4.8.0-sops-ssh-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.15
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=4.8.0; \
ansible --version

RUN apk add --no-cache ca-certificates

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v4.8.0-sops-ssh-alpine-3.15/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
16 changes: 16 additions & 0 deletions variants/v5.8.0-alpine-3.16/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.16
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=5.8.0; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v5.8.0-alpine-3.16/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
26 changes: 26 additions & 0 deletions variants/v5.8.0-sops-ssh-alpine-3.16/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.16
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=5.8.0; \
ansible --version

RUN apk add --no-cache ca-certificates

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v5.8.0-sops-ssh-alpine-3.16/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
16 changes: 16 additions & 0 deletions variants/v6.6.0-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=6.6.0; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v6.6.0-alpine-3.17/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
26 changes: 26 additions & 0 deletions variants/v6.6.0-sops-ssh-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=6.6.0; \
ansible --version

RUN apk add --no-cache ca-certificates

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v6.6.0-sops-ssh-alpine-3.17/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
16 changes: 16 additions & 0 deletions variants/v7.5.0-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.18
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=7.5.0; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v7.5.0-alpine-3.18/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
26 changes: 26 additions & 0 deletions variants/v7.5.0-sops-ssh-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.18
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=7.5.0; \
ansible --version

RUN apk add --no-cache ca-certificates

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v7.5.0-sops-ssh-alpine-3.18/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
16 changes: 16 additions & 0 deletions variants/v8.4.0-alpine-edge/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:edge
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible~=8.4.0; \
ansible --version

RUN apk add --no-cache ca-certificates

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/v8.4.0-alpine-edge/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- ansible "$@"
fi

exec "$@"
Loading

0 comments on commit abc2381

Please sign in to comment.