diff --git a/Definitions.md b/Definitions.md deleted file mode 100644 index 32c2160..0000000 --- a/Definitions.md +++ /dev/null @@ -1,47 +0,0 @@ -# Definitions - - - -### CFM50 {#cfm50-definition} - -Is a unit of measurement that is taken when a blower door test is performed on the home. Stands for -$C$ubic $F$eet per $M$inute at 50 pascals. - -### IAQ {#iaq-definition} - -Stands for $I$ndoor $A$ir $Q$uality. We spend most of our time indoors, so having good indoor air -quality can help reduce illness and potentially improve the quality and longevity of life. - -### LAIR {#lair-definition} - -Stands for $L$eakage $A$ir $I$nfiltration $R$ate, which is a metric that compares the square footage -of the home and it's blower door number. This aids in determining if a home is controllable by -properly sized HVAC equipment or if [shell] improvements (air sealing and insulation) should be -considered. - -### Load Caclulation {#load-calculation-definition} - -A load calculation, also called a Manual-J, calculates the heating and cooling requirements for a -home. Each home has a unique heating and cooling load based on the direction it faces, the air -leakage, the location, the insulation values, the types and sizes of windows, among other factors. - -### Shell {#shell-definition} - -Shell is a term used to describe the enclosure of the house. It is often used when talking about air -leakage and insulation levels. - -### SHR {#shr-definition} - -Stands for $S$ensible $H$eat $R$atio. Sensible heat ratio is the ratio of work required by the air -conditioner to remove moisture, as well as maintain the sensible temperature. The higher the number -the better. - -### TESP {#tesp-definition} - -Stands for $T$otal $E$xternal $S$tatic $P$ressure, which is a metric used to determine how much -resistance the blower motor has to overcome for the airflow requirement of the system. - -### WC {#wc-definition} - -Stands for $W$ater $C$olumn, which is a unit of measurement for pressure. diff --git a/justfile b/justfile index cf91017..84b2589 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,13 @@ +work_dir := "/tmp/hpa-playbook-tmp" run-playbook *ARGS: - ansible-playbook ./main.yml "$@" + @ansible-playbook ./main.yml \ + --extra-vars output_dir={{work_dir}} \ + {{ARGS}} + +test *ARGS: + @ansible-playbook ./test/test.yml {{ARGS}} + +[group("utilities")] +clean: + @rm -rf {{work_dir}} diff --git a/main.yml b/main.yml index 77557a1..dfc1cf3 100644 --- a/main.yml +++ b/main.yml @@ -2,4 +2,6 @@ - name: HPA Playbook hosts: all roles: - - "repo_template" + - role: "repo_template" + tags: + - never # makes it so a tag must be supplied to run. diff --git a/roles/repo_template/tasks/main.yml b/roles/repo_template/tasks/main.yml index 3c3dc22..1a1ac72 100644 --- a/roles/repo_template/tasks/main.yml +++ b/roles/repo_template/tasks/main.yml @@ -4,7 +4,13 @@ msg: "Output directory: {{ output_dir }}" tags: - "repo-template" - - "never" + +- name: Ensure output directory exists. + ansible.builtin.file: + path: "{{ output_dir }}" + state: directory + tags: + - repo-template - name: Copy general files. ansible.builtin.copy: @@ -17,17 +23,16 @@ - "footer.tex" tags: - "repo-template" - - "never" -- name: Copy vars files. +- name: Copy basic vars files. ansible.builtin.copy: src: "files/vars.default.yml" dest: "{{ output_dir }}/vars.yml" + when: "not 'with-vault' in ansible_run_tags" tags: - - "with-default-vars" - - "never" + - "repo-template" -- name: Copy vars files. +- name: Copy vault and vars files. ansible.builtin.copy: src: "files/{{ item.src }}" dest: "{{ output_dir }}/{{ item.dest }}" @@ -37,5 +42,5 @@ - src: "vault.default.yml" dest: "vault.yml" tags: - - "with-vault-vars" - - "never" + - "with-vault" + - never diff --git a/roles/setup-project/defaults/main.yml b/roles/setup-project/defaults/main.yml new file mode 100644 index 0000000..4343d65 --- /dev/null +++ b/roles/setup-project/defaults/main.yml @@ -0,0 +1,11 @@ +--- +template_repo: + repo: "https://example.com/repo.git" + version: "main" + dest: "/path/to/clone" + +output_dir: "{{ lookup('env', 'PWD') }}" + +files_to_copy: + - "Report.md" + - "vars.yml" diff --git a/roles/setup-project/tasks/main.yml b/roles/setup-project/tasks/main.yml new file mode 100644 index 0000000..8270a76 --- /dev/null +++ b/roles/setup-project/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Starting setup project. + ansible.builtin.debug: + msg: "Output dir: {{ output_dir }}" + tags: + - setup-project + +- name: Ensure repo. + ansible.builtin.git: + repo: "{{ template_repo.repo }}" + dest: "{{ template_repo.dest }}" + version: "{{ template_repo.version }}" + tags: + - setup-project diff --git a/test/ansible.cfg b/test/ansible.cfg new file mode 100644 index 0000000..979ed4f --- /dev/null +++ b/test/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +inventory = ../inventory.ini +roles_path = ../roles diff --git a/test/test.yml b/test/test.yml new file mode 100644 index 0000000..14c4c00 --- /dev/null +++ b/test/test.yml @@ -0,0 +1,16 @@ +--- +- name: Test ansible-hpa-playbook + hosts: all + roles: + - role: setup-project + tags: + - never # force passing tags to run. + vars: + template_repo: + repo: "https://git.housh.dev/michael/ansible-hpa-playbook.git" + dest: "/tmp/playbook-clone" + version: "main" + + - role: repo_template + tags: + - never # force passing tags to run.