Skip to content

Commit c93bb2e

Browse files
Remove auto_attach and autoheal from FAM
Signed-off-by: Gaurav Talreja <[email protected]>
1 parent 53d1a6b commit c93bb2e

File tree

77 files changed

+6909
-10823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6909
-10823
lines changed

plugins/modules/activation_key.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@
103103
- default
104104
type: str
105105
required: true
106-
auto_attach:
107-
description:
108-
- Set Auto-Attach on or off
109-
type: bool
110106
release_version:
111107
description:
112108
- Set the content release version
@@ -180,7 +176,6 @@
180176
override: enabled
181177
- label: ExampleOrganization_ExampleCustomProduct_ExampleRepository
182178
override: enabled
183-
auto_attach: false
184179
release_version: 7Server
185180
service_level: Standard
186181
'''
@@ -228,7 +223,6 @@ def main():
228223
lifecycle_environment=dict(type='entity', flat_name='environment_id', scope=['organization']),
229224
content_view=dict(type='entity', scope=['organization']),
230225
host_collections=dict(type='entity_list', scope=['organization']),
231-
auto_attach=dict(type='bool'),
232226
release_version=dict(),
233227
service_level=dict(choices=['Self-Support', 'Standard', 'Premium']),
234228
max_hosts=dict(type='int'),
@@ -279,9 +273,9 @@ def main():
279273
# copied keys inherit the subscriptions of the origin, so one would not have to specify them again
280274
# deleted keys don't need subscriptions anymore either
281275
if module.state == 'present' or (module.state == 'present_with_defaults' and module.changed):
282-
# the auto_attach, release_version and service_level parameters can only be set on an existing AK with an update,
276+
# the release_version and service_level parameters can only be set on an existing AK with an update,
283277
# not during create, so let's force an update. see https://projects.theforeman.org/issues/27632 for details
284-
if any(key in module.foreman_params for key in ['auto_attach', 'release_version', 'service_level']) and module.changed:
278+
if any(key in module.foreman_params for key in ['release_version', 'service_level']) and module.changed:
285279
activation_key = module.ensure_entity('activation_keys', module.foreman_params, activation_key, params=scope)
286280

287281
ak_scope = {'activation_key_id': activation_key['id']}

roles/activation_keys/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ The following fields are required for an activation key but have defaults which
2020

2121
The following fields are optional in the sense that the server will use default values when they are omitted:
2222

23-
- `auto_attach`: Auto Attach behavior for the activation key. When true, it will attempt to attach a minimum of subscriptions (from the subset of assigned subscriptions on the activation key; selects from all subscriptions in the organization if none are assigned) to cover any present products on the host. When false, it will attempt to attach all subscriptions assigned on the activation key to the host at registration time. server defaults to true.
2423
- `unlimited_hosts`: Allow an unlimited number of hosts to register with the activation key when true. When false, the `max_hosts` parameter which sets a numerical limit on the number of hosts that can be registered becomes required. server defaults to true.
2524

2625
The following fields are optional and will be omitted by default:
@@ -71,7 +70,6 @@ Define two Activation Keys. The first registers hosts in the "ACME" organization
7170
foreman_organization: "ACME"
7271
foreman_activation_keys:
7372
- name: "ACME_App_Key"
74-
auto_attach: false
7573
subscriptions:
7674
- name: "ACME_App"
7775
- name: "ACME_RHEL7_Base_Test"

roles/activation_keys/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
host_collections: "{{ item.host_collections | default(omit) }}"
1414
subscriptions: "{{ item.subscriptions | default(omit) }}"
1515
content_overrides: "{{ item.content_overrides | default(omit) }}"
16-
auto_attach: "{{ item.auto_attach | default(omit) }}"
1716
unlimited_hosts: "{{ item.unlimited_hosts | default(omit) }}"
1817
max_hosts: "{{ item.max_hosts | default(omit) }}"
1918
release_version: "{{ item.release_version | default(omit) }}"

roles/convert2rhel/tasks/activation_keys.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
name: "{{ foreman_convert2rhel_key_rhel7 }}"
8383
lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}"
8484
content_view: "{{ foreman_convert2rhel_content_view }}"
85-
auto_attach: false
8685
when: foreman_content_rhel_enable_rhel7
8786

8887
- name: "Create activation key '{{ foreman_convert2rhel_key_rhel8 }}'"
@@ -95,7 +94,6 @@
9594
name: "{{ foreman_convert2rhel_key_rhel8 }}"
9695
lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}"
9796
content_view: "{{ foreman_convert2rhel_content_view }}"
98-
auto_attach: false
9997
when: foreman_content_rhel_enable_rhel8
10098

10199
- name: "Add subscriptions to '{{ foreman_convert2rhel_key_rhel7 }}'"

tests/test_playbooks/activation_key.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -128,38 +128,6 @@
128128
activation_key_state: absent
129129
expected_change: true
130130

131-
- name: create AK with auto_attach=true
132-
include_tasks: tasks/activation_key.yml
133-
vars:
134-
activation_key_auto_attach: true
135-
expected_change: true
136-
- name: create AK with auto_attach=true again, no change
137-
include_tasks: tasks/activation_key.yml
138-
vars:
139-
activation_key_auto_attach: true
140-
expected_change: false
141-
- name: remove AK with auto_attach=true
142-
include_tasks: tasks/activation_key.yml
143-
vars:
144-
activation_key_state: absent
145-
expected_change: true
146-
147-
- name: create AK with auto_attach=false
148-
include_tasks: tasks/activation_key.yml
149-
vars:
150-
activation_key_auto_attach: false
151-
expected_change: true
152-
- name: create AK with auto_attach=false again, no change
153-
include_tasks: tasks/activation_key.yml
154-
vars:
155-
activation_key_auto_attach: false
156-
expected_change: false
157-
- name: remove AK with auto_attach=false
158-
include_tasks: tasks/activation_key.yml
159-
vars:
160-
activation_key_state: absent
161-
expected_change: true
162-
163131
- name: create AK with unlimited_hosts=false
164132
include_tasks: tasks/activation_key.yml
165133
vars:

tests/test_playbooks/activation_keys_role.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@
2525
foreman_activation_keys:
2626
- name: Testkey1
2727
- name: Testkey2
28-
auto_attach: false

tests/test_playbooks/fixtures/activation_key-0.yml

Lines changed: 70 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ interactions:
1414
uri: https://foreman.example.org/api/status
1515
response:
1616
body:
17-
string: '{"satellite_version":"6.16.0","result":"ok","status":200,"version":"3.11.0-develop","api_version":2}'
17+
string: '{"satellite_version":"6.19.0","result":"ok","status":200,"version":"3.18.0-develop","api_version":2}'
1818
headers:
1919
Cache-Control:
2020
- max-age=0, private, must-revalidate
2121
Connection:
2222
- Keep-Alive
2323
Content-Length:
2424
- '100'
25-
Content-Security-Policy:
26-
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
27-
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
28-
style-src ''unsafe-inline'' ''self'''
2925
Content-Type:
3026
- application/json; charset=utf-8
3127
Foreman_api_version:
@@ -35,21 +31,27 @@ interactions:
3531
Foreman_current_organization:
3632
- ; ANY
3733
Foreman_version:
38-
- 3.11.0-develop
34+
- 3.18.0-develop
3935
Keep-Alive:
4036
- timeout=15, max=100
41-
Strict-Transport-Security:
37+
Referrer-Policy:
38+
- strict-origin-when-cross-origin
39+
content-security-policy:
40+
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
41+
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
42+
style-src ''unsafe-inline'' ''self'''
43+
strict-transport-security:
4244
- max-age=631139040; includeSubdomains
43-
X-Content-Type-Options:
45+
x-content-type-options:
4446
- nosniff
45-
X-Download-Options:
47+
x-download-options:
4648
- noopen
47-
X-Frame-Options:
49+
x-frame-options:
4850
- sameorigin
49-
X-Permitted-Cross-Domain-Policies:
51+
x-permitted-cross-domain-policies:
5052
- none
51-
X-XSS-Protection:
52-
- 1; mode=block
53+
x-xss-protection:
54+
- '0'
5355
status:
5456
code: 200
5557
message: OK
@@ -70,8 +72,8 @@ interactions:
7072
body:
7173
string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\":
7274
4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\":
73-
{\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2024-04-15
74-
16:24:33 UTC\",\"updated_at\":\"2024-04-15 16:24:34 UTC\",\"id\":4,\"name\":\"Test
75+
{\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2025-11-26
76+
08:13:21 UTC\",\"updated_at\":\"2025-11-26 08:13:23 UTC\",\"id\":3,\"name\":\"Test
7577
Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n"
7678
headers:
7779
Cache-Control:
@@ -80,10 +82,6 @@ interactions:
8082
- Keep-Alive
8183
Content-Length:
8284
- '388'
83-
Content-Security-Policy:
84-
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
85-
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
86-
style-src ''unsafe-inline'' ''self'''
8785
Content-Type:
8886
- application/json; charset=utf-8
8987
Foreman_api_version:
@@ -93,21 +91,27 @@ interactions:
9391
Foreman_current_organization:
9492
- ; ANY
9593
Foreman_version:
96-
- 3.11.0-develop
94+
- 3.18.0-develop
9795
Keep-Alive:
9896
- timeout=15, max=99
99-
Strict-Transport-Security:
97+
Referrer-Policy:
98+
- strict-origin-when-cross-origin
99+
content-security-policy:
100+
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
101+
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
102+
style-src ''unsafe-inline'' ''self'''
103+
strict-transport-security:
100104
- max-age=631139040; includeSubdomains
101-
X-Content-Type-Options:
105+
x-content-type-options:
102106
- nosniff
103-
X-Download-Options:
107+
x-download-options:
104108
- noopen
105-
X-Frame-Options:
109+
x-frame-options:
106110
- sameorigin
107-
X-Permitted-Cross-Domain-Policies:
111+
x-permitted-cross-domain-policies:
108112
- none
109-
X-XSS-Protection:
110-
- 1; mode=block
113+
x-xss-protection:
114+
- '0'
111115
status:
112116
code: 200
113117
message: OK
@@ -123,10 +127,10 @@ interactions:
123127
User-Agent:
124128
- apypie (https://github.com/Apipie/apypie)
125129
method: GET
126-
uri: https://foreman.example.org/katello/api/organizations/4/activation_keys?search=name%3D%22Test+Activation+Key%22&per_page=4294967296
130+
uri: https://foreman.example.org/katello/api/organizations/3/activation_keys?search=name%3D%22Test+Activation+Key%22&per_page=4294967296
127131
response:
128132
body:
129-
string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test
133+
string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":4294967296,"error":null,"search":"name=\"Test
130134
Activation Key\"","sort":{"by":"name","order":"asc"},"results":[]}
131135
132136
'
@@ -136,40 +140,42 @@ interactions:
136140
Connection:
137141
- Keep-Alive
138142
Content-Length:
139-
- '174'
140-
Content-Security-Policy:
141-
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
142-
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
143-
style-src ''unsafe-inline'' ''self'''
143+
- '172'
144144
Content-Type:
145145
- application/json; charset=utf-8
146146
Foreman_api_version:
147147
- '2'
148148
Foreman_current_location:
149149
- ; ANY
150150
Foreman_current_organization:
151-
- 4; Test Organization
151+
- 3; Test Organization
152152
Foreman_version:
153-
- 3.11.0-develop
153+
- 3.18.0-develop
154154
Keep-Alive:
155155
- timeout=15, max=98
156-
Strict-Transport-Security:
156+
Referrer-Policy:
157+
- strict-origin-when-cross-origin
158+
content-security-policy:
159+
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
160+
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
161+
style-src ''unsafe-inline'' ''self'''
162+
strict-transport-security:
157163
- max-age=631139040; includeSubdomains
158-
X-Content-Type-Options:
164+
x-content-type-options:
159165
- nosniff
160-
X-Download-Options:
166+
x-download-options:
161167
- noopen
162-
X-Frame-Options:
168+
x-frame-options:
163169
- sameorigin
164-
X-Permitted-Cross-Domain-Policies:
170+
x-permitted-cross-domain-policies:
165171
- none
166-
X-XSS-Protection:
167-
- 1; mode=block
172+
x-xss-protection:
173+
- '0'
168174
status:
169175
code: 200
170176
message: OK
171177
- request:
172-
body: '{"organization_id": 4, "name": "Test Activation Key"}'
178+
body: '{"name": "Test Activation Key", "organization_id": 3}'
173179
headers:
174180
Accept:
175181
- application/json;version=2
@@ -187,10 +193,10 @@ interactions:
187193
uri: https://foreman.example.org/katello/api/activation_keys
188194
response:
189195
body:
190-
string: ' {"service_level":null,"content_overrides":[],"id":16,"name":"Test
191-
Activation Key","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":null,"environment_id":null,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test
192-
Organization","label":"Test_Organization","id":4},"created_at":"2024-04-15
193-
16:24:42 UTC","updated_at":"2024-04-15 16:24:42 UTC","content_view":null,"environment":null,"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}
196+
string: ' {"service_level":null,"content_overrides":[],"id":1,"name":"Test
197+
Activation Key","description":null,"unlimited_hosts":true,"content_view_environment_labels":"","usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test
198+
Organization","label":"Test_Organization","id":3},"created_at":"2025-11-26
199+
08:13:42 UTC","updated_at":"2025-11-26 08:13:42 UTC","content_view_environments":[],"products":[],"host_collections":[],"multi_content_view_environment":false,"content_view_id":null,"content_view":null,"environment_id":null,"environment":null,"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}
194200
195201
'
196202
headers:
@@ -199,35 +205,37 @@ interactions:
199205
Connection:
200206
- Keep-Alive
201207
Content-Length:
202-
- '675'
203-
Content-Security-Policy:
204-
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
205-
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
206-
style-src ''unsafe-inline'' ''self'''
208+
- '742'
207209
Content-Type:
208210
- application/json; charset=utf-8
209211
Foreman_api_version:
210212
- '2'
211213
Foreman_current_location:
212214
- ; ANY
213215
Foreman_current_organization:
214-
- 4; Test Organization
216+
- 3; Test Organization
215217
Foreman_version:
216-
- 3.11.0-develop
218+
- 3.18.0-develop
217219
Keep-Alive:
218220
- timeout=15, max=97
219-
Strict-Transport-Security:
221+
Referrer-Policy:
222+
- strict-origin-when-cross-origin
223+
content-security-policy:
224+
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
225+
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
226+
style-src ''unsafe-inline'' ''self'''
227+
strict-transport-security:
220228
- max-age=631139040; includeSubdomains
221-
X-Content-Type-Options:
229+
x-content-type-options:
222230
- nosniff
223-
X-Download-Options:
231+
x-download-options:
224232
- noopen
225-
X-Frame-Options:
233+
x-frame-options:
226234
- sameorigin
227-
X-Permitted-Cross-Domain-Policies:
235+
x-permitted-cross-domain-policies:
228236
- none
229-
X-XSS-Protection:
230-
- 1; mode=block
237+
x-xss-protection:
238+
- '0'
231239
status:
232240
code: 201
233241
message: Created

0 commit comments

Comments
 (0)