From f905d1a378883fc9d915b6391eafc0f40b120c87 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Tue, 22 Oct 2024 23:37:42 +0200 Subject: [PATCH] Fix variabilization. --- deploy_ovh_instance.yml | 2 +- deploy_ssh_private_key.yml | 2 +- tasks/retrieve_secret_vars.yml | 4 ++-- vars/main.yml | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deploy_ovh_instance.yml b/deploy_ovh_instance.yml index 9bab363..9490659 100644 --- a/deploy_ovh_instance.yml +++ b/deploy_ovh_instance.yml @@ -111,7 +111,7 @@ - name: set remote workdir path ansible.builtin.set_fact: - remote_workdir: "/home/{{ ansible_user }}/.tmp_deploy_ovh" + remote_workdir: "/home/{{ ansible_user }}/{{ ANSIBLE_WORKDIR }}" tags: - common - always diff --git a/deploy_ssh_private_key.yml b/deploy_ssh_private_key.yml index 4e60ec9..e1fbe0a 100644 --- a/deploy_ssh_private_key.yml +++ b/deploy_ssh_private_key.yml @@ -10,7 +10,7 @@ - name: Deploy SSH private key copy: - src: "{{ PRIVATE_KEY_FILE }}" + src: "{{ ansible_user_dir }}/{{ ANSIBLE_WORKDIR }}/id_rsa" dest: "{{ ansible_user_dir }}/.ssh/" mode: 0600 diff --git a/tasks/retrieve_secret_vars.yml b/tasks/retrieve_secret_vars.yml index bd82e78..f7832c9 100644 --- a/tasks/retrieve_secret_vars.yml +++ b/tasks/retrieve_secret_vars.yml @@ -24,11 +24,11 @@ - name: set remote workdir path ansible.builtin.set_fact: - remote_workdir: "{{ ansible_user_dir }}/.tmp_deploy_ovh" + remote_workdir: "{{ ansible_user_dir }}/{{ ANSIBLE_WORKDIR }}" - name: set local workdir path ansible.builtin.set_fact: - local_workdir: "{{ lookup('env', 'HOME') }}/.tmp_deploy_ovh" + local_workdir: "{{ lookup('env', 'HOME') }}/{{ ANSIBLE_WORKDIR }}" - name: create remote workdir ansible.builtin.file: diff --git a/vars/main.yml b/vars/main.yml index e231d9c..552d0f9 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -13,6 +13,8 @@ LINUX_USERNAME: "yohan" PRIVATE_KEY_FILE: "/home/{{ LINUX_USERNAME }}/.ssh/id_rsa" PUBLIC_KEY_FILE: "/home/{{ LINUX_USERNAME }}/.ssh/id_rsa.pub" +ANSIBLE_WORKDIR: ".tmp_deploy_ovh" + DUPLICITY_WORKDIR: /mnt/volumes/tmp_duplicity_workdir/data DUPLICITY_ARCHIVE_DIR: /mnt/volumes/duplicity_cache/data