From 88cd7c9033affd7f949e1c953e210297a3ba66fb Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sun, 24 Nov 2024 20:09:19 -0500 Subject: [PATCH] feat: Update variable definitions --- defaults/main.yml | 10 +++++----- files/vars.default.yml | 31 ------------------------------- files/vars.vault.yml | 14 ++++++++++++++ tasks/setup.yml | 11 +++++++++++ 4 files changed, 30 insertions(+), 36 deletions(-) delete mode 100644 files/vars.default.yml diff --git a/defaults/main.yml b/defaults/main.yml index a3326cb..5288816 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -32,15 +32,15 @@ home: lair: "1:1" # NOTE: These generally do not need changed, unless debugging. -config: - build_dir_name: ".build" - work_dir: "{{ lookup('env', 'PWD') }}" - build_dir: "{{ config.work_dir }}/{{ config.build_dir_name }}" +build_dir_name: ".build" +work_dir: "{{ lookup('env', 'PWD') }}" +build_dir: "{{ work_dir }}/{{ build_dir_name }}" +config: # NOTE: These generally do not need changed, unless debugging or customizing files. # Such as you want to add new definitions or customize the footer. paths: - report_path: "{{ config.work_dir }}/Report.md" + report_path: "{{ work_dir }}/Report.md" footer_path: "templates/footer.tex" head_path: "files/head.tex" definitions_path: "files/Definitions.md" diff --git a/files/vars.default.yml b/files/vars.default.yml deleted file mode 100644 index 8a09dc7..0000000 --- a/files/vars.default.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -author_name: "Testy McTestface Jr" -document_title: "Home Performance Report" -company: - website: "https://example.com" - phone: "555-555-5555" - url_display_title: "www.Example.com" - -links: - images: - logo: "img/logo.png" - trueflow: "img/trueflow.png" - trueflow_forecast: "img/forecast.png" - documents: - loads_folder: "https://example.com/path/to/loads/folder" - trueflow_file: "https://example.com/path/to/trueflow/file" - trueflow_forecast_file: "https://example.com/path/to/trueflow/forecast/file" - document_folder: "https://example.com/path/to/document/folder" - -customer: - name: "Testy McTestface Sr" - address: - street: "1234 Seasme Street" - city: "No Mans Land" - state: "Foo" - zip: "55555" - -home: - square_feet: "3,000" - cfm50: "3,000" - lair: "1:1" diff --git a/files/vars.vault.yml b/files/vars.vault.yml index 7cabc46..b1004c6 100644 --- a/files/vars.vault.yml +++ b/files/vars.vault.yml @@ -16,3 +16,17 @@ home: square_feet: "3,000" cfm50: "3,000" lair: "1:1" + +# NOTE: These generally do not need changed, unless debugging. +build_dir_name: ".build" +work_dir: "{{ lookup('env', 'PWD') }}" +build_dir: "{{ work_dir }}/{{ build_dir_name }}" + +config: + # NOTE: These generally do not need changed, unless debugging or customizing files. + # Such as you want to add new definitions or customize the footer. + paths: + report_path: "{{ work_dir }}/Report.md" + footer_path: "templates/footer.tex" + head_path: "files/head.tex" + definitions_path: "files/Definitions.md" diff --git a/tasks/setup.yml b/tasks/setup.yml index 5bb14d3..6c4eb81 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -60,6 +60,17 @@ - setup - setup-all +- name: "Copy vars if not exists." + ansible.builtin.include_tasks: + file: "copy_if_not_exists.yml" + vars: + source: "files/vars.vault.yml" + destination: "{{ work_dir }}/vars.yml" + tags: + - setup-vault + - setup-with-vault + - setup-all-with-vault + - name: "Copy vault if not exists." ansible.builtin.include_tasks: file: "copy_if_not_exists.yml"