Skip to content

Commit a781c67

Browse files
author
Bradley A. Thornton
committed
role fix
1 parent b2d7e2c commit a781c67

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ ansible-playbook -e parent=~/github/rm_example \
121121
```
122122
ansible-playbook -e parent=~/github/rm_example/roles/my_role \
123123
-e structure=role \
124-
-e collection_org=cidrblock \
125-
-e collection_name=my_collection \
126124
-e model=models/nxos/interfaces/nxos_interfaces.yml \
127125
site.yml
128126
```

roles/init/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
- name: Ensure the 'collection_org' is set when 'structure' is set to collection
2525
assert:
2626
that: collection_org is defined
27+
when: structure == 'collection'
2728

2829
- name: Ensure the 'collection_name' is set when 'structure' is set to collection
2930
assert:
3031
that: collection_name is defined
32+
when: structure == 'collection'

roles/resource_module/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parent_directory: "{{ parent }}{{ parent_directories[structure] }}"
1919
# set the iport path based on the structure
2020
import_paths:
2121
role: ansible.module_utils
22-
collection: "ansible_collections.{{ collection_org }}.{{ collection_name }}.plugins.module_utils"
22+
collection: "ansible_collections.{{ collection_org|default('') }}.{{ collection_name|default('') }}.plugins.module_utils"
2323

2424
import_path: "{{ import_paths[structure] }}"
2525

0 commit comments

Comments
 (0)