Skip to content

Commit 81e037a

Browse files
Martin Jacksoncursoragent
andcommitted
fix(playbooks): default pattern_dir to '.' in determine_pattern_dir
Avoid hard failure when -e pattern_dir is omitted; extra-vars still override. Typical use is running from the pattern repo root. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1b4f687 commit 81e037a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
---
2+
# pattern_dir may be overridden with -e pattern_dir=/path/to/pattern (extra vars win over this default).
3+
# Default '.' is the usual case when ansible-playbook is run from the pattern repository root.
24
- name: Determine pattern dir
35
hosts: localhost
46
connection: local
57
gather_facts: false
68
become: false
79
vars:
8-
pattern_dir: ''
10+
pattern_dir: '.'
911
tasks:
10-
- name: Fail if directory is not set
11-
ansible.builtin.fail:
12-
msg: "pattern_dir variable must be set"
13-
when: pattern_dir | length == 0
14-
1512
- name: Set pattern_dir fact for future plays
1613
ansible.builtin.set_fact:
1714
pattern_dir: '{{ pattern_dir }}'

0 commit comments

Comments
 (0)