-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support gather_facts: false; support setup-snapshot.yml (#66)
Some users use `gather_facts: false` in their playbooks. This changes the role to work in that case, by gathering only the facts it requires to run. CI testing can be sped up by creating a snapshot image pre-installed with packages. tests/setup-snapshot.yml can be used by a CI system to do this.
- Loading branch information
Showing
5 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Ensure ansible_facts used by role | ||
setup: | ||
gather_subset: min | ||
when: not ansible_facts.keys() | list | | ||
intersect(__nbde_client_required_facts) == | ||
__nbde_client_required_facts | ||
|
||
- name: Set platform/version specific variables | ||
include_vars: "{{ lookup('first_found', ffparams) }}" | ||
vars: | ||
ffparams: | ||
files: | ||
- "{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_version'] }}.yml" # yamllint disable-line rule:line-length | ||
- "{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_major_version'] }}.yml" # yamllint disable-line rule:line-length | ||
- "{{ ansible_facts['distribution'] }}.yml" | ||
- "{{ ansible_facts['os_family'] }}.yml" | ||
- "default.yml" | ||
paths: | ||
- "{{ role_path }}/vars" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- hosts: all | ||
tasks: | ||
- name: Set platform/version specific variables | ||
include_role: | ||
name: linux-system-roles.nbde_client | ||
tasks_from: set_vars.yml | ||
public: true | ||
|
||
- name: Install test packages | ||
package: | ||
name: "{{ __nbde_client_packages }}" | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters