Skip to content

Commit

Permalink
Ensure the ansible facts are available
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakuje committed Apr 12, 2022
1 parent 588ac9d commit 073d4c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions tasks/set_common_vars.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
- name: Ensure ansible_facts used by role
setup:
gather_subset: min
when: not ansible_facts.keys() | list |
intersect(__sshd_required_facts) == __sshd_required_facts

- name: Include common vars
include_vars: vars/common.yml
10 changes: 6 additions & 4 deletions tasks/sshd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
- name: Set common variables and ensure basic facts are gathered
include_tasks: set_common_vars.yml

- include_tasks: set_common_vars.yml
- name: Set platform/version specific variables
include_tasks: variables.yml

- include_tasks: variables.yml

- include_tasks: install.yml
- name: Execute the actual role tasks
include_tasks: install.yml
5 changes: 5 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ __sshd_hostkey_mode: "0600"
__sshd_compat_match_all: Match all
# The hostkeys not supported in FIPS mode, if applicable
__sshd_hostkeys_nofips: []

__sshd_required_facts:
- distribution
- distribution_major_version
- os_family

0 comments on commit 073d4c5

Please sign in to comment.