Skip to content

Commit ff4f0df

Browse files
author
Arvind Jangir
committed
Move validate_features role to checks
1 parent 65c2eb8 commit ff4f0df

File tree

5 files changed

+17
-50
lines changed

5 files changed

+17
-50
lines changed

src/filter_plugins/foremanctl.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ def known_foreman_plugins(_value):
3232

3333
def invalid_features(features):
3434
"""Return a list of unknown features not defined in features.yaml."""
35-
unknown = []
36-
for feature in features:
37-
if feature in BASE_FEATURES:
38-
continue
39-
if feature not in FEATURE_MAP:
40-
unknown.append(feature)
41-
return unknown
35+
return [feature for feature in features if feature not in FEATURE_MAP]
4236

4337
class FilterModule(object):
4438
'''foremanctl filters'''

src/playbooks/deploy/deploy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
- "../../vars/base.yaml"
1515
roles:
1616
- role: pre_install
17-
- role: validate_features
1817
- role: checks
1918
- role: certificates
2019
when: "certificate_source == 'default'"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- name: Validate requested features
3+
ansible.builtin.assert:
4+
that:
5+
- found_invalid_features | length == 0
6+
fail_msg: |
7+
ERROR: Unknown feature(s) requested: {{ found_invalid_features | join(', ') }}
8+
9+
To remove them, run:
10+
foremanctl deploy {% for feature in found_invalid_features %}--remove-feature={{ feature }} {% endfor %}
11+
12+
Run 'foremanctl features' to list all available features.
13+
vars:
14+
found_invalid_features: "{{ features | invalid_features }}"
15+
when: features | length > 0

src/roles/checks/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- name: Execute checks
33
ansible.builtin.include_tasks: execute_check.yml
44
loop:
5+
- check_features
56
- check_hostname
67
- check_database_connection
78
- check_system_requirements

src/roles/validate_features/tasks/main.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)