Przeglądaj źródła

support armv7l architecture

Fabian Peter Hammerle 3 lat temu
rodzic
commit
8c284101c8
2 zmienionych plików z 14 dodań i 4 usunięć
  1. 8 3
      defaults/main.yml
  2. 6 1
      tasks/main.yml

+ 8 - 3
defaults/main.yml

@@ -1,7 +1,12 @@
 # https://github.com/fphammerle/docker-borgbackup-sshd/tags
-# object a890c27fad132f3e1f91e3df2a880754a9c1f8f7
-# tag docker/0.1.0-borgbackup1.1.15r0-openssh8.4p1r3-arm64
-borgbackup_sshd_container_image: fphammerle/borgbackup-sshd@sha256:2ac782a8e35742a0f90ea71423567df92d0772ebc04845fdc5d141987d8fe078
+borgbackup_sshd_container_image: null
+_default_container_images:
+  # object a890c27fad132f3e1f91e3df2a880754a9c1f8f7
+  # tag docker/0.1.0-borgbackup1.1.15r0-openssh8.4p1r3-arm64
+  aarch64: docker.io/fphammerle/borgbackup-sshd@sha256:2ac782a8e35742a0f90ea71423567df92d0772ebc04845fdc5d141987d8fe078
+  # object a890c27fad132f3e1f91e3df2a880754a9c1f8f7
+  # tag docker/0.1.0-borgbackup1.1.15r0-openssh8.4p1r3-armv7
+  armv7l: docker.io/fphammerle/borgbackup-sshd@sha256:583989ed85f7cdda5542aeaa5561b186a21bd312e18f847d7f8fe3d7d4f1b69e
 
 borgbackup_sshd_client_public_keys: ''
 borgbackup_sshd_client_public_keys_append_only: ''

+ 6 - 1
tasks/main.yml

@@ -4,9 +4,14 @@
     state: directory
     mode: u=rwx,go=x
   register: _repo_dir
+- name: fetch host's architecture to select container image
+  setup:
+    gather_subset: min
+  when: not borgbackup_sshd_container_image and ansible_architecture is not defined
 - docker_container:
     name: '{{ borgbackup_sshd_container_name }}'
-    image: '{{ borgbackup_sshd_container_image }}'
+    image: >-
+      {{ borgbackup_sshd_container_image or _default_container_images[ansible_architecture] }}
     env:
       SSH_CLIENT_PUBLIC_KEYS: "{{ borgbackup_sshd_client_public_keys }}"
       SSH_CLIENT_PUBLIC_KEYS_APPEND_ONLY: "{{ borgbackup_sshd_client_public_keys_append_only }}"