Skip to content

Commit

Permalink
👌 IMPROVE: Allow for example folder tasks to be skipped (#8)
Browse files Browse the repository at this point in the history
Skipped if `qm_customizations_examples_folder` is set to "" or null
  • Loading branch information
chrisjsewell authored Apr 16, 2021
1 parent 4d1e531 commit d4475a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/folders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@
mode: 0755

- name: Create folder for examples
when: qm_customizations_examples_folder is truthy
become: true
become_user: "{{ qm_customizations_vm_user }}"
file:
path: "{{ qm_customizations_examples_folder }}"
state: directory

- name: clean compiled python files
when: qm_customizations_examples_folder is truthy and clean is defined and clean
become: true
become_user: "{{ qm_customizations_vm_user }}"
shell: find . -name "*.pyc" | xargs rm -f
ignore_errors: true
args:
chdir: "{{ qm_customizations_examples_folder }}"
when: clean is defined and clean

- name: Add readme for examples
become: true
become_user: "{{ qm_customizations_vm_user }}"
when: qm_customizations_examples_readme is truthy
ini_file:
path: "{{ qm_customizations_examples_readme }}"
section: "General"
Expand All @@ -50,10 +52,10 @@
when: not qm_customizations_headless

- name: symlink examples to desktop
when: qm_customizations_examples_folder is truthy and not qm_customizations_headless
become: true
become_user: "{{ qm_customizations_vm_user }}"
file:
src: "{{ qm_customizations_examples_folder }}"
dest: "${HOME}/Desktop/examples"
state: link
when: not qm_customizations_headless

0 comments on commit d4475a4

Please sign in to comment.