Skip to content

Commit 0996a01

Browse files
authored
Add play argspec example to patterns playbooks/ directory (#430)
* Add play argspec example to patterns playbooks/meta/ directory * Adjust argspec to same playbook dir
1 parent 5cc9ecf commit 0996a01

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
short_description: Display weather forecast
3+
description: This playbook retrieves and displays a weather forecast from a specific airport location
4+
argument_specs:
5+
weather_forecast:
6+
short_description: Get weather forecast
7+
description:
8+
- Use an airport code to retrieve and display weather forecast data
9+
author:
10+
- developer (@developer)
11+
options:
12+
airport_code:
13+
type: str
14+
required: true
15+
examples: |
16+
- import_playbook: site.yml
17+
vars:
18+
airport_code: RDU
19+
return: ~

src/ansible_creator/resources/common/patterns/sample_pattern/playbooks/site.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111
1212
- name: Ensure the airport code has been defined
1313
ansible.builtin.validate_argument_spec:
14-
argument_spec: "{{ airport_code_argspec }}"
14+
argument_spec: "{{ (lookup('ansible.builtin.file', filename) | from_yaml)['argument_specs']['weather_forecast']['options'] }}"
1515
vars:
16-
airport_code_argspec:
17-
airport_code:
18-
type: str
19-
required: true
16+
filename: "site.meta.yml"
2017

2118
- name: Clone the latitude longtude repo locally
2219
ansible.scm.git_retrieve:

0 commit comments

Comments
 (0)