48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
---
|
|
- name: configure ssh
|
|
block:
|
|
- name: .ssh dir
|
|
ansible.builtin.file:
|
|
path: /root/.ssh
|
|
mode: 0700
|
|
state: directory
|
|
- name: .ssh/config
|
|
ansible.builtin.copy:
|
|
dest: /root/.ssh/config
|
|
content: |
|
|
Host *
|
|
Port 2222
|
|
|
|
- name: get borg binary
|
|
ansible.builtin.package:
|
|
name: borgbackup
|
|
state: present
|
|
|
|
- name: ensure /root/bin exists
|
|
ansible.builtin.file:
|
|
path: "{{ borg_script_dir }}"
|
|
state: directory
|
|
|
|
- name: get borgbackup script
|
|
delegate_to: localhost
|
|
become: false
|
|
ansible.builtin.git:
|
|
repo: "ssh://git@git-ssh.hadoly.fr:6900/CS_CT/borg.git"
|
|
dest: "/home/tom/tmp/borg"
|
|
|
|
- name: copy script
|
|
ansible.builtin.copy:
|
|
src: /home/tom/tmp/borg/borg.sh
|
|
dest: "{{ borg_script_dir }}"
|
|
mode: 0700
|
|
owner: root
|
|
group: root
|
|
|
|
- name: get borgbackup config
|
|
vars:
|
|
borg_dirs_serialized: "{{ borg_dirs | join( ' ' ) }}"
|
|
ansible.builtin.template:
|
|
src: borg.conf.jj
|
|
dest: "{{ borg_script_dir }}/borg.conf"
|
|
mode: 0600
|