From 6418d8b533d7d12f0c1ab06f5b266bf74a697dec Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 21:13:23 +0200 Subject: [PATCH 01/20] Dont rely on PATH resolution, but re-use the fact stored in the play --- tasks/borg-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index 8c1d5b3..2573153 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -42,7 +42,7 @@ authorized_key: user: "{{ item.user }}" key: "{{ sshkey.stdout }}" - key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};borg serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) + key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{{ borgbackup_binary }} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) delegate_to: "{{ item.fqdn }}" when: item.type == 'normal' with_items: "{{ borgbackup_servers }}" From 26ffa2873ad830d00d18cfa482bb5cc206e06a23 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 21:12:47 +0100 Subject: [PATCH 02/20] Make sure permissions are set. --- .travis.yml | 37 +++++++++++++++++++++++++------------ tasks/borg-client.yml | 2 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f2812a..26c9ee5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,11 @@ --- -language: python -services: docker -env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: clients - - SCENARIO: lamp - - SCENARIO: multiple +arch: + - amd64 + - arm64 -# - SCENARIO: lamp -# - SCENARIO: extra_opts -# - SCENARIO: multiple +language: python +services: docker install: - pip install -r requirements.txt @@ -26,3 +19,23 @@ script: notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ + +jobs: + include: + - os: linux + arch: arm64 + env: + - SCENARIO: clients_arm + - os: linux + arch: amd64 + env: + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: clients + - SCENARIO: lamp + - SCENARIO: multiple + # - SCENARIO: lamp + # - SCENARIO: extra_opts + # - SCENARIO: multiple + diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index 2573153..efcdf79 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -20,6 +20,7 @@ state: "present" line: 'export BORG_PASSPHRASE="{{ borgbackup_passphrase }}"' create: true + mode: "0600" no_log: true - name: client | disable strict key checking for backup servers @@ -34,6 +35,7 @@ {% if item.port is defined %} Port {{ item.port }} {% endif %} + mode: "0644" with_items: "{{ borgbackup_servers }}" - debug: msg="{{ sshkey.stdout }}" From b664d90b73f840c4a33e1b4e33923d99c45604e3 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 21:41:35 +0100 Subject: [PATCH 03/20] Build in support for an army of Raspberry pies ... --- defaults/main.yml | 9 +++------ tasks/install.yml | 5 +++-- vars/main.yml | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 vars/main.yml diff --git a/defaults/main.yml b/defaults/main.yml index 7dd8b21..57498b1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -22,22 +22,19 @@ borgbackup_ssh_key_type: "rsa" # description: borg backup version to use # type: string borgbackup_version: "1.1.10" -# description: checksum type and borg checksum -# type: string -borgbackup_checksum: "sha256:6338d67aad4b5cd327b25ea363e30f0ed4abc425ce2d6a597c75a67a876ef9af" -# description: borg download url -# type: string -borgbackup_download_url: "https://github.com/borgbackup/borg/releases/download/{{ borgbackup_version }}/borg-linux64" # description: name of binary to execute in scripts for borg backup # type: string borgbackup_binary: "borg" + # description: whether to install borg backup from package # type: bool borgbackup_install_from_pkg: false + # description: whether to install the EPEL repository (EPEL required to install from package on CentOS) # type: bool borgbackup_install_epel: false + # description: name of package to install when borgbackup_install_from_pkg is true # type: string borgbackup_package: "borgbackup" diff --git a/tasks/install.yml b/tasks/install.yml index 29ef6f3..6ab600d 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -30,12 +30,13 @@ - name: install | set borg binary path set_fact: borgbackup_binary: "/usr/local/bin/borg" + borgbackup_architecture: "{{ ansible_machine }}" - name: install | install borg binary from web get_url: dest: "{{ borgbackup_binary }}" - checksum: "{{ borgbackup_checksum }}" + checksum: "{{ borgbackup_release[borgbackup_architecture].checksum[borgbackup_version] }}" owner: "{{ borgbackup_owner }}" group: "{{ borgbackup_group }}" mode: "0755" - url: "{{ borgbackup_download_url }}" + url: "{{ borgbackup_release[borgbackup_architecture].url }}" diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..d29afdb --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,15 @@ +--- + +borgbackup_release: + armv7l: + url: "https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-{{ borgbackup_version }}-armv7" + checksum: + 1.1.10: "sha256:b8829eabf31170efec79298a8f106541800337f4172c8452b9ce2384639bee46" + 1.1.11: "sha256:60f4c02d22ac423e506dac29d4a7c635d478bf5c0ac9e13fddbe6bb4a862e95f" + 1.1.13: "sha256:892485640f324eb99b19c3d042541eff98c8d6441133047e0426fc970c5b6347" + x86_64: + url: "https://github.com/borgbackup/borg/releases/download/{{ borgbackup_version }}/borg-linux64" + checksum: + 1.1.10: "sha256:6338d67aad4b5cd327b25ea363e30f0ed4abc425ce2d6a597c75a67a876ef9af" + 1.1.11: "sha256:7848d1788b5d7f2ae99a599a87992cab4f01584fe5eb393819fceaecf076433b" + 1.1.13: "sha256:60a662bef3669ed16bb29dadf6b59b74ff664f983d5fa71de7f1fb05a4fec7c0" From b7948ef135d6f6743db106519c559a1fce47a9e7 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 21:42:41 +0100 Subject: [PATCH 04/20] Adding tests for Arm --- .travis.yml | 36 ++++++++++------ molecule/clients_arm/Dockerfile.j2 | 1 + molecule/clients_arm/INSTALL.rst | 26 ++++++++++++ molecule/clients_arm/molecule.yml | 60 +++++++++++++++++++++++++++ molecule/clients_arm/playbook.yml | 1 + molecule/clients_arm/prepare.yml | 1 + molecule/clients_arm/requirements.yml | 1 + molecule/clients_arm/restore.sh.j2 | 1 + molecule/clients_arm/side_effect.yml | 1 + molecule/clients_arm/tests | 1 + 10 files changed, 117 insertions(+), 12 deletions(-) create mode 120000 molecule/clients_arm/Dockerfile.j2 create mode 100644 molecule/clients_arm/INSTALL.rst create mode 100644 molecule/clients_arm/molecule.yml create mode 120000 molecule/clients_arm/playbook.yml create mode 120000 molecule/clients_arm/prepare.yml create mode 120000 molecule/clients_arm/requirements.yml create mode 120000 molecule/clients_arm/restore.sh.j2 create mode 120000 molecule/clients_arm/side_effect.yml create mode 120000 molecule/clients_arm/tests diff --git a/.travis.yml b/.travis.yml index 4f2812a..02a11af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,11 @@ --- -language: python -services: docker -env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: clients - - SCENARIO: lamp - - SCENARIO: multiple +arch: + - amd64 + - arm64 -# - SCENARIO: lamp -# - SCENARIO: extra_opts -# - SCENARIO: multiple +language: python +services: docker install: - pip install -r requirements.txt @@ -21,6 +14,25 @@ before_script: # Rename current directory to allow forked tests to work. - mv ../$(basename $PWD) ../borgbackup 2>/dev/null || true +jobs: + include: + - os: linux + arch: arm64 + env: + - SCENARIO: clients_arm + - os: linux + arch: amd64 + env: + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: clients + - SCENARIO: lamp + - SCENARIO: multiple + # - SCENARIO: lamp + # - SCENARIO: extra_opts + # - SCENARIO: multiple + script: - molecule test --scenario-name $SCENARIO diff --git a/molecule/clients_arm/Dockerfile.j2 b/molecule/clients_arm/Dockerfile.j2 new file mode 120000 index 0000000..0373a45 --- /dev/null +++ b/molecule/clients_arm/Dockerfile.j2 @@ -0,0 +1 @@ +../generic_files/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/clients_arm/INSTALL.rst b/molecule/clients_arm/INSTALL.rst new file mode 100644 index 0000000..3904805 --- /dev/null +++ b/molecule/clients_arm/INSTALL.rst @@ -0,0 +1,26 @@ +******* +Docker driver installation guide +******* + +Requirements +============ + +* General molecule dependencies (see https://molecule.readthedocs.io/en/latest/installation.html) +* Docker Engine +* docker-py +* docker + +Install +======= + +Ansible < 2.6 + +.. code-block:: bash + + $ sudo pip install docker-py + +Ansible >= 2.6 + +.. code-block:: bash + + $ sudo pip install docker diff --git a/molecule/clients_arm/molecule.yml b/molecule/clients_arm/molecule.yml new file mode 100644 index 0000000..c2de312 --- /dev/null +++ b/molecule/clients_arm/molecule.yml @@ -0,0 +1,60 @@ +--- +driver: + name: docker +lint: + name: yamllint +platforms: + - name: clients-arm32v7-debian-9 + image: arm32v7/debian:9 + networks: + - name: clients-borg + groups: + - clients + - name: clients-server-arm32v7-debian-10 + image: arm32v7/debian:10 + networks: + - name: clients-borg + groups: + - borgbackup_servers +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + gather_timeout: 30 + interpreter_python: auto + jinja2_extensions: jinja2.ext.do + timeout: 30 + ssh_connection: + pipelining: true + inventory: + group_vars: + all: + borgbackup_appendonly: true + borgbackup_servers: + - fqdn: clients-server-arm32v7-debian-10 + user: borgds + type: normal + home: /var/backup/ + pool: repos + options: "" + borgbackup_include: + - "/etc" + - "/root" + - "/var/log" + - "/home" + host_vars: + clients-arm32v7-debian-9: + borgbackup_passphrase: sdfqjqoais + lint: + name: ansible-lint + options: + x: ["204"] +scenario: + name: clients_arm +verifier: + name: testinfra + options: + verbose: true + lint: + name: flake8 diff --git a/molecule/clients_arm/playbook.yml b/molecule/clients_arm/playbook.yml new file mode 120000 index 0000000..ace0a3d --- /dev/null +++ b/molecule/clients_arm/playbook.yml @@ -0,0 +1 @@ +../generic_files/playbook.yml \ No newline at end of file diff --git a/molecule/clients_arm/prepare.yml b/molecule/clients_arm/prepare.yml new file mode 120000 index 0000000..28e9479 --- /dev/null +++ b/molecule/clients_arm/prepare.yml @@ -0,0 +1 @@ +../generic_files/prepare.yml \ No newline at end of file diff --git a/molecule/clients_arm/requirements.yml b/molecule/clients_arm/requirements.yml new file mode 120000 index 0000000..6298a20 --- /dev/null +++ b/molecule/clients_arm/requirements.yml @@ -0,0 +1 @@ +../generic_files/requirements.yml \ No newline at end of file diff --git a/molecule/clients_arm/restore.sh.j2 b/molecule/clients_arm/restore.sh.j2 new file mode 120000 index 0000000..07356a7 --- /dev/null +++ b/molecule/clients_arm/restore.sh.j2 @@ -0,0 +1 @@ +../generic_files/restore.sh.j2 \ No newline at end of file diff --git a/molecule/clients_arm/side_effect.yml b/molecule/clients_arm/side_effect.yml new file mode 120000 index 0000000..9bfbda0 --- /dev/null +++ b/molecule/clients_arm/side_effect.yml @@ -0,0 +1 @@ +../generic_files/side_effect.yml \ No newline at end of file diff --git a/molecule/clients_arm/tests b/molecule/clients_arm/tests new file mode 120000 index 0000000..630b75e --- /dev/null +++ b/molecule/clients_arm/tests @@ -0,0 +1 @@ +../generic_files/tests \ No newline at end of file From 6b6b8c4117add79c65f6a8d59b512efeeef84315 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 21:46:47 +0100 Subject: [PATCH 05/20] Reset travis to master state --- .travis.yml | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26c9ee5..4f2812a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,19 @@ --- - -arch: - - amd64 - - arm64 - language: python services: docker +env: + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: clients + - SCENARIO: lamp + - SCENARIO: multiple + +# - SCENARIO: lamp +# - SCENARIO: extra_opts +# - SCENARIO: multiple + install: - pip install -r requirements.txt @@ -19,23 +26,3 @@ script: notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ - -jobs: - include: - - os: linux - arch: arm64 - env: - - SCENARIO: clients_arm - - os: linux - arch: amd64 - env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: clients - - SCENARIO: lamp - - SCENARIO: multiple - # - SCENARIO: lamp - # - SCENARIO: extra_opts - # - SCENARIO: multiple - From 3bdc9cbf343a6c1a4a4e516075155fb52263d40f Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 22:00:09 +0100 Subject: [PATCH 06/20] Trying explicit include+exclude --- .travis.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 02a11af..a74121b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,24 +14,29 @@ before_script: # Rename current directory to allow forked tests to work. - mv ../$(basename $PWD) ../borgbackup 2>/dev/null || true +env: + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: clients + - SCENARIO: clients_arm + - SCENARIO: lamp + - SCENARIO: multiple + # - SCENARIO: lamp + # - SCENARIO: extra_opts + # - SCENARIO: multiple + jobs: include: - os: linux arch: arm64 env: - SCENARIO: clients_arm + exclude: - os: linux arch: amd64 env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: clients - - SCENARIO: lamp - - SCENARIO: multiple - # - SCENARIO: lamp - # - SCENARIO: extra_opts - # - SCENARIO: multiple + - SCENARIO: clients_arm script: - molecule test --scenario-name $SCENARIO From 220f9bd53c5a07c51a824ab2a5d498c5ded11911 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Mon, 5 Oct 2020 22:04:09 +0100 Subject: [PATCH 07/20] Dont forget the packaged ones --- tasks/borg-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index efcdf79..3bd9d9e 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -44,7 +44,7 @@ authorized_key: user: "{{ item.user }}" key: "{{ sshkey.stdout }}" - key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{{ borgbackup_binary }} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) + key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{% if borgbackup_install_from_pkg|default(False) %}{{ borgbackup_binary }}{% endif %} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) delegate_to: "{{ item.fqdn }}" when: item.type == 'normal' with_items: "{{ borgbackup_servers }}" From da0a731902c4e2281c78b161f991d460f8680ed5 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 21:33:35 +0200 Subject: [PATCH 08/20] Fix binary, reduce build time --- .travis.yml | 2 +- tasks/borg-client.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f2812a..19168ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ env: - SCENARIO: default - SCENARIO: centos - SCENARIO: ubuntu - - SCENARIO: clients - SCENARIO: lamp - SCENARIO: multiple +# - SCENARIO: clients # - SCENARIO: lamp # - SCENARIO: extra_opts # - SCENARIO: multiple diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index 3bd9d9e..e54bf90 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -44,7 +44,7 @@ authorized_key: user: "{{ item.user }}" key: "{{ sshkey.stdout }}" - key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{% if borgbackup_install_from_pkg|default(False) %}{{ borgbackup_binary }}{% endif %} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) + key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{% if borgbackup_install_from_pkg|default(False) %}{{ borgbackup_binary }}{% else %}borg{% endif %} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) delegate_to: "{{ item.fqdn }}" when: item.type == 'normal' with_items: "{{ borgbackup_servers }}" From 95b02fc67b86a38ce82b93752b4a4d495414fdb0 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 20:36:25 +0100 Subject: [PATCH 09/20] Try different build --- .travis.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index a74121b..6c1b0e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,29 +14,24 @@ before_script: # Rename current directory to allow forked tests to work. - mv ../$(basename $PWD) ../borgbackup 2>/dev/null || true -env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: clients - - SCENARIO: clients_arm - - SCENARIO: lamp - - SCENARIO: multiple - # - SCENARIO: lamp - # - SCENARIO: extra_opts - # - SCENARIO: multiple - jobs: include: - os: linux arch: arm64 env: - SCENARIO: clients_arm - exclude: - os: linux arch: amd64 env: - - SCENARIO: clients_arm + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: lamp + - SCENARIO: multiple + # - SCENARIO: clients + # - SCENARIO: lamp + # - SCENARIO: extra_opts + # - SCENARIO: multiple script: - molecule test --scenario-name $SCENARIO From c5142b01f3035a760835cc15f4c7a6f5537b433d Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 20:45:45 +0100 Subject: [PATCH 10/20] Testing build matrix for travis --- .travis.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c1b0e1..8c9d1df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,24 +14,27 @@ before_script: # Rename current directory to allow forked tests to work. - mv ../$(basename $PWD) ../borgbackup 2>/dev/null || true +env: + - SCENARIO: default + - SCENARIO: centos + - SCENARIO: ubuntu + - SCENARIO: lamp + - SCENARIO: multiple + - SCENARIO: clients_arm + # - SCENARIO: clients + # - SCENARIO: lamp + # - SCENARIO: extra_opts + # - SCENARIO: multiple + jobs: include: - os: linux arch: arm64 - env: - - SCENARIO: clients_arm + env: SCENARIO=clients_arm + exclude: - os: linux arch: amd64 - env: - - SCENARIO: default - - SCENARIO: centos - - SCENARIO: ubuntu - - SCENARIO: lamp - - SCENARIO: multiple - # - SCENARIO: clients - # - SCENARIO: lamp - # - SCENARIO: extra_opts - # - SCENARIO: multiple + env: SCENARIO=clients_arm script: - molecule test --scenario-name $SCENARIO From 936307c02289ede9b267b46cebad118c585884a7 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 20:49:42 +0100 Subject: [PATCH 11/20] Testing build matrix for travis 2 --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c9d1df..5bf944b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,12 +28,10 @@ env: jobs: include: - - os: linux - arch: arm64 + - arch: arm64 env: SCENARIO=clients_arm exclude: - - os: linux - arch: amd64 + - arch: amd64 env: SCENARIO=clients_arm script: From 8588a464658b94421c35d7a51ec35c82d3022652 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 20:54:32 +0100 Subject: [PATCH 12/20] Work in travis with excludes --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5bf944b..39403c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,10 +27,19 @@ env: # - SCENARIO: multiple jobs: - include: - - arch: arm64 - env: SCENARIO=clients_arm exclude: + # exclude jobs that should not be run on ARM + - arch: arm64 + env: SCENARIO=default + - arch: arm64 + env: SCENARIO=centos + - arch: arm64 + env: SCENARIO=ubuntu + - arch: arm64 + env: SCENARIO=lamp + - arch: arm64 + env: SCENARIO=multiple + # exclude jobs that should not be run on AMD64 - arch: amd64 env: SCENARIO=clients_arm From 59c049a67ea887147bd7deffe71d9cd437f26c3c Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 22:21:24 +0200 Subject: [PATCH 13/20] Undo changes, not required at this point, but should be addressed. Lets assume borg is there on the PATH --- tasks/borg-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index e54bf90..cb69bb0 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -44,7 +44,7 @@ authorized_key: user: "{{ item.user }}" key: "{{ sshkey.stdout }}" - key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};{% if borgbackup_install_from_pkg|default(False) %}{{ borgbackup_binary }}{% else %}borg{% endif %} serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) + key_options: 'command="cd {{ item.home }}{{ item.pool }}/{{ inventory_hostname }};borg serve {% if borgbackup_appendonly %}--append-only {% endif %}--restrict-to-path {{ item.home }}/{{ item.pool }}/{{ inventory_hostname }}",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc' # noqa 204 (Line has to be this long for valid formatting) delegate_to: "{{ item.fqdn }}" when: item.type == 'normal' with_items: "{{ borgbackup_servers }}" From 64775dfbcdb1f2a0adddb0ca54c408b7bb8ec5ad Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 21:43:14 +0100 Subject: [PATCH 14/20] Adding aarch64 aka arm64 variables --- vars/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vars/main.yml b/vars/main.yml index d29afdb..a498f9d 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,12 @@ --- borgbackup_release: + aarch64: + url: "https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-{{ borgbackup_version }}-arm64" + checksum: + 1.1.10: "sha256:feef734f3c07e2f1a2850493652ec289fa2731aa2cd9b292fa92741bc915cbbd" + 1.1.11: "sha256:fd6198503312f584506454414530b540fa0f48bd615d2306a9d868da979c7ca0" + 1.1.13: "sha256:d942f2815cc6b8acbd6c0f08920160a6e850d9dbb84178af8b72f4eb9e5f9cae" armv7l: url: "https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-{{ borgbackup_version }}-armv7" checksum: From 212109c854260b89926fd839e1bdeeb69c9398f4 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 21:54:20 +0100 Subject: [PATCH 15/20] See if travis truly supports aarch64 --- molecule/clients_arm/molecule.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/molecule/clients_arm/molecule.yml b/molecule/clients_arm/molecule.yml index c2de312..96ba8d7 100644 --- a/molecule/clients_arm/molecule.yml +++ b/molecule/clients_arm/molecule.yml @@ -10,6 +10,24 @@ platforms: - name: clients-borg groups: - clients + - name: clients-arm64v8-debian-9 + image: arm64v8/debian:9 + networks: + - name: clients-borg + groups: + - clients + - name: clients-arm32v7-debian-10 + image: arm32v7/debian:10 + networks: + - name: clients-borg + groups: + - clients + - name: clients-arm64v8-debian-10 + image: arm64v8/debian:10 + networks: + - name: clients-borg + groups: + - clients - name: clients-server-arm32v7-debian-10 image: arm32v7/debian:10 networks: @@ -43,8 +61,6 @@ provisioner: - "/root" - "/var/log" - "/home" - host_vars: - clients-arm32v7-debian-9: borgbackup_passphrase: sdfqjqoais lint: name: ansible-lint From 17621c25d1262b846f77b663b808b5caa7e448c0 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 21:58:04 +0100 Subject: [PATCH 16/20] Cache pip in Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 39403c7..e19c542 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ arch: - arm64 language: python +cache: pip services: docker install: From 039d693159da3d25fe2c98805d5ba7b61bf79924 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Tue, 6 Oct 2020 22:00:45 +0100 Subject: [PATCH 17/20] Add cache clearing --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e19c542..1117e30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,15 @@ arch: - arm64 language: python -cache: pip services: docker +cache: + pip: true + directories: + - $HOME/.cache/pip +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log + install: - pip install -r requirements.txt From 3a0e762b2d2b6799e10608c67c5604271dd733d8 Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Sun, 11 Oct 2020 08:31:54 +0100 Subject: [PATCH 18/20] Disable arm64v8 for now --- molecule/clients_arm/molecule.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/molecule/clients_arm/molecule.yml b/molecule/clients_arm/molecule.yml index 96ba8d7..6495a36 100644 --- a/molecule/clients_arm/molecule.yml +++ b/molecule/clients_arm/molecule.yml @@ -10,24 +10,24 @@ platforms: - name: clients-borg groups: - clients - - name: clients-arm64v8-debian-9 - image: arm64v8/debian:9 - networks: - - name: clients-borg - groups: - - clients + # - name: clients-arm64v8-debian-9 + # image: arm64v8/debian:9 + # networks: + # - name: clients-borg + # groups: + # - clients - name: clients-arm32v7-debian-10 image: arm32v7/debian:10 networks: - name: clients-borg groups: - clients - - name: clients-arm64v8-debian-10 - image: arm64v8/debian:10 - networks: - - name: clients-borg - groups: - - clients + # - name: clients-arm64v8-debian-10 + # image: arm64v8/debian:10 + # networks: + # - name: clients-borg + # groups: + # - clients - name: clients-server-arm32v7-debian-10 image: arm32v7/debian:10 networks: From ad293ef056dd6413603b6f8b42500b43da6baabf Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Thu, 22 Oct 2020 19:54:26 +0100 Subject: [PATCH 19/20] Test --- tasks/borg-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index cb69bb0..6fd8c4c 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -21,7 +21,7 @@ line: 'export BORG_PASSPHRASE="{{ borgbackup_passphrase }}"' create: true mode: "0600" - no_log: true +# no_log: true - name: client | disable strict key checking for backup servers blockinfile: From 84caa0be2adfb318c4e968e33e5896f640e6ef5d Mon Sep 17 00:00:00 2001 From: Dieter Verhelst Date: Thu, 22 Oct 2020 19:58:45 +0100 Subject: [PATCH 20/20] Undo --- tasks/borg-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/borg-client.yml b/tasks/borg-client.yml index 6fd8c4c..cb69bb0 100644 --- a/tasks/borg-client.yml +++ b/tasks/borg-client.yml @@ -21,7 +21,7 @@ line: 'export BORG_PASSPHRASE="{{ borgbackup_passphrase }}"' create: true mode: "0600" -# no_log: true + no_log: true - name: client | disable strict key checking for backup servers blockinfile: