From 8fe622d1ae014fe7bf5b66239859cbc3ce351127 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 24 Aug 2021 11:13:18 +0200 Subject: [PATCH 01/36] bump version to 2.3.0-dev --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 83298893..6628dde8 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -69,7 +69,7 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " -version: "2.2.0" +version: "2.3.0-dev" license: - "GPL-3.0-or-later" tags: From 4d909b8221b3ef3292d14536bd9c7463dc6fe124 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 24 Aug 2021 16:20:08 +0200 Subject: [PATCH 02/36] add tests for duplicate kt_activation_keys fix --- .../fixtures/katello_hostgroup-0.yml | 137 ++++----- .../fixtures/katello_hostgroup-1.yml | 139 ++++----- .../fixtures/katello_hostgroup-2.yml | 56 ++-- .../fixtures/katello_hostgroup-3.yml | 56 ++-- .../fixtures/katello_hostgroup-4.yml | 279 +++++++++++++++++- .../fixtures/katello_hostgroup-5.yml | 273 ++++++++++++++++- .../fixtures/katello_hostgroup-6.yml | 193 ++++++++++++ .../fixtures/katello_hostgroup-7.yml | 116 ++++++++ tests/test_playbooks/katello_hostgroup.yml | 26 ++ 9 files changed, 1062 insertions(+), 213 deletions(-) create mode 100644 tests/test_playbooks/fixtures/katello_hostgroup-6.yml create mode 100644 tests/test_playbooks/fixtures/katello_hostgroup-7.yml diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-0.yml b/tests/test_playbooks/fixtures/katello_hostgroup-0.yml index 52b21990..dd4f47c3 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-0.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-0.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -91,7 +91,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,11 +128,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -152,7 +152,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -170,7 +170,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -189,11 +189,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org2\",\"created_at\":\"2021-06-07 17:38:49 UTC\",\"updated_at\":\"\ - 2021-06-07 17:38:49 UTC\",\"id\":14,\"name\":\"Test Org2\",\"title\":\"Test\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ \ Org2\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -213,7 +213,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,8 +253,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Foo\\\"\",\n \"sort\": {\n \"\ by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\":null,\"\ - parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-06-07 14:56:51\ - \ UTC\",\"updated_at\":\"2021-06-07 14:56:51 UTC\",\"id\":7,\"name\":\"Foo\"\ + parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-24 14:10:05\ + \ UTC\",\"updated_at\":\"2021-08-24 14:10:05 UTC\",\"id\":4,\"name\":\"Foo\"\ ,\"title\":\"Foo\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -274,7 +274,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -314,8 +314,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Foo/Baz\\\"\",\n \"sort\": {\n \ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :\"7\",\"parent_id\":7,\"parent_name\":\"Foo\",\"created_at\":\"2021-06-07\ - \ 17:38:44 UTC\",\"updated_at\":\"2021-06-07 17:38:44 UTC\",\"id\":12,\"name\"\ + :\"4\",\"parent_id\":4,\"parent_name\":\"Foo\",\"created_at\":\"2021-08-24\ + \ 14:13:54 UTC\",\"updated_at\":\"2021-08-24 14:13:54 UTC\",\"id\":9,\"name\"\ :\"Baz\",\"title\":\"Foo/Baz\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -335,7 +335,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -353,7 +353,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '360' + - '359' status: code: 200 message: OK @@ -375,8 +375,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Bar\\\"\",\n \"sort\": {\n \"\ by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\":null,\"\ - parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-06-07 17:38:46\ - \ UTC\",\"updated_at\":\"2021-06-07 17:38:46 UTC\",\"id\":13,\"name\":\"Bar\"\ + parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-24 14:13:56\ + \ UTC\",\"updated_at\":\"2021-08-24 14:13:56 UTC\",\"id\":10,\"name\":\"Bar\"\ ,\"title\":\"Bar\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -396,7 +396,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -433,11 +433,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -457,7 +457,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: @@ -475,7 +475,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -491,23 +491,23 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/smart_proxies?organization_id=10&search=name%3D%22centos7-katello-4-0.yatsu.example.com%22&per_page=4294967296 + uri: https://foreman.example.org/api/smart_proxies?organization_id=7&search=name%3D%22centos7-katello-4-1.yatsu.example.com%22&per_page=4294967296 response: body: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"centos7-katello-4-0.yatsu.example.com\\\ + : 4294967296,\n \"search\": \"name=\\\"centos7-katello-4-1.yatsu.example.com\\\ \"\",\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"created_at\":\"2021-05-10 12:58:08 UTC\",\"updated_at\":\"2021-05-10\ - \ 12:58:12 UTC\",\"name\":\"centos7-katello-4-0.yatsu.example.com\",\"id\"\ - :1,\"url\":\"https://centos7-katello-4-0.yatsu.example.com:9090\",\"remote_execution_pubkey\"\ + : [{\"created_at\":\"2021-07-19 09:35:32 UTC\",\"updated_at\":\"2021-07-19\ + \ 09:35:32 UTC\",\"name\":\"centos7-katello-4-1.yatsu.example.com\",\"id\"\ + :1,\"url\":\"https://centos7-katello-4-1.yatsu.example.com:9090\",\"remote_execution_pubkey\"\ :null,\"download_policy\":\"on_demand\",\"supported_pulp_types\":{\"pulp2\"\ - :{\"supported_types\":[]},\"pulp3\":{\"supported_types\":[\"deb\",\"docker\"\ - ,\"file\",\"yum\"],\"overriden_to_pulp2\":[]}},\"features\":[{\"capabilities\"\ - :[\"pulp_certguard\",\"pulp_container\",\"pulp_deb\",\"pulp_file\",\"pulp_rpm\"\ - ,\"pulpcore\"],\"name\":\"Pulpcore\",\"id\":4},{\"capabilities\":[],\"name\"\ - :\"Puppet CA\",\"id\":10},{\"capabilities\":[],\"name\":\"Puppet\",\"id\"\ - :9},{\"capabilities\":[],\"name\":\"Logs\",\"id\":14},{\"capabilities\":[],\"\ - name\":\"Registration\",\"id\":17}]}]\n}\n" + :{\"supported_types\":[]},\"pulp3\":{\"supported_types\":[\"ansible_collection\"\ + ,\"deb\",\"docker\",\"file\",\"yum\"],\"overriden_to_pulp2\":[]}},\"features\"\ + :[{\"capabilities\":[\"ansible\",\"certguard\",\"container\",\"core\",\"deb\"\ + ,\"file\",\"rpm\"],\"name\":\"Pulpcore\",\"id\":4},{\"capabilities\":[],\"\ + name\":\"Puppet CA\",\"id\":10},{\"capabilities\":[],\"name\":\"Puppet\",\"\ + id\":9},{\"capabilities\":[],\"name\":\"Logs\",\"id\":14},{\"capabilities\"\ + :[],\"name\":\"Registration\",\"id\":17}]}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -524,9 +524,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=92 Strict-Transport-Security: @@ -544,7 +544,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '912' + - '914' status: code: 200 message: OK @@ -560,12 +560,12 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/10/environments?search=name%3D%22Library%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/7/environments?search=name%3D%22Library%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":6,"name":"Library","label":"Library","description":null,"organization_id":10,"organization":{"name":"Test - Org1","label":"Test_Org1","id":10},"created_at":"2021-06-07 14:56:57 UTC","updated_at":"2021-06-07 - 14:56:57 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":1,"packages":0,"puppet_modules":0,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":0,"total":null},"yum_repositories":0,"docker_repositories":0,"ostree_repositories":0,"products":0},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + string: '{"total":1,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":3,"name":"Library","label":"Library","description":null,"organization_id":7,"organization":{"name":"Test + Org1","label":"Test_Org1","id":7},"created_at":"2021-08-24 14:10:14 UTC","updated_at":"2021-08-24 + 14:10:14 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":1,"packages":0,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":0,"total":null},"yum_repositories":0,"docker_repositories":0,"ostree_repositories":0,"products":0},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} ' headers: @@ -584,9 +584,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=91 Strict-Transport-Security: @@ -604,7 +604,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '948' + - '927' status: code: 200 message: OK @@ -620,14 +620,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/10/content_views?environment_id=6&search=name%3D%22my_content%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/7/content_views?environment_id=3&search=name%3D%22my_content%22&per_page=4294967296 response: body: - string: '{"total":2,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"my_content\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":false,"force_puppet_environment":false,"version_count":1,"latest_version":"1.0","auto_publish":false,"solve_dependencies":false,"import_only":false,"repository_ids":[],"id":8,"name":"my_content","label":"my_content","description":null,"organization_id":10,"organization":{"name":"Test - Org1","label":"Test_Org1","id":10},"created_at":"2021-06-07 14:57:05 UTC","updated_at":"2021-06-07 - 14:57:06 UTC","environments":[{"id":6,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"puppet_modules":[],"versions":[{"id":8,"version":"1.0","published":"2021-06-07 - 14:57:06 UTC","environment_ids":[6]}],"components":[],"content_view_components":[],"activation_keys":[],"next_version":"2.0","last_published":"2021-06-07 - 14:57:06 UTC","permissions":{"view_content_views":true,"edit_content_views":true,"destroy_content_views":true,"publish_content_views":true,"promote_or_remove_content_views":true}}]} + string: '{"total":2,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"my_content\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":false,"version_count":1,"latest_version":"1.0","latest_version_id":5,"auto_publish":false,"solve_dependencies":false,"import_only":false,"repository_ids":[],"id":5,"name":"my_content","label":"my_content","description":null,"organization_id":7,"organization":{"name":"Test + Org1","label":"Test_Org1","id":7},"created_at":"2021-08-24 14:10:22 UTC","updated_at":"2021-08-24 + 14:10:24 UTC","last_task":{"id":"b71d204a-4f92-4e08-815d-ec30c28b580d","result":"successful","last_sync_words":"4 + minutes"},"latest_version_environments":[{"id":3,"name":"Library","label":"Library"}],"environments":[{"id":3,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":5,"version":"1.0","published":"2021-08-24 + 14:10:24 UTC","environment_ids":[3]}],"components":[],"content_view_components":[],"activation_keys":[],"hosts":[],"next_version":"2.0","last_published":"2021-08-24 + 14:10:24 UTC","permissions":{"view_content_views":true,"edit_content_views":true,"destroy_content_views":true,"publish_content_views":true,"promote_or_remove_content_views":true}}]} ' headers: @@ -646,9 +647,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=90 Strict-Transport-Security: @@ -666,7 +667,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1120' + - '1284' status: code: 200 message: OK @@ -674,8 +675,8 @@ interactions: body: '{"hostgroup": {"name": "New host group", "group_parameters_attributes": [{"name": "test_param_one", "parameter_type": "string", "value": "oneoneone"}, {"name": "kt_activation_keys", "parameter_type": "string", "value": "key_one"}], - "location_ids": [7, 12, 13], "organization_ids": [10, 14], "content_source_id": - 1, "content_view_id": 8, "lifecycle_environment_id": 6}}' + "location_ids": [4, 9, 10], "organization_ids": [7, 11], "content_source_id": + 1, "content_view_id": 5, "lifecycle_environment_id": 3}}' headers: Accept: - application/json;version=2 @@ -684,7 +685,7 @@ interactions: Connection: - keep-alive Content-Length: - - '368' + - '366' Content-Type: - application/json User-Agent: @@ -693,12 +694,12 @@ interactions: uri: https://foreman.example.org/api/hostgroups response: body: - string: '{"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":8,"name":"New host - group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":14,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":13,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":7,"name":"Foo","title":"Foo","description":null},{"id":12,"name":"Baz","title":"Foo/Baz","description":null},{"id":13,"name":"Bar","title":"Bar","description":null}],"organizations":[{"id":10,"name":"Test - Org1","title":"Test Org1","description":"A test organization"},{"id":14,"name":"Test + string: '{"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":6,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null},{"id":10,"name":"Bar","title":"Bar","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test Org2","title":"Test Org2","description":"A test organization"}]}' headers: Cache-Control: @@ -718,7 +719,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=89 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-1.yml b/tests/test_playbooks/fixtures/katello_hostgroup-1.yml index f9080083..7fd5c64d 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-1.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-1.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -80,8 +80,8 @@ interactions: :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-06-07 17:38:56 UTC\",\"updated_at\"\ - :\"2021-06-07 17:38:56 UTC\",\"id\":8,\"name\":\"New host group\",\"title\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -108,7 +108,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -142,15 +142,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hostgroups/8 + uri: https://foreman.example.org/api/hostgroups/2 response: body: - string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-0.yatsu.example.com","content_view_id":8,"content_view_name":"my_content","lifecycle_environment_id":6,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":8,"name":"New host - group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":14,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":13,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":13,"name":"Bar","title":"Bar","description":null},{"id":7,"name":"Foo","title":"Foo","description":null},{"id":12,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":10,"name":"Test - Org1","title":"Test Org1","description":"A test organization"},{"id":14,"name":"Test + string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-1.yatsu.example.com","content_view_id":5,"content_view_name":"my_content","lifecycle_environment_id":3,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":6,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test Org2","title":"Test Org2","description":"A test organization"}]}' headers: Cache-Control: @@ -170,7 +170,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -188,7 +188,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2334' + - '2330' status: code: 200 message: OK @@ -207,11 +207,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -231,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -249,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -268,11 +268,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org2\",\"created_at\":\"2021-06-07 17:38:49 UTC\",\"updated_at\":\"\ - 2021-06-07 17:38:49 UTC\",\"id\":14,\"name\":\"Test Org2\",\"title\":\"Test\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ \ Org2\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -292,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -332,8 +332,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Foo\\\"\",\n \"sort\": {\n \"\ by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\":null,\"\ - parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-06-07 14:56:51\ - \ UTC\",\"updated_at\":\"2021-06-07 14:56:51 UTC\",\"id\":7,\"name\":\"Foo\"\ + parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-24 14:10:05\ + \ UTC\",\"updated_at\":\"2021-08-24 14:10:05 UTC\",\"id\":4,\"name\":\"Foo\"\ ,\"title\":\"Foo\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -393,8 +393,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Foo/Baz\\\"\",\n \"sort\": {\n \ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :\"7\",\"parent_id\":7,\"parent_name\":\"Foo\",\"created_at\":\"2021-06-07\ - \ 17:38:44 UTC\",\"updated_at\":\"2021-06-07 17:38:44 UTC\",\"id\":12,\"name\"\ + :\"4\",\"parent_id\":4,\"parent_name\":\"Foo\",\"created_at\":\"2021-08-24\ + \ 14:13:54 UTC\",\"updated_at\":\"2021-08-24 14:13:54 UTC\",\"id\":9,\"name\"\ :\"Baz\",\"title\":\"Foo/Baz\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -414,7 +414,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -432,7 +432,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '360' + - '359' status: code: 200 message: OK @@ -454,8 +454,8 @@ interactions: string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Bar\\\"\",\n \"sort\": {\n \"\ by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\":null,\"\ - parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-06-07 17:38:46\ - \ UTC\",\"updated_at\":\"2021-06-07 17:38:46 UTC\",\"id\":13,\"name\":\"Bar\"\ + parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-24 14:13:56\ + \ UTC\",\"updated_at\":\"2021-08-24 14:13:56 UTC\",\"id\":10,\"name\":\"Bar\"\ ,\"title\":\"Bar\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -475,7 +475,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: @@ -512,11 +512,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -536,7 +536,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=92 Strict-Transport-Security: @@ -554,7 +554,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -570,23 +570,23 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/smart_proxies?organization_id=10&search=name%3D%22centos7-katello-4-0.yatsu.example.com%22&per_page=4294967296 + uri: https://foreman.example.org/api/smart_proxies?organization_id=7&search=name%3D%22centos7-katello-4-1.yatsu.example.com%22&per_page=4294967296 response: body: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"centos7-katello-4-0.yatsu.example.com\\\ + : 4294967296,\n \"search\": \"name=\\\"centos7-katello-4-1.yatsu.example.com\\\ \"\",\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"created_at\":\"2021-05-10 12:58:08 UTC\",\"updated_at\":\"2021-05-10\ - \ 12:58:12 UTC\",\"name\":\"centos7-katello-4-0.yatsu.example.com\",\"id\"\ - :1,\"url\":\"https://centos7-katello-4-0.yatsu.example.com:9090\",\"remote_execution_pubkey\"\ + : [{\"created_at\":\"2021-07-19 09:35:32 UTC\",\"updated_at\":\"2021-07-19\ + \ 09:35:32 UTC\",\"name\":\"centos7-katello-4-1.yatsu.example.com\",\"id\"\ + :1,\"url\":\"https://centos7-katello-4-1.yatsu.example.com:9090\",\"remote_execution_pubkey\"\ :null,\"download_policy\":\"on_demand\",\"supported_pulp_types\":{\"pulp2\"\ - :{\"supported_types\":[]},\"pulp3\":{\"supported_types\":[\"deb\",\"docker\"\ - ,\"file\",\"yum\"],\"overriden_to_pulp2\":[]}},\"features\":[{\"capabilities\"\ - :[\"pulp_certguard\",\"pulp_container\",\"pulp_deb\",\"pulp_file\",\"pulp_rpm\"\ - ,\"pulpcore\"],\"name\":\"Pulpcore\",\"id\":4},{\"capabilities\":[],\"name\"\ - :\"Puppet CA\",\"id\":10},{\"capabilities\":[],\"name\":\"Puppet\",\"id\"\ - :9},{\"capabilities\":[],\"name\":\"Logs\",\"id\":14},{\"capabilities\":[],\"\ - name\":\"Registration\",\"id\":17}]}]\n}\n" + :{\"supported_types\":[]},\"pulp3\":{\"supported_types\":[\"ansible_collection\"\ + ,\"deb\",\"docker\",\"file\",\"yum\"],\"overriden_to_pulp2\":[]}},\"features\"\ + :[{\"capabilities\":[\"ansible\",\"certguard\",\"container\",\"core\",\"deb\"\ + ,\"file\",\"rpm\"],\"name\":\"Pulpcore\",\"id\":4},{\"capabilities\":[],\"\ + name\":\"Puppet CA\",\"id\":10},{\"capabilities\":[],\"name\":\"Puppet\",\"\ + id\":9},{\"capabilities\":[],\"name\":\"Logs\",\"id\":14},{\"capabilities\"\ + :[],\"name\":\"Registration\",\"id\":17}]}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -603,9 +603,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=91 Strict-Transport-Security: @@ -623,7 +623,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '912' + - '914' status: code: 200 message: OK @@ -639,12 +639,12 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/10/environments?search=name%3D%22Library%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/7/environments?search=name%3D%22Library%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":6,"name":"Library","label":"Library","description":null,"organization_id":10,"organization":{"name":"Test - Org1","label":"Test_Org1","id":10},"created_at":"2021-06-07 14:56:57 UTC","updated_at":"2021-06-07 - 14:56:57 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":1,"packages":0,"puppet_modules":0,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":0,"total":null},"yum_repositories":0,"docker_repositories":0,"ostree_repositories":0,"products":0},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + string: '{"total":1,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":3,"name":"Library","label":"Library","description":null,"organization_id":7,"organization":{"name":"Test + Org1","label":"Test_Org1","id":7},"created_at":"2021-08-24 14:10:14 UTC","updated_at":"2021-08-24 + 14:10:14 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":1,"packages":0,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":0,"total":null},"yum_repositories":0,"docker_repositories":0,"ostree_repositories":0,"products":0},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} ' headers: @@ -663,9 +663,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=90 Strict-Transport-Security: @@ -683,7 +683,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '948' + - '927' status: code: 200 message: OK @@ -699,14 +699,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/10/content_views?environment_id=6&search=name%3D%22my_content%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/7/content_views?environment_id=3&search=name%3D%22my_content%22&per_page=4294967296 response: body: - string: '{"total":2,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"my_content\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":false,"force_puppet_environment":false,"version_count":1,"latest_version":"1.0","auto_publish":false,"solve_dependencies":false,"import_only":false,"repository_ids":[],"id":8,"name":"my_content","label":"my_content","description":null,"organization_id":10,"organization":{"name":"Test - Org1","label":"Test_Org1","id":10},"created_at":"2021-06-07 14:57:05 UTC","updated_at":"2021-06-07 - 14:57:06 UTC","environments":[{"id":6,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"puppet_modules":[],"versions":[{"id":8,"version":"1.0","published":"2021-06-07 - 14:57:06 UTC","environment_ids":[6]}],"components":[],"content_view_components":[],"activation_keys":[],"next_version":"2.0","last_published":"2021-06-07 - 14:57:06 UTC","permissions":{"view_content_views":true,"edit_content_views":true,"destroy_content_views":true,"publish_content_views":true,"promote_or_remove_content_views":true}}]} + string: '{"total":2,"subtotal":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"my_content\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":false,"version_count":1,"latest_version":"1.0","latest_version_id":5,"auto_publish":false,"solve_dependencies":false,"import_only":false,"repository_ids":[],"id":5,"name":"my_content","label":"my_content","description":null,"organization_id":7,"organization":{"name":"Test + Org1","label":"Test_Org1","id":7},"created_at":"2021-08-24 14:10:22 UTC","updated_at":"2021-08-24 + 14:10:24 UTC","last_task":{"id":"b71d204a-4f92-4e08-815d-ec30c28b580d","result":"successful","last_sync_words":"4 + minutes"},"latest_version_environments":[{"id":3,"name":"Library","label":"Library"}],"environments":[{"id":3,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":5,"version":"1.0","published":"2021-08-24 + 14:10:24 UTC","environment_ids":[3]}],"components":[],"content_view_components":[],"activation_keys":[],"hosts":[],"next_version":"2.0","last_published":"2021-08-24 + 14:10:24 UTC","permissions":{"view_content_views":true,"edit_content_views":true,"destroy_content_views":true,"publish_content_views":true,"promote_or_remove_content_views":true}}]} ' headers: @@ -725,9 +726,9 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 10; Test Org1 + - 7; Test Org1 Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=89 Strict-Transport-Security: @@ -745,7 +746,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1120' + - '1284' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-2.yml b/tests/test_playbooks/fixtures/katello_hostgroup-2.yml index d9c10f11..44597cdb 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-2.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-2.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -80,8 +80,8 @@ interactions: :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-06-07 17:38:56 UTC\",\"updated_at\"\ - :\"2021-06-07 17:38:56 UTC\",\"id\":8,\"name\":\"New host group\",\"title\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -108,7 +108,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -142,15 +142,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hostgroups/8 + uri: https://foreman.example.org/api/hostgroups/2 response: body: - string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-0.yatsu.example.com","content_view_id":8,"content_view_name":"my_content","lifecycle_environment_id":6,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":8,"name":"New host - group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":14,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":13,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":13,"name":"Bar","title":"Bar","description":null},{"id":7,"name":"Foo","title":"Foo","description":null},{"id":12,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":10,"name":"Test - Org1","title":"Test Org1","description":"A test organization"},{"id":14,"name":"Test + string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-1.yatsu.example.com","content_view_id":5,"content_view_name":"my_content","lifecycle_environment_id":3,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":6,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test Org2","title":"Test Org2","description":"A test organization"}]}' headers: Cache-Control: @@ -170,7 +170,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -188,7 +188,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2334' + - '2330' status: code: 200 message: OK @@ -207,11 +207,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -231,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -249,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -268,11 +268,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org2\",\"created_at\":\"2021-06-07 17:38:49 UTC\",\"updated_at\":\"\ - 2021-06-07 17:38:49 UTC\",\"id\":14,\"name\":\"Test Org2\",\"title\":\"Test\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ \ Org2\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -292,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -329,11 +329,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -371,7 +371,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-3.yml b/tests/test_playbooks/fixtures/katello_hostgroup-3.yml index d9c10f11..44597cdb 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-3.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-3.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -80,8 +80,8 @@ interactions: :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-06-07 17:38:56 UTC\",\"updated_at\"\ - :\"2021-06-07 17:38:56 UTC\",\"id\":8,\"name\":\"New host group\",\"title\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -108,7 +108,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -142,15 +142,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hostgroups/8 + uri: https://foreman.example.org/api/hostgroups/2 response: body: - string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-0.yatsu.example.com","content_view_id":8,"content_view_name":"my_content","lifecycle_environment_id":6,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":8,"name":"New host - group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":14,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-06-07 - 17:38:56 UTC","updated_at":"2021-06-07 17:38:56 UTC","id":13,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":13,"name":"Bar","title":"Bar","description":null},{"id":7,"name":"Foo","title":"Foo","description":null},{"id":12,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":10,"name":"Test - Org1","title":"Test Org1","description":"A test organization"},{"id":14,"name":"Test + string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-1.yatsu.example.com","content_view_id":5,"content_view_name":"my_content","lifecycle_environment_id":3,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":6,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test Org2","title":"Test Org2","description":"A test organization"}]}' headers: Cache-Control: @@ -170,7 +170,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -188,7 +188,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2334' + - '2330' status: code: 200 message: OK @@ -207,11 +207,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -231,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -249,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK @@ -268,11 +268,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org2\",\"created_at\":\"2021-06-07 17:38:49 UTC\",\"updated_at\":\"\ - 2021-06-07 17:38:49 UTC\",\"id\":14,\"name\":\"Test Org2\",\"title\":\"Test\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ \ Org2\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -292,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -329,11 +329,11 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Org1\",\"created_at\":\"2021-06-07 14:56:56 UTC\",\"updated_at\":\"\ - 2021-06-07 14:56:56 UTC\",\"id\":10,\"name\":\"Test Org1\",\"title\":\"Test\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ \ Org1\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -371,7 +371,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '357' + - '356' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-4.yml b/tests/test_playbooks/fixtures/katello_hostgroup-4.yml index 19bc7f5b..83630c5a 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-4.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-4.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -80,8 +80,8 @@ interactions: :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-06-07 17:38:56 UTC\",\"updated_at\"\ - :\"2021-06-07 17:38:56 UTC\",\"id\":8,\"name\":\"New host group\",\"title\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -108,7 +108,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -139,17 +139,19 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/api/hostgroups/8 + method: GET + uri: https://foreman.example.org/api/hostgroups/2 response: body: - string: '{"id":8,"name":"New host group","created_at":"2021-06-07T17:38:56.924Z","updated_at":"2021-06-07T17:38:56.924Z","environment_id":null,"operatingsystem_id":null,"architecture_id":null,"medium_id":null,"ptable_id":null,"root_pass":null,"puppet_ca_proxy_id":null,"use_image":null,"image_file":"","ancestry":null,"vm_defaults":null,"subnet_id":null,"domain_id":null,"puppet_proxy_id":null,"title":"New - host group","realm_id":null,"compute_profile_id":null,"grub_pass":"","lookup_value_matcher":"hostgroup=New - host group","subnet6_id":null,"pxe_loader":null,"description":null,"compute_resource_id":null,"content_facet_attributes":{"id":8,"hostgroup_id":8,"kickstart_repository_id":null,"content_source_id":1,"content_view_id":8,"lifecycle_environment_id":6}}' + string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-1.yatsu.example.com","content_view_id":5,"content_view_name":"my_content","lifecycle_environment_id":3,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"key_one"},{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":6,"name":"test_param_one","parameter_type":"string","value":"oneoneone"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test + Org2","title":"Test Org2","description":"A test organization"}]}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +170,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -186,7 +188,256 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '754' + - '2330' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ + \ Org1\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '356' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ + \ Org2\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '357' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ + \ Org1\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '356' + status: + code: 200 + message: OK +- request: + body: '{"hostgroup": {"group_parameters_attributes": [{"name": "kt_activation_keys", + "parameter_type": "string", "value": "new_key"}]}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '128' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/api/hostgroups/2 + response: + body: + string: '{"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:08 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"new_key"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test + Org2","title":"Test Org2","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1923' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-5.yml b/tests/test_playbooks/fixtures/katello_hostgroup-5.yml index f983e557..4fee3427 100644 --- a/tests/test_playbooks/fixtures/katello_hostgroup-5.yml +++ b/tests/test_playbooks/fixtures/katello_hostgroup-5.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.4.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -70,9 +70,26 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22New+host+group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 0,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"New host group\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": []\n}\n" + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ + :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ + :null,\"domain_id\":null,\"domain_name\":null,\"environment_id\":null,\"environment_name\"\ + :null,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ + :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ + :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ + :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ + :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ + :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ + :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ + :null,\"inherited_pxe_loader\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -91,7 +108,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.4.0 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -109,7 +126,251 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '181' + - '1457' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hostgroups/2 + response: + body: + string: '{"content_source_id":1,"content_source_name":"centos7-katello-4-1.yatsu.example.com","content_view_id":5,"content_view_name":"my_content","lifecycle_environment_id":3,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"environment_id":null,"environment_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:04 UTC","id":2,"name":"New host + group","title":"New host group","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_environment_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-08-24 + 14:14:04 UTC","updated_at":"2021-08-24 14:14:08 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"new_key"}],"template_combinations":[],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"locations":[{"id":10,"name":"Bar","title":"Bar","description":null},{"id":4,"name":"Foo","title":"Foo","description":null},{"id":9,"name":"Baz","title":"Foo/Baz","description":null}],"organizations":[{"id":7,"name":"Test + Org1","title":"Test Org1","description":"A test organization"},{"id":11,"name":"Test + Org2","title":"Test Org2","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2159' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ + \ Org1\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '356' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org2%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org2\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org2\",\"created_at\":\"2021-08-24 14:13:58 UTC\",\"updated_at\":\"\ + 2021-08-24 14:14:00 UTC\",\"id\":11,\"name\":\"Test Org2\",\"title\":\"Test\ + \ Org2\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '357' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Org1%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Org1\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ + :\"Test_Org1\",\"created_at\":\"2021-08-24 14:10:13 UTC\",\"updated_at\":\"\ + 2021-08-24 14:10:18 UTC\",\"id\":7,\"name\":\"Test Org1\",\"title\":\"Test\ + \ Org1\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '356' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-6.yml b/tests/test_playbooks/fixtures/katello_hostgroup-6.yml new file mode 100644 index 00000000..fa0b50e5 --- /dev/null +++ b/tests/test_playbooks/fixtures/katello_hostgroup-6.yml @@ -0,0 +1,193 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hostgroups?search=title%3D%22New+host+group%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"New host group\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ + :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ + :null,\"domain_id\":null,\"domain_name\":null,\"environment_id\":null,\"environment_name\"\ + :null,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-24 14:14:04 UTC\",\"updated_at\"\ + :\"2021-08-24 14:14:04 UTC\",\"id\":2,\"name\":\"New host group\",\"title\"\ + :\"New host group\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\"\ + :null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\"\ + :null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ + :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ + :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ + :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ + :null,\"inherited_pxe_loader\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1457' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/api/hostgroups/2 + response: + body: + string: '{"id":2,"name":"New host group","created_at":"2021-08-24T14:14:04.230Z","updated_at":"2021-08-24T14:14:04.230Z","environment_id":null,"operatingsystem_id":null,"architecture_id":null,"medium_id":null,"ptable_id":null,"root_pass":null,"puppet_ca_proxy_id":null,"use_image":null,"image_file":"","ancestry":null,"vm_defaults":null,"subnet_id":null,"domain_id":null,"puppet_proxy_id":null,"title":"New + host group","realm_id":null,"compute_profile_id":null,"grub_pass":"","lookup_value_matcher":"hostgroup=New + host group","subnet6_id":null,"pxe_loader":null,"description":null,"compute_resource_id":null,"content_facet_attributes":{"id":2,"hostgroup_id":2,"kickstart_repository_id":null,"content_source_id":1,"content_view_id":5,"lifecycle_environment_id":3}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '754' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/katello_hostgroup-7.yml b/tests/test_playbooks/fixtures/katello_hostgroup-7.yml new file mode 100644 index 00000000..5e1671e4 --- /dev/null +++ b/tests/test_playbooks/fixtures/katello_hostgroup-7.yml @@ -0,0 +1,116 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hostgroups?search=title%3D%22New+host+group%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 0,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"New host group\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": []\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '181' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/katello_hostgroup.yml b/tests/test_playbooks/katello_hostgroup.yml index f4ffe62f..3bc8e162 100644 --- a/tests/test_playbooks/katello_hostgroup.yml +++ b/tests/test_playbooks/katello_hostgroup.yml @@ -99,6 +99,32 @@ hostgroup_state: present expected_change: false + - name: only set AK via params + include_tasks: tasks/hostgroup.yml + vars: + hostgroup_name: "New host group" + hostgroup_organizations: "{{ hostgroup.organizations }}" + hostgroup_organization: "{{ hostgroup.organizations | first }}" + hostgroup_parameters: + - name: kt_activation_keys + parameter_type: string + value: new_key + hostgroup_state: present + expected_change: true + + - name: only set AK via params, again, no change + include_tasks: tasks/hostgroup.yml + vars: + hostgroup_name: "New host group" + hostgroup_organizations: "{{ hostgroup.organizations }}" + hostgroup_organization: "{{ hostgroup.organizations | first }}" + hostgroup_parameters: + - name: kt_activation_keys + parameter_type: string + value: new_key + hostgroup_state: present + expected_change: false + - name: delete HG include_tasks: tasks/hostgroup.yml vars: From 533aa6994c54df2a857ea0e0bf5978fc45a156a1 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg <2500@gmx.de> Date: Mon, 28 Jun 2021 11:41:11 +0200 Subject: [PATCH 03/36] Refactor ensure_puppetclasses --- plugins/module_utils/foreman_helper.py | 25 ++++++++++++++++-------- tests/test_playbooks/tasks/hostgroup.yml | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index 69fe1197..a0959ffe 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1779,20 +1779,29 @@ def build_fqn(name, parent=None): # Helper for puppetclasses def ensure_puppetclasses(module, entity_type, entity, expected_puppetclasses=None): - puppetclasses_resource = '{0}_classes'.format(entity_type) if expected_puppetclasses: + puppetclasses_resource = '{0}_classes'.format(entity_type) expected_puppetclasses = module.find_puppetclasses(expected_puppetclasses, environment=entity['environment_id'], thin=True) - current_puppetclasses = entity.pop('puppetclass_ids', []) - if expected_puppetclasses: + current_puppetclass_ids = entity.get('puppetclass_ids', []) + previous_puppetclass_ids = current_puppetclass_ids[:] for puppetclass in expected_puppetclasses: - if puppetclass['id'] in current_puppetclasses: - current_puppetclasses.remove(puppetclass['id']) + if puppetclass['id'] in current_puppetclass_ids: + # Nothing to do, prevent removal + previous_puppetclass_ids.remove(puppetclass['id']) else: payload = {'{0}_id'.format(entity_type): entity['id'], 'puppetclass_id': puppetclass['id']} module.ensure_entity(puppetclasses_resource, {}, None, params=payload, state='present', foreman_spec={}) - if len(current_puppetclasses) > 0: - for leftover_puppetclass in current_puppetclasses: - module.ensure_entity(puppetclasses_resource, {}, {'id': leftover_puppetclass}, {'hostgroup_id': entity['id']}, state='absent', foreman_spec={}) + # Add to entity for reporting + current_puppetclass_ids.append(puppetclass['id']) + + if len(previous_puppetclass_ids) > 0: + for leftover_puppetclass in previous_puppetclass_ids: + payload = {'{0}_id'.format(entity_type): entity['id']} + module.ensure_entity( + puppetclasses_resource, {}, {'id': leftover_puppetclass}, + params=payload, state='absent', foreman_spec={}, + ) + current_puppetclass_ids.remove(leftover_puppetclass) # Helper constants diff --git a/tests/test_playbooks/tasks/hostgroup.yml b/tests/test_playbooks/tasks/hostgroup.yml index 7da0e6b0..c1e5c533 100644 --- a/tests/test_playbooks/tasks/hostgroup.yml +++ b/tests/test_playbooks/tasks/hostgroup.yml @@ -1,5 +1,5 @@ --- -- name: "Ensure Hostrgoup '{{ hostgroup_name }}' is {{ hostgroup_state }} change {{ expected_change }} " +- name: "Ensure Hostgroup '{{ hostgroup_name }}' is {{ hostgroup_state }} change {{ expected_change }} " vars: hostgroup_name: "test_hostgroup" hostgroup_state: present From cbd378ef891769ae87170d4670f9603101f6bf41 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 12:41:13 +0200 Subject: [PATCH 04/36] return un-flattened entity when no update was needed --- plugins/module_utils/foreman_helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index a0959ffe..19695ac6 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1074,11 +1074,11 @@ def _update_entity(self, resource, desired_entity, current_entity, params, forem """ payload = {} desired_entity = _flatten_entity(desired_entity, foreman_spec) - current_entity = _flatten_entity(current_entity, foreman_spec) + current_flat_entity = _flatten_entity(current_entity, foreman_spec) for key, value in desired_entity.items(): foreman_type = foreman_spec[key].get('type', 'str') new_value = value - old_value = current_entity.get(key) + old_value = current_flat_entity.get(key) # String comparison needs extra care in face of unicode if foreman_type == 'str': old_value = to_native(old_value) @@ -1096,14 +1096,14 @@ def _update_entity(self, resource, desired_entity, current_entity, params, forem if new_value != old_value: payload[key] = value if self._validate_supported_payload(resource, 'update', payload): - payload['id'] = current_entity['id'] + payload['id'] = current_flat_entity['id'] if not self.check_mode: if params: payload.update(params) return self.resource_action(resource, 'update', payload) else: # In check_mode we emulate the server updating the entity - fake_entity = current_entity.copy() + fake_entity = current_flat_entity.copy() fake_entity.update(payload) self.set_changed() return fake_entity From cd053f89d8d20e7d0c875def046e1b6c111dd887 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 12:41:54 +0200 Subject: [PATCH 05/36] fetch the real puppetclasses from the entity --- plugins/module_utils/foreman_helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index 19695ac6..ff3f4ec0 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1782,7 +1782,8 @@ def ensure_puppetclasses(module, entity_type, entity, expected_puppetclasses=Non if expected_puppetclasses: puppetclasses_resource = '{0}_classes'.format(entity_type) expected_puppetclasses = module.find_puppetclasses(expected_puppetclasses, environment=entity['environment_id'], thin=True) - current_puppetclass_ids = entity.get('puppetclass_ids', []) + current_puppetclasses = entity.get('puppetclasses', []) + current_puppetclass_ids = [pc['id'] for pc in current_puppetclasses] previous_puppetclass_ids = current_puppetclass_ids[:] for puppetclass in expected_puppetclasses: if puppetclass['id'] in current_puppetclass_ids: From 83f11732939b643c8ee72bf2a170ebd997f9b8f6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 13:09:26 +0200 Subject: [PATCH 06/36] re-record fixtures after changes --- tests/test_playbooks/fixtures/host-0.yml | 47 +++--- tests/test_playbooks/fixtures/host-1.yml | 45 +++--- tests/test_playbooks/fixtures/host-10.yml | 86 +++++------ tests/test_playbooks/fixtures/host-11.yml | 84 +++++------ tests/test_playbooks/fixtures/host-12.yml | 97 ++++++------- tests/test_playbooks/fixtures/host-13.yml | 74 +++++----- tests/test_playbooks/fixtures/host-14.yml | 18 +-- tests/test_playbooks/fixtures/host-15.yml | 8 +- tests/test_playbooks/fixtures/host-16.yml | 76 +++++----- tests/test_playbooks/fixtures/host-17.yml | 74 +++++----- tests/test_playbooks/fixtures/host-18.yml | 18 +-- tests/test_playbooks/fixtures/host-19.yml | 8 +- tests/test_playbooks/fixtures/host-2.yml | 78 +++++----- tests/test_playbooks/fixtures/host-20.yml | 47 +++--- tests/test_playbooks/fixtures/host-21.yml | 45 +++--- tests/test_playbooks/fixtures/host-22.yml | 18 +-- tests/test_playbooks/fixtures/host-23.yml | 61 ++++---- tests/test_playbooks/fixtures/host-24.yml | 59 ++++---- tests/test_playbooks/fixtures/host-25.yml | 18 +-- tests/test_playbooks/fixtures/host-26.yml | 168 ++++------------------ tests/test_playbooks/fixtures/host-27.yml | 47 +++--- tests/test_playbooks/fixtures/host-28.yml | 20 +-- tests/test_playbooks/fixtures/host-29.yml | 47 +++--- tests/test_playbooks/fixtures/host-3.yml | 57 ++++---- tests/test_playbooks/fixtures/host-30.yml | 70 ++++----- tests/test_playbooks/fixtures/host-31.yml | 47 +++--- tests/test_playbooks/fixtures/host-32.yml | 20 +-- tests/test_playbooks/fixtures/host-4.yml | 70 ++++----- tests/test_playbooks/fixtures/host-5.yml | 49 +++---- tests/test_playbooks/fixtures/host-6.yml | 90 ++++++------ tests/test_playbooks/fixtures/host-7.yml | 69 ++++----- tests/test_playbooks/fixtures/host-8.yml | 18 +-- tests/test_playbooks/fixtures/host-9.yml | 8 +- 33 files changed, 821 insertions(+), 920 deletions(-) diff --git a/tests/test_playbooks/fixtures/host-0.yml b/tests/test_playbooks/fixtures/host-0.yml index b2f67748..1f6bd7b7 100644 --- a/tests/test_playbooks/fixtures/host-0.yml +++ b/tests/test_playbooks/fixtures/host-0.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "build": false, "managed": false}}' + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,13 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MDksImp0aSI6IjdiZDIzNTg5ODhjZTg5OWY4MmEzZjFjOWM2NTU4OTE2YjJmMzE3Y2E0OTJkZTJkYzA4OTY2YTJiZWNjZDllMTUiLCJleHAiOjE2MDgxMDg5MDksIm5iZiI6MTYwODAxODkwOX0.MeZ5lC7jKWet3b4uLjxkDicWif_Bfm9KFCGr0J420_I","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -278,11 +279,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-1.yml b/tests/test_playbooks/fixtures/host-1.yml index 8000a916..4987c746 100644 --- a/tests/test_playbooks/fixtures/host-1.yml +++ b/tests/test_playbooks/fixtures/host-1.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTAsImp0aSI6IjU3ZmQ1NDJkN2UyZGEzODYwYmM3ZjQ5ZjZlYWQyOTgwYWY2ZmFkYmY1NDliMDY1OThmOTY3NDcyYWNhYWE3NDMiLCJleHAiOjE2MDgxMDg5MTAsIm5iZiI6MTYwODAxODkxMH0.RZBgsrg_46Lmka2mkzvt5IJxkiJMLu28KunMrJqBo6U","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2857' + - '2709' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-10.yml b/tests/test_playbooks/fixtures/host-10.yml index fa217a40..aad97a98 100644 --- a/tests/test_playbooks/fixtures/host-10.yml +++ b/tests/test_playbooks/fixtures/host-10.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,27 +129,26 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":3,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ - environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ - :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ - :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ - :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ - compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ - :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"updated_at\":\"2020-12-15 08:55:03 UTC\",\"id\":3,\"name\":\"test_group\"\ - ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ - :null,\"inherited_environment_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\"\ - :null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\"\ - :null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\"\ - :null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\"\ - :null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\"\ - :null}]\n}\n" + :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"\ + parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"\ + medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 11:05:36 UTC\",\"updated_at\":\"2021-08-27 11:05:36\ + \ UTC\",\"id\":2,\"name\":\"test_group\",\"title\":\"test_group\",\"description\"\ + :null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\"\ + :null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\"\ + :null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"\ + inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"\ + inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"\ + inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ + :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ + :null,\"inherited_pxe_loader\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +167,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -186,7 +185,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1451' + - '1373' status: code: 200 message: OK @@ -208,8 +207,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -229,7 +228,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -266,11 +265,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -291,7 +290,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -314,8 +313,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "hostgroup_id": 3, "build": false, "managed": + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "hostgroup_id": 2, "build": false, "managed": false}}' headers: Accept: @@ -334,13 +333,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo2LCJpYXQiOjE2MDgwMjI1MTcsImp0aSI6IjRjMjJkNzUzZTY4MGY3YTMwNzM4YmQwYzhjODIxM2I1OTgxODk0MWJhNzY3MjM3MzVmY2Y5MGU4NzY2MmVkOWIiLCJleHAiOjE2MDgxMDg5MTcsIm5iZiI6MTYwODAxODkxN30.n8Fepa8_8LTCReiWJoaoLSAf1DcFL3gYTk_ZzQX0ESc","hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -355,11 +355,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-11.yml b/tests/test_playbooks/fixtures/host-11.yml index 1b180707..dd14ea68 100644 --- a/tests/test_playbooks/fixtures/host-11.yml +++ b/tests/test_playbooks/fixtures/host-11.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":3,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo2LCJpYXQiOjE2MDgwMjI1MTgsImp0aSI6ImJiNWQ4MWRjYTQ0NjE0NTUwMDk4NmMzZTA4ZWY3MzA2MDc3MmQ1MTFjMzIwM2MzYTY2YzM2MTliZTg3MzFmMmEiLCJleHAiOjE2MDgxMDg5MTgsIm5iZiI6MTYwODAxODkxOH0.QiQP0JprBAcXG2WYVdeBOt-DQJbtIEeyoDgO2udkCCY","hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2870' + - '2722' status: code: 200 message: OK @@ -191,27 +192,26 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":3,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ - environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ - :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ - :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ - :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ - compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ - :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"updated_at\":\"2020-12-15 08:55:03 UTC\",\"id\":3,\"name\":\"test_group\"\ - ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ - :null,\"inherited_environment_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\"\ - :null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\"\ - :null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\"\ - :null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\"\ - :null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\"\ - :null}]\n}\n" + :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"\ + parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"\ + medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 11:05:36 UTC\",\"updated_at\":\"2021-08-27 11:05:36\ + \ UTC\",\"id\":2,\"name\":\"test_group\",\"title\":\"test_group\",\"description\"\ + :null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\"\ + :null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\"\ + :null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"\ + inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"\ + inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"\ + inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ + :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ + :null,\"inherited_pxe_loader\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -230,7 +230,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +248,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1451' + - '1373' status: code: 200 message: OK @@ -270,8 +270,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +328,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-12.yml b/tests/test_playbooks/fixtures/host-12.yml index 73c5f151..20543fa8 100644 --- a/tests/test_playbooks/fixtures/host-12.yml +++ b/tests/test_playbooks/fixtures/host-12.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":3,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo2LCJpYXQiOjE2MDgwMjI1MTksImp0aSI6IjkzMGM1YzE4NmUxZjI3OTRjNTNhMTIwZTc3ZjY5NmUxZTgxOWQ5NmE4Y2QyNmZkODUyZjY3MGNhYjNlYzRiOTUiLCJleHAiOjE2MDgxMDg5MTksIm5iZiI6MTYwODAxODkxOX0.1gjjZwKLGd2d-etJlPJdqd2hbyi6cIRBBBFUV1Qf5Vo","hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2870' + - '2722' status: code: 200 message: OK @@ -191,22 +192,21 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ - ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ - parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ - :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2020-12-15 08:55:03 UTC\",\"updated_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ - ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ - puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ - puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ + 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ + :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ + test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +230,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +248,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1480' + - '1402' status: code: 200 message: OK @@ -270,8 +270,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +328,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -376,7 +376,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"hostgroup_id": 4}}' + body: '{"host": {"hostgroup_id": 3}}' headers: Accept: - application/json;version=2 @@ -391,16 +391,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo2LCJpYXQiOjE2MDgwMjI1MTksImp0aSI6IjkzMGM1YzE4NmUxZjI3OTRjNTNhMTIwZTc3ZjY5NmUxZTgxOWQ5NmE4Y2QyNmZkODUyZjY3MGNhYjNlYzRiOTUiLCJleHAiOjE2MDgxMDg5MTksIm5iZiI6MTYwODAxODkxOX0.1gjjZwKLGd2d-etJlPJdqd2hbyi6cIRBBBFUV1Qf5Vo","hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:52 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -419,7 +420,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -437,7 +438,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2883' + - '2735' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-13.yml b/tests/test_playbooks/fixtures/host-13.yml index c343240a..5586edd7 100644 --- a/tests/test_playbooks/fixtures/host-13.yml +++ b/tests/test_playbooks/fixtures/host-13.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":3,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo2LCJpYXQiOjE2MDgwMjI1MjAsImp0aSI6IjA1NWE5NjZjMTg0Y2FmZGEzZmM3Y2U1ZGNmY2JkMDdhMDIyMGVmNGUxMTMwNzk4NTIxMmI2YjFlNDQ4ZmU3ZTIiLCJleHAiOjE2MDgxMDg5MjAsIm5iZiI6MTYwODAxODkyMH0.iC9mBTGEAX7j8Vg6XVs0J7gtrSTtyOUTOb3w9Cc3FwY","hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:17 UTC","updated_at":"2020-12-15 08:55:17 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:52 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2883' + - '2735' status: code: 200 message: OK @@ -191,22 +192,21 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ - ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ - parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ - :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2020-12-15 08:55:03 UTC\",\"updated_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ - ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ - puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ - puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ + 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ + :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ + test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +230,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +248,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1480' + - '1402' status: code: 200 message: OK @@ -270,8 +270,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +328,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-14.yml b/tests/test_playbooks/fixtures/host-14.yml index 51e9b820..dce86db2 100644 --- a/tests/test_playbooks/fixtures/host-14.yml +++ b/tests/test_playbooks/fixtures/host-14.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":3,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"id":6,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:19.440Z","created_at":"2020-12-15T08:55:17.669Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":5,"host_id":6,"jwt_secret":"eQN9cJplM4xkEnwnpMcx2Q==","created_at":"2020-12-15T08:55:17.741Z","updated_at":"2020-12-15T08:55:17.741Z"}}' + string: '{"id":3,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:52.858Z","created_at":"2021-08-27T11:05:50.969Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1042' + - '869' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-15.yml b/tests/test_playbooks/fixtures/host-15.yml index 09bde5f0..708351cd 100644 --- a/tests/test_playbooks/fixtures/host-15.yml +++ b/tests/test_playbooks/fixtures/host-15.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-16.yml b/tests/test_playbooks/fixtures/host-16.yml index a1bb6f9a..6cdb2765 100644 --- a/tests/test_playbooks/fixtures/host-16.yml +++ b/tests/test_playbooks/fixtures/host-16.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,22 +129,21 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ - ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ - parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ - :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2020-12-15 08:55:03 UTC\",\"updated_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ - ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ - puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ - puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ + 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ + :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ + test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -168,7 +167,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -186,7 +185,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1480' + - '1402' status: code: 200 message: OK @@ -208,8 +207,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -229,7 +228,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -266,11 +265,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -291,7 +290,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -314,8 +313,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "hostgroup_id": 4, "build": false, "managed": + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "hostgroup_id": 3, "build": false, "managed": false}}' headers: Accept: @@ -334,13 +333,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:22 UTC","updated_at":"2020-12-15 08:55:22 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo3LCJpYXQiOjE2MDgwMjI1MjIsImp0aSI6IjZiYWJjMjAwN2Y4MDk5ZTE4M2Y0ZWRhZmZjYzM1NWYwN2JjMjk0NWQ5MmQ2YjgwNGNlMTVkMTAxNzdlNjA3NTYiLCJleHAiOjE2MDgxMDg5MjIsIm5iZiI6MTYwODAxODkyMn0.s2Q7N5Iq527WUrlQ056oWcG1wkhxk4Mq1ppz2o9FWaU","hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:22 UTC","updated_at":"2020-12-15 08:55:22 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -355,11 +355,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-17.yml b/tests/test_playbooks/fixtures/host-17.yml index c03fe85b..551cc79d 100644 --- a/tests/test_playbooks/fixtures/host-17.yml +++ b/tests/test_playbooks/fixtures/host-17.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":4,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/4 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:22 UTC","updated_at":"2020-12-15 08:55:22 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo3LCJpYXQiOjE2MDgwMjI1MjMsImp0aSI6IjdlZjIwYzhhMzZlYTM2YjJlZTgzYTkxNDhhZDA2MTM5ZmQxZTYzOTZiYWE4MzVkNGM3NWE1YTI4M2VlOTZhODEiLCJleHAiOjE2MDgxMDg5MjMsIm5iZiI6MTYwODAxODkyM30.N8p4zCtfbAUV94M_KEQXgKJgy0VXybf5JsduSaESLUY","hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:22 UTC","updated_at":"2020-12-15 08:55:22 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2883' + - '2735' status: code: 200 message: OK @@ -191,22 +192,21 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ - ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ - parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ - :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2020-12-15 08:55:03 UTC\",\"updated_at\":\"2020-12-15 08:55:03\ - \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ - ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ - puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ - puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ + operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ + 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ + :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ + :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ + :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ + realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ + :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ + test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +230,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +248,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1480' + - '1402' status: code: 200 message: OK @@ -270,8 +270,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +328,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +353,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-18.yml b/tests/test_playbooks/fixtures/host-18.yml index 810e9179..51ad8d6d 100644 --- a/tests/test_playbooks/fixtures/host-18.yml +++ b/tests/test_playbooks/fixtures/host-18.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":4,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/4 response: body: - string: '{"id":7,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:22.779Z","created_at":"2020-12-15T08:55:22.779Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":6,"host_id":7,"jwt_secret":"H8v7CFD7cssIyPcIkXDAhw==","created_at":"2020-12-15T08:55:22.844Z","updated_at":"2020-12-15T08:55:22.844Z"}}' + string: '{"id":4,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:56.163Z","created_at":"2021-08-27T11:05:56.163Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1042' + - '869' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-19.yml b/tests/test_playbooks/fixtures/host-19.yml index 09bde5f0..708351cd 100644 --- a/tests/test_playbooks/fixtures/host-19.yml +++ b/tests/test_playbooks/fixtures/host-19.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-2.yml b/tests/test_playbooks/fixtures/host-2.yml index ab9e91a6..843ca27e 100644 --- a/tests/test_playbooks/fixtures/host-2.yml +++ b/tests/test_playbooks/fixtures/host-2.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTEsImp0aSI6IjVkM2I5ZTNiMjFmZjk2YmU3M2FhYWFjODIxOWIzY2JmMzA3OGVjNmY4ZmUyNWU0NjAwNzk2ZGU3YTlmNjg2YTYiLCJleHAiOjE2MDgxMDg5MTEsIm5iZiI6MTYwODAxODkxMX0.X6LqiwrbPTP_Pev4I94sohTwn1pjC8w8HUh2WQEGBhM","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2857' + - '2709' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -320,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2020-12-15 08:55:05 UTC\",\"updated_at\":\"2020-12-15 08:55:05\ + created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27 11:05:38\ \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":6,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":6,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":5,\"name\":\"\ + ssh_keys\":[],\"default_location\":{\"id\":5,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":5,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":4,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":5,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":4,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: @@ -346,7 +347,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -384,16 +385,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:11 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTEsImp0aSI6IjVkM2I5ZTNiMjFmZjk2YmU3M2FhYWFjODIxOWIzY2JmMzA3OGVjNmY4ZmUyNWU0NjAwNzk2ZGU3YTlmNjg2YTYiLCJleHAiOjE2MDgxMDg5MTEsIm5iZiI6MTYwODAxODkxMX0.X6LqiwrbPTP_Pev4I94sohTwn1pjC8w8HUh2WQEGBhM","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -412,7 +414,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -430,7 +432,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2859' + - '2711' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-20.yml b/tests/test_playbooks/fixtures/host-20.yml index b41435c0..98163214 100644 --- a/tests/test_playbooks/fixtures/host-20.yml +++ b/tests/test_playbooks/fixtures/host-20.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", "build": false, "managed": false}}' headers: Accept: @@ -258,13 +258,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:26 UTC","updated_at":"2020-12-15 08:55:26 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo4LCJpYXQiOjE2MDgwMjI1MjYsImp0aSI6IjBiOTJlNmI5YmM3M2M5MmM0NDIxNDQ4NTcwZjZhYTZhMGFlMGE2ODFiOTllNGI3MzNmMzZmN2VlZDg2NGRjNjAiLCJleHAiOjE2MDgxMDg5MjYsIm5iZiI6MTYwODAxODkyNn0.0O-U-jyZWLro6bW0JZYdqHZTqv78z3sjrDKw5E6X8mg","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:26 UTC","updated_at":"2020-12-15 08:55:26 UTC","managed":true,"identifier":null,"id":16,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":"192.0.2.23","ip6":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,11 +280,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-21.yml b/tests/test_playbooks/fixtures/host-21.yml index f4892437..64a0d963 100644 --- a/tests/test_playbooks/fixtures/host-21.yml +++ b/tests/test_playbooks/fixtures/host-21.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":5,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/5 response: body: - string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:26 UTC","updated_at":"2020-12-15 08:55:26 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo4LCJpYXQiOjE2MDgwMjI1MjcsImp0aSI6IjdkODM5NzkyMDY1NDg5MjExM2ZiYzJjMjdkMDg5ZDBkYTFjODgzY2JjMmI3YzlmYmQ2ZjJkZjU1MWI2M2FlODUiLCJleHAiOjE2MDgxMDg5MjcsIm5iZiI6MTYwODAxODkyN30.8WUFDfNegaQgfmdFK_AP-EWZiNrZLQbmBGLdmI4NEh8","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:26 UTC","updated_at":"2020-12-15 08:55:26 UTC","managed":true,"identifier":null,"id":16,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":"192.0.2.23","ip6":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2903' + - '2755' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-22.yml b/tests/test_playbooks/fixtures/host-22.yml index ebf40e55..c62d7468 100644 --- a/tests/test_playbooks/fixtures/host-22.yml +++ b/tests/test_playbooks/fixtures/host-22.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":5,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/5 response: body: - string: '{"id":8,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:26.247Z","created_at":"2020-12-15T08:55:26.247Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":7,"host_id":8,"jwt_secret":"9Ay6AVatNWhe+04Tsh+ksQ==","created_at":"2020-12-15T08:55:26.314Z","updated_at":"2020-12-15T08:55:26.314Z"}}' + string: '{"id":5,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:59.368Z","created_at":"2021-08-27T11:05:59.368Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1045' + - '872' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-23.yml b/tests/test_playbooks/fixtures/host-23.yml index 1c1f28b8..df77e079 100644 --- a/tests/test_playbooks/fixtures/host-23.yml +++ b/tests/test_playbooks/fixtures/host-23.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2020-12-15 08:55:06 UTC\",\"updated_at\":\"2020-12-15 08:55:06 UTC\",\"\ - name\":\"superARCH\",\"id\":4}]\n}\n" + :\"2021-08-27 11:05:39 UTC\",\"updated_at\":\"2021-08-27 11:05:39 UTC\",\"\ + name\":\"superARCH\",\"id\":3}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -152,7 +152,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -210,7 +210,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -251,8 +251,8 @@ interactions: : 4294967296,\n \"search\": \"title~\\\"TestOS\\\"\",\n \"sort\": {\n \ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"description\"\ :null,\"major\":\"7\",\"minor\":\"6\",\"family\":\"Redhat\",\"release_name\"\ - :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2020-12-14\ - \ 08:31:18 UTC\",\"updated_at\":\"2020-12-14 08:31:18 UTC\",\"id\":2,\"name\"\ + :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2021-08-27\ + \ 11:05:40 UTC\",\"updated_at\":\"2021-08-27 11:05:40 UTC\",\"id\":2,\"name\"\ :\"TestOS\",\"title\":\"TestOS 7.6\"}]\n}\n" headers: Cache-Control: @@ -272,7 +272,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -312,8 +312,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -333,7 +333,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -370,11 +370,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -395,7 +395,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -418,8 +418,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "architecture_id": 4, "operatingsystem_id": + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "architecture_id": 3, "operatingsystem_id": 2, "build": false, "managed": false}}' headers: Accept: @@ -438,14 +438,15 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":4,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:28 UTC","updated_at":"2020-12-15 08:55:28 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo5LCJpYXQiOjE2MDgwMjI1MjgsImp0aSI6ImUwYTNlN2M2YTY0YTU2MGRmMjA3NTg5MzgzMmEzNThlZmZjYjU1OWE0ZTUyMTA3YWFjYjVlMDViZjk5Y2I5ZTciLCJleHAiOjE2MDgxMDg5MjgsIm5iZiI6MTYwODAxODkyOH0.RNPfEC5vHiGmojo4xixxc4f8r_pjL2gEYW51xVxCYAk","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:28 UTC","updated_at":"2020-12-15 08:55:28 UTC","managed":true,"identifier":null,"id":17,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -460,11 +461,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-24.yml b/tests/test_playbooks/fixtures/host-24.yml index 386418d0..24312db4 100644 --- a/tests/test_playbooks/fixtures/host-24.yml +++ b/tests/test_playbooks/fixtures/host-24.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":9,\"name\":\"test-host.example.net\"}]\n}\n" + id\":6,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,17 +126,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/9 + uri: https://foreman.example.org/api/hosts/6 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":4,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:28 UTC","updated_at":"2020-12-15 08:55:28 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo5LCJpYXQiOjE2MDgwMjI1MjksImp0aSI6Ijk0YTAwZGZmY2Q1MTUxZTZmZDQ3ZjdlMTUwYjNmZmM0ZGFiMDJkY2M3YjI0YTE1MWZkNTE0ODNjNmU0OGYyMTEiLCJleHAiOjE2MDgxMDg5MjksIm5iZiI6MTYwODAxODkyOX0.pC9wdFfy-Enytu2sVAGv5_aHeqVVYxXDeoJZZvnHv6k","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:28 UTC","updated_at":"2020-12-15 08:55:28 UTC","managed":true,"identifier":null,"id":17,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +156,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +174,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2866' + - '2718' status: code: 200 message: OK @@ -195,8 +196,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2020-12-15 08:55:06 UTC\",\"updated_at\":\"2020-12-15 08:55:06 UTC\",\"\ - name\":\"superARCH\",\"id\":4}]\n}\n" + :\"2021-08-27 11:05:39 UTC\",\"updated_at\":\"2021-08-27 11:05:39 UTC\",\"\ + name\":\"superARCH\",\"id\":3}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -273,7 +274,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -314,8 +315,8 @@ interactions: : 4294967296,\n \"search\": \"title~\\\"TestOS\\\"\",\n \"sort\": {\n \ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"description\"\ :null,\"major\":\"7\",\"minor\":\"6\",\"family\":\"Redhat\",\"release_name\"\ - :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2020-12-14\ - \ 08:31:18 UTC\",\"updated_at\":\"2020-12-14 08:31:18 UTC\",\"id\":2,\"name\"\ + :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2021-08-27\ + \ 11:05:40 UTC\",\"updated_at\":\"2021-08-27 11:05:40 UTC\",\"id\":2,\"name\"\ :\"TestOS\",\"title\":\"TestOS 7.6\"}]\n}\n" headers: Cache-Control: @@ -335,7 +336,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -375,8 +376,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -396,7 +397,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -433,11 +434,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -458,7 +459,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-25.yml b/tests/test_playbooks/fixtures/host-25.yml index eb6d7838..3b5fe524 100644 --- a/tests/test_playbooks/fixtures/host-25.yml +++ b/tests/test_playbooks/fixtures/host-25.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":9,\"name\":\"test-host.example.net\"}]\n}\n" + id\":6,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/9 + uri: https://foreman.example.org/api/hosts/6 response: body: - string: '{"id":9,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:28.780Z","created_at":"2020-12-15T08:55:28.780Z","root_pass":null,"architecture_id":4,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":8,"host_id":9,"jwt_secret":"8W87f6pdyT8T0LETAtY0uA==","created_at":"2020-12-15T08:55:28.844Z","updated_at":"2020-12-15T08:55:28.844Z"}}' + string: '{"id":6,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:01.884Z","created_at":"2021-08-27T11:06:01.884Z","root_pass":null,"architecture_id":3,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1039' + - '866' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-26.yml b/tests/test_playbooks/fixtures/host-26.yml index 3d2338ae..e8806109 100644 --- a/tests/test_playbooks/fixtures/host-26.yml +++ b/tests/test_playbooks/fixtures/host-26.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "build": false, "managed": false}}' + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,13 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:32 UTC","updated_at":"2020-12-15 08:55:32 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMCwiaWF0IjoxNjA4MDIyNTMyLCJqdGkiOiI3NTIzNjQ3NjA2MTYxM2MwODlmMGIxNzgyMzYwOTIwYzBkMjllZWYxZTJlMWI2NjRlZTQyMjg2MWE4MTUzMDg1IiwiZXhwIjoxNjA4MTA4OTMyLCJuYmYiOjE2MDgwMTg5MzJ9.yr3TYBfdrGnpwtO6NSj54XkrGMlFkBV5i42zWLLBSi8","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:32 UTC","updated_at":"2020-12-15 08:55:32 UTC","managed":true,"identifier":null,"id":18,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -278,11 +279,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -302,125 +303,4 @@ interactions: status: code: 201 message: Created -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: https://foreman.example.org/api/puppetclasses?search=name%3D%22prometheus%3A%3Aredis_exporter%22&per_page=4294967296 - response: - body: - string: "{\n \"total\": 50,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"prometheus::redis_exporter\\\"\",\n\ - \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : {\"prometheus\":[{\"id\":33,\"name\":\"prometheus::redis_exporter\",\"created_at\"\ - :\"2020-12-15T08:13:10.015Z\",\"updated_at\":\"2020-12-15T08:13:10.015Z\"\ - }]}\n}\n" - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 2.3.0 - Keep-Alive: - - timeout=15, max=95 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '333' - status: - code: 200 - message: OK -- request: - body: '{"puppetclass_id": 33}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/api/hosts/10/puppetclass_ids - response: - body: - string: '{"host_id":10,"puppetclass_id":33}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 2.3.0 - Keep-Alive: - - timeout=15, max=94 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '34' - status: - code: 200 - message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/host-27.yml b/tests/test_playbooks/fixtures/host-27.yml index 844f4411..71498042 100644 --- a/tests/test_playbooks/fixtures/host-27.yml +++ b/tests/test_playbooks/fixtures/host-27.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":10,\"name\":\"test-host.example.net\"}]\n}\n" + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '227' + - '226' status: code: 200 message: OK @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/10 + uri: https://foreman.example.org/api/hosts/7 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:32 UTC","updated_at":"2020-12-15 08:55:32 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMCwiaWF0IjoxNjA4MDIyNTMzLCJqdGkiOiIzZjNmODk0ZDkzOGEzMmVhYjEwYzI4YjRiMDgzNWVmZWVkYTRiNTcyMGM3ZTA2Zjc0OTc5N2QwOGYyZTQzZGMwIiwiZXhwIjoxNjA4MTA4OTMzLCJuYmYiOjE2MDgwMTg5MzN9.CijgbBEUBVytQN35ZMmC1djiI0S_E0jCV2o8VFcpclY","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:32 UTC","updated_at":"2020-12-15 08:55:32 UTC","managed":true,"identifier":null,"id":18,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":33,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":33,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '3003' + - '2709' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-28.yml b/tests/test_playbooks/fixtures/host-28.yml index 7dfca25d..2efb7f90 100644 --- a/tests/test_playbooks/fixtures/host-28.yml +++ b/tests/test_playbooks/fixtures/host-28.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":10,\"name\":\"test-host.example.net\"}]\n}\n" + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '227' + - '226' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/10 + uri: https://foreman.example.org/api/hosts/7 response: body: - string: '{"id":10,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:32.323Z","created_at":"2020-12-15T08:55:32.323Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":9,"host_id":10,"jwt_secret":"RvCHgClIcY6/ljSOM3V+2Q==","created_at":"2020-12-15T08:55:32.406Z","updated_at":"2020-12-15T08:55:32.406Z"}}' + string: '{"id":7,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:04.443Z","created_at":"2021-08-27T11:06:04.443Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1047' + - '872' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-29.yml b/tests/test_playbooks/fixtures/host-29.yml index 7cab0329..19ae12f9 100644 --- a/tests/test_playbooks/fixtures/host-29.yml +++ b/tests/test_playbooks/fixtures/host-29.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 6, "organization_id": 5, "host": {"name": "test-host.example.net", - "location_id": 6, "organization_id": 5, "build": false, "managed": false}}' + body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", + "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,13 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMSwiaWF0IjoxNjA4MDIyNTM1LCJqdGkiOiI0MzFjYTczNTRmNGY5MGZmZGI0OGE3Y2E3NTA1YzE0NjBlMjBlNWRiY2MwNDc0OTkwMTI4NTVlMDViMDM5M2ViIiwiZXhwIjoxNjA4MTA4OTM1LCJuYmYiOjE2MDgwMTg5MzV9.YUKWtSER1QiZMJQ7xZ2xcYPt9D1ztfei2YNI91YP7W0","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","managed":true,"identifier":null,"id":19,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -278,11 +279,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 6; Test Location + - 5; Test Location Foreman_current_organization: - - 5; Test Organization + - 4; Test Organization Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-3.yml b/tests/test_playbooks/fixtures/host-3.yml index e94b9cc7..8b698ad1 100644 --- a/tests/test_playbooks/fixtures/host-3.yml +++ b/tests/test_playbooks/fixtures/host-3.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:11 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTEsImp0aSI6IjVkM2I5ZTNiMjFmZjk2YmU3M2FhYWFjODIxOWIzY2JmMzA3OGVjNmY4ZmUyNWU0NjAwNzk2ZGU3YTlmNjg2YTYiLCJleHAiOjE2MDgxMDg5MTEsIm5iZiI6MTYwODAxODkxMX0.X6LqiwrbPTP_Pev4I94sohTwn1pjC8w8HUh2WQEGBhM","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2859' + - '2711' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -320,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2020-12-15 08:55:05 UTC\",\"updated_at\":\"2020-12-15 08:55:05\ + created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27 11:05:38\ \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":6,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":6,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":5,\"name\":\"\ + ssh_keys\":[],\"default_location\":{\"id\":5,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":5,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":4,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":5,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":4,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: @@ -346,7 +347,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-30.yml b/tests/test_playbooks/fixtures/host-30.yml index 33d76a8e..7178d350 100644 --- a/tests/test_playbooks/fixtures/host-30.yml +++ b/tests/test_playbooks/fixtures/host-30.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":11,\"name\":\"test-host.example.net\"}]\n}\n" + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '227' + - '226' status: code: 200 message: OK @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/11 + uri: https://foreman.example.org/api/hosts/8 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMSwiaWF0IjoxNjA4MDIyNTM2LCJqdGkiOiIxNWE4MzJkNWZlNjI4M2ZlMzk4ZGI3YzdhNTQ3N2Q2N2M5NmU3NDQ4N2QzNmU5MTQ2ZTQzM2E2MDAzZWMzODU2IiwiZXhwIjoxNjA4MTA4OTM2LCJuYmYiOjE2MDgwMTg5MzZ9._Mr4FkBBETxa5RzPOAtzCQMn5hE_m-O37agEnXS3yE0","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","managed":true,"identifier":null,"id":19,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2859' + - '2709' status: code: 200 message: OK @@ -195,8 +196,8 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2020-12-15 08:54:59 UTC\",\"updated_at\":\"2020-12-15 08:54:59 UTC\",\"\ - id\":8,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + :\"2021-08-27 11:05:32 UTC\",\"updated_at\":\"2021-08-27 11:05:32 UTC\",\"\ + id\":7,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ ,\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +217,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,12 +254,12 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2020-12-15 08:54:58 UTC\",\"updated_at\":\"2020-12-15 08:54:58 UTC\",\"\ - id\":7,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + :\"2021-08-27 11:05:31 UTC\",\"updated_at\":\"2021-08-27 11:05:31 UTC\",\"\ + id\":6,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ \ Secondary\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -278,7 +279,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -301,7 +302,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"location_id": 8, "organization_id": 7}}' + body: '{"host": {"location_id": 7, "organization_id": 6}}' headers: Accept: - application/json;version=2 @@ -316,16 +317,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/11 + uri: https://foreman.example.org/api/hosts/8 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:36 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test - Organization Secondary","location_id":8,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMSwiaWF0IjoxNjA4MDIyNTM2LCJqdGkiOiIxNWE4MzJkNWZlNjI4M2ZlMzk4ZGI3YzdhNTQ3N2Q2N2M5NmU3NDQ4N2QzNmU5MTQ2ZTQzM2E2MDAzZWMzODU2IiwiZXhwIjoxNjA4MTA4OTM2LCJuYmYiOjE2MDgwMTg5MzZ9._Mr4FkBBETxa5RzPOAtzCQMn5hE_m-O37agEnXS3yE0","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","managed":true,"identifier":null,"id":19,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":6,"organization_name":"Test + Organization Secondary","location_id":7,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -344,7 +346,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -362,7 +364,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2879' + - '2729' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-31.yml b/tests/test_playbooks/fixtures/host-31.yml index c5b9a2aa..7ba567db 100644 --- a/tests/test_playbooks/fixtures/host-31.yml +++ b/tests/test_playbooks/fixtures/host-31.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":11,\"name\":\"test-host.example.net\"}]\n}\n" + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '227' + - '226' status: code: 200 message: OK @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/11 + uri: https://foreman.example.org/api/hosts/8 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:36 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test - Organization Secondary","location_id":8,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjoxMSwiaWF0IjoxNjA4MDIyNTM3LCJqdGkiOiI2YjhiODczMDU5MGM0ZTIxODk4NjU3OTAxMWE0MDY1YmZlYjA4Y2RmMzFjMDE2YmU1ODM4OGJmNGMzMmM3MWExIiwiZXhwIjoxNjA4MTA4OTM3LCJuYmYiOjE2MDgwMTg5Mzd9.y95pPYJwVv7lqCHOpL0mUnkEl0LuX8rWj9AsREotI8w","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:35 UTC","updated_at":"2020-12-15 08:55:35 UTC","managed":true,"identifier":null,"id":19,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":6,"organization_name":"Test + Organization Secondary","location_id":7,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2879' + - '2729' status: code: 200 message: OK @@ -195,8 +196,8 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2020-12-15 08:54:59 UTC\",\"updated_at\":\"2020-12-15 08:54:59 UTC\",\"\ - id\":8,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + :\"2021-08-27 11:05:32 UTC\",\"updated_at\":\"2021-08-27 11:05:32 UTC\",\"\ + id\":7,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ ,\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +217,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,12 +254,12 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2020-12-15 08:54:58 UTC\",\"updated_at\":\"2020-12-15 08:54:58 UTC\",\"\ - id\":7,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + :\"2021-08-27 11:05:31 UTC\",\"updated_at\":\"2021-08-27 11:05:31 UTC\",\"\ + id\":6,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ \ Secondary\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -278,7 +279,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-32.yml b/tests/test_playbooks/fixtures/host-32.yml index eddf2d0f..75267602 100644 --- a/tests/test_playbooks/fixtures/host-32.yml +++ b/tests/test_playbooks/fixtures/host-32.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":11,\"name\":\"test-host.example.net\"}]\n}\n" + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '227' + - '226' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/11 + uri: https://foreman.example.org/api/hosts/8 response: body: - string: '{"id":11,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:36.703Z","created_at":"2020-12-15T08:55:35.471Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":10,"host_id":11,"jwt_secret":"cgAtrtc825s4nFajuDOH0A==","created_at":"2020-12-15T08:55:35.583Z","updated_at":"2020-12-15T08:55:35.583Z"}}' + string: '{"id":8,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:07.906Z","created_at":"2021-08-27T11:06:06.943Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":6,"location_id":7,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1048' + - '872' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-4.yml b/tests/test_playbooks/fixtures/host-4.yml index fa41e93a..d2959462 100644 --- a/tests/test_playbooks/fixtures/host-4.yml +++ b/tests/test_playbooks/fixtures/host-4.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,16 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:11 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTIsImp0aSI6IjkwNGY5YmY2OTk4NzU2NThkOTNjYjEwMThhYmMxZjdjMDc5YjA5NWEyNzYxNmU4ODVmNjFiYTM3YWQ5MWQwOWIiLCJleHAiOjE2MDgxMDg5MTIsIm5iZiI6MTYwODAxODkxMn0.kRbgvtuyMqAao2gPn-UgNOsgKH_CY0XmW--VWciLDfc","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2859' + - '2711' status: code: 200 message: OK @@ -194,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -317,8 +318,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2020-12-15 08:55:05 UTC\",\"updated_at\":\"2020-12-15\ - \ 08:55:05 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27\ + \ 11:05:38 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -337,7 +338,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -375,15 +376,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:12 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTIsImp0aSI6IjkwNGY5YmY2OTk4NzU2NThkOTNjYjEwMThhYmMxZjdjMDc5YjA5NWEyNzYxNmU4ODVmNjFiYTM3YWQ5MWQwOWIiLCJleHAiOjE2MDgxMDg5MTIsIm5iZiI6MTYwODAxODkxMn0.kRbgvtuyMqAao2gPn-UgNOsgKH_CY0XmW--VWciLDfc","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -402,7 +404,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -420,7 +422,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2861' + - '2713' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-5.yml b/tests/test_playbooks/fixtures/host-5.yml index 792bbc31..8567efb8 100644 --- a/tests/test_playbooks/fixtures/host-5.yml +++ b/tests/test_playbooks/fixtures/host-5.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,15 +126,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:12 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTMsImp0aSI6IjRjNDc3NGMyYzdjMmVmZjdkNWE5NGZhNWQ0NzQ2ZGU0OWZmMmNjMWM3OWY3ZjliMzVkZjE3NDdiYmEwNzE3MjgiLCJleHAiOjE2MDgxMDg5MTMsIm5iZiI6MTYwODAxODkxM30._5PB-2AQqiMsjQ154ZLyz9XKS3lm_PI_pHmjYZKKyYU","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -153,7 +154,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -171,7 +172,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2861' + - '2713' status: code: 200 message: OK @@ -193,8 +194,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -214,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -251,11 +252,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -276,7 +277,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -316,8 +317,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2020-12-15 08:55:05 UTC\",\"updated_at\":\"2020-12-15\ - \ 08:55:05 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27\ + \ 11:05:38 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -336,7 +337,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-6.yml b/tests/test_playbooks/fixtures/host-6.yml index 9a42b23e..74297ba2 100644 --- a/tests/test_playbooks/fixtures/host-6.yml +++ b/tests/test_playbooks/fixtures/host-6.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,15 +126,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:12 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTQsImp0aSI6IjcwYWM3MmJkN2M4NWY2YjI5NWQyZTk3OWZjOTNhODViYzIwMWYwYjgwMTMxZjM2YTc0YjhiY2I5YmFmMTRmZDQiLCJleHAiOjE2MDgxMDg5MTQsIm5iZiI6MTYwODAxODkxNH0.GtMXvl9952EqfaLCcDfsJ2OQLsvsa9b1iyOINIFwJQ0","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:09 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -153,7 +154,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -171,7 +172,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2861' + - '2713' status: code: 200 message: OK @@ -195,15 +196,15 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"network\"\ :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ - :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2020-12-15\ - \ 08:55:02 UTC\",\"updated_at\":\"2020-12-15 08:55:02 UTC\",\"ipam\":\"DHCP\"\ - ,\"boot_mode\":\"DHCP\",\"id\":4,\"name\":\"Test subnet4\",\"description\"\ - :null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\":null,\"dhcp_name\"\ - :null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\":null,\"httpboot_name\"\ - :null,\"externalipam_id\":null,\"externalipam_name\":null,\"dns_id\":null,\"\ - template_id\":null,\"template_name\":null,\"bmc_id\":null,\"bmc_name\":null,\"\ - dhcp\":null,\"tftp\":null,\"httpboot\":null,\"externalipam\":null,\"dns\"\ - :null,\"template\":null,\"bmc\":null}]\n}\n" + :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ + \ 11:05:35 UTC\",\"updated_at\":\"2021-08-27 11:05:35 UTC\",\"ipam\":\"DHCP\"\ + ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ + ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ + :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ + :null,\"httpboot_name\":null,\"externalipam_id\":null,\"externalipam_name\"\ + :null,\"dns_id\":null,\"template_id\":null,\"template_name\":null,\"bmc_id\"\ + :null,\"bmc_name\":null,\"dhcp\":null,\"tftp\":null,\"httpboot\":null,\"externalipam\"\ + :null,\"dns\":null,\"template\":null,\"bmc\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -222,7 +223,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -240,7 +241,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '910' + - '927' status: code: 200 message: OK @@ -262,8 +263,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -283,7 +284,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -320,11 +321,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -345,7 +346,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -368,7 +369,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"subnet_id": 4}}' + body: '{"host": {"subnet_id": 1}}' headers: Accept: - application/json;version=2 @@ -383,17 +384,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":4,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:12 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTQsImp0aSI6IjcwYWM3MmJkN2M4NWY2YjI5NWQyZTk3OWZjOTNhODViYzIwMWYwYjgwMTMxZjM2YTc0YjhiY2I5YmFmMTRmZDQiLCJleHAiOjE2MDgxMDg5MTQsIm5iZiI6MTYwODAxODkxNH0.GtMXvl9952EqfaLCcDfsJ2OQLsvsa9b1iyOINIFwJQ0","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":4,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:14 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:47 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -412,7 +414,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -430,7 +432,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2875' + - '2727' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-7.yml b/tests/test_playbooks/fixtures/host-7.yml index 0d65c6b8..1a2138ad 100644 --- a/tests/test_playbooks/fixtures/host-7.yml +++ b/tests/test_playbooks/fixtures/host-7.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,17 +126,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":4,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:12 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization","location_id":6,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"registration_token":"eyJhbGciOiJIUzI1NiJ9.eyJob3N0X2lkIjo1LCJpYXQiOjE2MDgwMjI1MTUsImp0aSI6IjRlZjgwNWI2YjEyNzI4YzEzNjQyNzg4MzI5ODE3NTUxYWFjZGU1YTE1YTE0MTNlNjFjZjFhYThlODc3NDRjYmIiLCJleHAiOjE2MDgxMDg5MTUsIm5iZiI6MTYwODAxODkxNX0.enxG-oviluTlnGyf19dIOMvz1LKxh_Sklgfl4ig29tM","hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2020-12-04 - 08:34:05 UTC","updated_at":"2020-12-04 08:34:05 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false}],"interfaces":[{"subnet_id":4,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2020-12-15 - 08:55:09 UTC","updated_at":"2020-12-15 08:55:14 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test + Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 + 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 11:05:42 UTC","updated_at":"2021-08-27 11:05:47 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +156,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +174,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2875' + - '2727' status: code: 200 message: OK @@ -197,15 +198,15 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"network\"\ :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ - :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2020-12-15\ - \ 08:55:02 UTC\",\"updated_at\":\"2020-12-15 08:55:02 UTC\",\"ipam\":\"DHCP\"\ - ,\"boot_mode\":\"DHCP\",\"id\":4,\"name\":\"Test subnet4\",\"description\"\ - :null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\":null,\"dhcp_name\"\ - :null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\":null,\"httpboot_name\"\ - :null,\"externalipam_id\":null,\"externalipam_name\":null,\"dns_id\":null,\"\ - template_id\":null,\"template_name\":null,\"bmc_id\":null,\"bmc_name\":null,\"\ - dhcp\":null,\"tftp\":null,\"httpboot\":null,\"externalipam\":null,\"dns\"\ - :null,\"template\":null,\"bmc\":null}]\n}\n" + :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ + \ 11:05:35 UTC\",\"updated_at\":\"2021-08-27 11:05:35 UTC\",\"ipam\":\"DHCP\"\ + ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ + ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ + :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ + :null,\"httpboot_name\":null,\"externalipam_id\":null,\"externalipam_name\"\ + :null,\"dns_id\":null,\"template_id\":null,\"template_name\":null,\"bmc_id\"\ + :null,\"bmc_name\":null,\"dhcp\":null,\"tftp\":null,\"httpboot\":null,\"externalipam\"\ + :null,\"dns\":null,\"template\":null,\"bmc\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -224,7 +225,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -242,7 +243,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '910' + - '927' status: code: 200 message: OK @@ -264,8 +265,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:56 UTC\",\"updated_at\":\"2020-12-15 08:54:56 UTC\",\"id\":6,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -285,7 +286,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -322,11 +323,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2020-12-15\ - \ 08:54:55 UTC\",\"updated_at\":\"2020-12-15 08:54:55 UTC\",\"id\":5,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -347,7 +348,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-8.yml b/tests/test_playbooks/fixtures/host-8.yml index d37e15a5..1316b337 100644 --- a/tests/test_playbooks/fixtures/host-8.yml +++ b/tests/test_playbooks/fixtures/host-8.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":2,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"id":5,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2020-12-15T08:55:12.907Z","created_at":"2020-12-15T08:55:09.015Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null,"registration_facet_attributes":{"id":4,"host_id":5,"jwt_secret":"6g4pnv1eiOstmskp3TC5hg==","created_at":"2020-12-15T08:55:09.122Z","updated_at":"2020-12-15T08:55:09.122Z"}}' + string: '{"id":2,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:45.956Z","created_at":"2021-08-27T11:05:42.266Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1050' + - '877' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-9.yml b/tests/test_playbooks/fixtures/host-9.yml index 09bde5f0..708351cd 100644 --- a/tests/test_playbooks/fixtures/host-9.yml +++ b/tests/test_playbooks/fixtures/host-9.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"2.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '62' + - '66' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 2.3.0 + - 3.0.0-rc1 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: From cc0c14e43ec1e35f722dcc83102f7f3bd3716dfe Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 13:37:19 +0200 Subject: [PATCH 07/36] add tests for updating and deleting puppetclasses --- tests/test_playbooks/host.yml | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/tests/test_playbooks/host.yml b/tests/test_playbooks/host.yml index 50588409..9050e999 100644 --- a/tests/test_playbooks/host.yml +++ b/tests/test_playbooks/host.yml @@ -94,6 +94,14 @@ operatingsystem_architectures: - "{{ host.arch }}" operatingsystem_state: present + - include_tasks: tasks/environment.yml + vars: + environment_state: present + environment_name: "production" + environment_locations: + - "{{ host.location }}" + environment_organizations: + - "{{ host.organization }}" - include_tasks: tasks/host.yml vars: host_name: "test-host.{{ host.domain }}" @@ -363,6 +371,7 @@ host_location: "{{ host.location }}" host_managed: false host_build: false + host_environment: production host_puppetclasses: - "prometheus::redis_exporter" expected_change: true @@ -375,10 +384,85 @@ host_location: "{{ host.location }}" host_managed: false host_build: false + host_environment: production host_puppetclasses: - "prometheus::redis_exporter" expected_change: false + - name: update host with puppetclasses + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_environment: production + host_puppetclasses: + - "prometheus::haproxy_exporter" + expected_change: true + + - name: update host with puppetclasses again, no change + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_environment: production + host_puppetclasses: + - "prometheus::haproxy_exporter" + expected_change: false + + - name: create host with puppetclasses + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_environment: production + host_puppetclasses: + - "prometheus::redis_exporter" + expected_change: true + + - name: create host with puppetclasses again, no change + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_environment: production + host_puppetclasses: + - "prometheus::redis_exporter" + expected_change: false + + - name: remove puppetclasses from host + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_puppetclasses: [] + expected_change: true + + - name: remove puppetclasses from host again, no change + include_tasks: tasks/host.yml + vars: + host_name: "test-host.{{ host.domain }}" + host_organization: "{{ host.organization }}" + host_location: "{{ host.location }}" + host_managed: false + host_build: false + host_puppetclasses: [] + expected_change: false + - name: delete host include_tasks: tasks/host.yml vars: From ba2ca0244819fc2a048423d7af9aceb56e6a2922 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 13:40:36 +0200 Subject: [PATCH 08/36] fix unassigning all puppetclasses --- plugins/module_utils/foreman_helper.py | 2 +- tests/test_playbooks/fixtures/host-0.yml | 42 +-- tests/test_playbooks/fixtures/host-1.yml | 36 +- tests/test_playbooks/fixtures/host-10.yml | 81 ++--- tests/test_playbooks/fixtures/host-11.yml | 75 ++--- tests/test_playbooks/fixtures/host-12.yml | 83 ++--- tests/test_playbooks/fixtures/host-13.yml | 63 ++-- tests/test_playbooks/fixtures/host-14.yml | 12 +- tests/test_playbooks/fixtures/host-15.yml | 8 +- tests/test_playbooks/fixtures/host-16.yml | 69 ++-- tests/test_playbooks/fixtures/host-17.yml | 63 ++-- tests/test_playbooks/fixtures/host-18.yml | 12 +- tests/test_playbooks/fixtures/host-19.yml | 8 +- tests/test_playbooks/fixtures/host-2.yml | 66 ++-- tests/test_playbooks/fixtures/host-20.yml | 42 +-- tests/test_playbooks/fixtures/host-21.yml | 36 +- tests/test_playbooks/fixtures/host-22.yml | 12 +- tests/test_playbooks/fixtures/host-23.yml | 52 +-- tests/test_playbooks/fixtures/host-24.yml | 46 +-- tests/test_playbooks/fixtures/host-25.yml | 12 +- tests/test_playbooks/fixtures/host-26.yml | 232 +++++++++++-- tests/test_playbooks/fixtures/host-27.yml | 161 +++++++-- tests/test_playbooks/fixtures/host-28.yml | 387 +++++++++++++++++++++- tests/test_playbooks/fixtures/host-29.yml | 196 ++++++++--- tests/test_playbooks/fixtures/host-3.yml | 48 +-- tests/test_playbooks/fixtures/host-30.yml | 271 ++++++++++++--- tests/test_playbooks/fixtures/host-31.yml | 190 +++++++++-- tests/test_playbooks/fixtures/host-32.yml | 208 +++++++++++- tests/test_playbooks/fixtures/host-33.yml | 303 +++++++++++++++++ tests/test_playbooks/fixtures/host-34.yml | 175 ++++++++++ tests/test_playbooks/fixtures/host-35.yml | 306 +++++++++++++++++ tests/test_playbooks/fixtures/host-36.yml | 371 +++++++++++++++++++++ tests/test_playbooks/fixtures/host-37.yml | 304 +++++++++++++++++ tests/test_playbooks/fixtures/host-38.yml | 175 ++++++++++ tests/test_playbooks/fixtures/host-4.yml | 60 ++-- tests/test_playbooks/fixtures/host-5.yml | 42 +-- tests/test_playbooks/fixtures/host-6.yml | 58 ++-- tests/test_playbooks/fixtures/host-7.yml | 40 +-- tests/test_playbooks/fixtures/host-8.yml | 12 +- tests/test_playbooks/fixtures/host-9.yml | 8 +- 40 files changed, 3636 insertions(+), 731 deletions(-) create mode 100644 tests/test_playbooks/fixtures/host-33.yml create mode 100644 tests/test_playbooks/fixtures/host-34.yml create mode 100644 tests/test_playbooks/fixtures/host-35.yml create mode 100644 tests/test_playbooks/fixtures/host-36.yml create mode 100644 tests/test_playbooks/fixtures/host-37.yml create mode 100644 tests/test_playbooks/fixtures/host-38.yml diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index ff3f4ec0..2869d77d 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1779,7 +1779,7 @@ def build_fqn(name, parent=None): # Helper for puppetclasses def ensure_puppetclasses(module, entity_type, entity, expected_puppetclasses=None): - if expected_puppetclasses: + if expected_puppetclasses is not None: puppetclasses_resource = '{0}_classes'.format(entity_type) expected_puppetclasses = module.find_puppetclasses(expected_puppetclasses, environment=entity['environment_id'], thin=True) current_puppetclasses = entity.get('puppetclasses', []) diff --git a/tests/test_playbooks/fixtures/host-0.yml b/tests/test_playbooks/fixtures/host-0.yml index 1f6bd7b7..018e37cc 100644 --- a/tests/test_playbooks/fixtures/host-0.yml +++ b/tests/test_playbooks/fixtures/host-0.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -133,7 +133,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,14 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,11 +279,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-1.yml b/tests/test_playbooks/fixtures/host-1.yml index 4987c746..ac144d6b 100644 --- a/tests/test_playbooks/fixtures/host-1.yml +++ b/tests/test_playbooks/fixtures/host-1.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2709' + - '2744' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-10.yml b/tests/test_playbooks/fixtures/host-10.yml index aad97a98..92053d55 100644 --- a/tests/test_playbooks/fixtures/host-10.yml +++ b/tests/test_playbooks/fixtures/host-10.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,26 +129,27 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"\ - parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"\ - medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 11:05:36 UTC\",\"updated_at\":\"2021-08-27 11:05:36\ - \ UTC\",\"id\":2,\"name\":\"test_group\",\"title\":\"test_group\",\"description\"\ - :null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\"\ - :null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\"\ - :null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"\ - inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"\ - inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"\ - inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ - :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ - :null,\"inherited_pxe_loader\":null}]\n}\n" + :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ + environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ + :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ + :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ + :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ + compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ + :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-08-27 12:25:39\ + \ UTC\",\"updated_at\":\"2021-08-27 12:25:39 UTC\",\"id\":1,\"name\":\"test_group\"\ + ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + :null,\"inherited_environment_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\"\ + :null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\"\ + :null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\"\ + :null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\"\ + :null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\"\ + :null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -167,7 +168,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -185,7 +186,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1373' + - '1451' status: code: 200 message: OK @@ -208,7 +209,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -228,7 +229,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -265,11 +266,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -290,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -313,8 +314,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "hostgroup_id": 2, "build": false, "managed": + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "hostgroup_id": 1, "build": false, "managed": false}}' headers: Accept: @@ -333,14 +334,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -355,11 +356,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-11.yml b/tests/test_playbooks/fixtures/host-11.yml index dd14ea68..dd54b309 100644 --- a/tests/test_playbooks/fixtures/host-11.yml +++ b/tests/test_playbooks/fixtures/host-11.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2722' + - '2757' status: code: 200 message: OK @@ -192,26 +192,27 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"\ - parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"\ - medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ - :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ - :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 11:05:36 UTC\",\"updated_at\":\"2021-08-27 11:05:36\ - \ UTC\",\"id\":2,\"name\":\"test_group\",\"title\":\"test_group\",\"description\"\ - :null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\"\ - :null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\"\ - :null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"\ - inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"\ - inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"\ - inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ - :null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\"\ - :null,\"inherited_pxe_loader\":null}]\n}\n" + :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ + environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ + :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ + :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ + :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ + compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ + :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-08-27 12:25:39\ + \ UTC\",\"updated_at\":\"2021-08-27 12:25:39 UTC\",\"id\":1,\"name\":\"test_group\"\ + ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ + puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ + :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + :null,\"inherited_environment_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\"\ + :null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\"\ + :null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\"\ + :null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\"\ + :null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\"\ + :null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -230,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1373' + - '1451' status: code: 200 message: OK @@ -271,7 +272,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +329,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +354,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-12.yml b/tests/test_playbooks/fixtures/host-12.yml index 20543fa8..fd652fb7 100644 --- a/tests/test_playbooks/fixtures/host-12.yml +++ b/tests/test_playbooks/fixtures/host-12.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2722' + - '2757' status: code: 200 message: OK @@ -192,21 +192,22 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ - ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ - 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ - :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ - :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ - :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ - :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ - test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ + :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ + \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ + puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ + puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1402' + - '1480' status: code: 200 message: OK @@ -271,7 +272,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +329,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +354,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -376,7 +377,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"hostgroup_id": 3}}' + body: '{"host": {"hostgroup_id": 2}}' headers: Accept: - application/json;version=2 @@ -394,14 +395,14 @@ interactions: uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:52 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:55 UTC","updated_at":"2021-08-27 12:25:57 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -420,7 +421,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -438,7 +439,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2735' + - '2770' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-13.yml b/tests/test_playbooks/fixtures/host-13.yml index 5586edd7..717d6fa9 100644 --- a/tests/test_playbooks/fixtures/host-13.yml +++ b/tests/test_playbooks/fixtures/host-13.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:52 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:50 UTC","updated_at":"2021-08-27 11:05:50 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:55 UTC","updated_at":"2021-08-27 12:25:57 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2735' + - '2770' status: code: 200 message: OK @@ -192,21 +192,22 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ - ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ - 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ - :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ - :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ - :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ - :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ - test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ + :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ + \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ + puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ + puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1402' + - '1480' status: code: 200 message: OK @@ -271,7 +272,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +329,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +354,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-14.yml b/tests/test_playbooks/fixtures/host-14.yml index dce86db2..69712fc4 100644 --- a/tests/test_playbooks/fixtures/host-14.yml +++ b/tests/test_playbooks/fixtures/host-14.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -131,7 +131,7 @@ interactions: uri: https://foreman.example.org/api/hosts/3 response: body: - string: '{"id":3,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:52.858Z","created_at":"2021-08-27T11:05:50.969Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":3,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:25:57.059Z","created_at":"2021-08-27T12:25:55.130Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-15.yml b/tests/test_playbooks/fixtures/host-15.yml index 708351cd..def348da 100644 --- a/tests/test_playbooks/fixtures/host-15.yml +++ b/tests/test_playbooks/fixtures/host-15.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-16.yml b/tests/test_playbooks/fixtures/host-16.yml index 6cdb2765..8d59322a 100644 --- a/tests/test_playbooks/fixtures/host-16.yml +++ b/tests/test_playbooks/fixtures/host-16.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,21 +129,22 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ - ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ - 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ - :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ - :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ - :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ - :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ - test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ + :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ + \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ + puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ + puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -167,7 +168,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -185,7 +186,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1402' + - '1480' status: code: 200 message: OK @@ -208,7 +209,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -228,7 +229,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -265,11 +266,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -290,7 +291,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -313,8 +314,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "hostgroup_id": 3, "build": false, "managed": + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "hostgroup_id": 2, "build": false, "managed": false}}' headers: Accept: @@ -333,14 +334,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -355,11 +356,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-17.yml b/tests/test_playbooks/fixtures/host-17.yml index 551cc79d..498d189c 100644 --- a/tests/test_playbooks/fixtures/host-17.yml +++ b/tests/test_playbooks/fixtures/host-17.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/4 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:56 UTC","updated_at":"2021-08-27 11:05:56 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2735' + - '2770' status: code: 200 message: OK @@ -192,21 +192,22 @@ interactions: uri: https://foreman.example.org/api/hostgroups?search=title%3D%22test_group%2Fchild_group%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ - ,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":\"\ - 2\",\"parent_id\":2,\"parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\"\ - :null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\"\ - :null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\"\ - :null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"\ - realm_name\":null,\"created_at\":\"2021-08-27 11:05:37 UTC\",\"updated_at\"\ - :\"2021-08-27 11:05:37 UTC\",\"id\":3,\"name\":\"child_group\",\"title\":\"\ - test_group/child_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ - puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ - :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ + ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ + :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ + :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ + :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ + created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ + \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ + puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ + puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ :null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\"\ :null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\"\ :null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\"\ @@ -230,7 +231,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -248,7 +249,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1402' + - '1480' status: code: 200 message: OK @@ -271,7 +272,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -291,7 +292,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -328,11 +329,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -353,7 +354,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-18.yml b/tests/test_playbooks/fixtures/host-18.yml index 51ad8d6d..d98f0a91 100644 --- a/tests/test_playbooks/fixtures/host-18.yml +++ b/tests/test_playbooks/fixtures/host-18.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -131,7 +131,7 @@ interactions: uri: https://foreman.example.org/api/hosts/4 response: body: - string: '{"id":4,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:56.163Z","created_at":"2021-08-27T11:05:56.163Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":4,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:00.553Z","created_at":"2021-08-27T12:26:00.553Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-19.yml b/tests/test_playbooks/fixtures/host-19.yml index 708351cd..def348da 100644 --- a/tests/test_playbooks/fixtures/host-19.yml +++ b/tests/test_playbooks/fixtures/host-19.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-2.yml b/tests/test_playbooks/fixtures/host-2.yml index 843ca27e..22d579c2 100644 --- a/tests/test_playbooks/fixtures/host-2.yml +++ b/tests/test_playbooks/fixtures/host-2.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2709' + - '2744' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -321,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27 11:05:38\ + created_at\":\"2021-08-27 12:25:41 UTC\",\"updated_at\":\"2021-08-27 12:25:41\ \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":5,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":5,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":4,\"name\":\"\ + ssh_keys\":[],\"default_location\":{\"id\":4,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":4,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":3,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":4,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":3,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: @@ -347,7 +347,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -388,14 +388,14 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -414,7 +414,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -432,7 +432,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2711' + - '2746' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-20.yml b/tests/test_playbooks/fixtures/host-20.yml index 98163214..59650d13 100644 --- a/tests/test_playbooks/fixtures/host-20.yml +++ b/tests/test_playbooks/fixtures/host-20.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -133,7 +133,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,7 +153,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -190,11 +190,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", "build": false, "managed": false}}' headers: Accept: @@ -258,14 +258,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":"192.0.2.23","ip6":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -280,11 +280,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-21.yml b/tests/test_playbooks/fixtures/host-21.yml index 64a0d963..8e846e20 100644 --- a/tests/test_playbooks/fixtures/host-21.yml +++ b/tests/test_playbooks/fixtures/host-21.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/5 response: body: - string: '{"ip":"192.0.2.23","ip6":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:59 UTC","updated_at":"2021-08-27 11:05:59 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2755' + - '2790' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-22.yml b/tests/test_playbooks/fixtures/host-22.yml index c62d7468..27c51acd 100644 --- a/tests/test_playbooks/fixtures/host-22.yml +++ b/tests/test_playbooks/fixtures/host-22.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -131,7 +131,7 @@ interactions: uri: https://foreman.example.org/api/hosts/5 response: body: - string: '{"id":5,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:59.368Z","created_at":"2021-08-27T11:05:59.368Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":5,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:03.964Z","created_at":"2021-08-27T12:26:03.964Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-23.yml b/tests/test_playbooks/fixtures/host-23.yml index df77e079..4cf76aad 100644 --- a/tests/test_playbooks/fixtures/host-23.yml +++ b/tests/test_playbooks/fixtures/host-23.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -132,7 +132,7 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2021-08-27 11:05:39 UTC\",\"updated_at\":\"2021-08-27 11:05:39 UTC\",\"\ + :\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27 12:25:42 UTC\",\"\ name\":\"superARCH\",\"id\":3}]\n}\n" headers: Cache-Control: @@ -152,7 +152,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -210,7 +210,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,7 +252,7 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"description\"\ :null,\"major\":\"7\",\"minor\":\"6\",\"family\":\"Redhat\",\"release_name\"\ :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2021-08-27\ - \ 11:05:40 UTC\",\"updated_at\":\"2021-08-27 11:05:40 UTC\",\"id\":2,\"name\"\ + \ 12:25:43 UTC\",\"updated_at\":\"2021-08-27 12:25:43 UTC\",\"id\":2,\"name\"\ :\"TestOS\",\"title\":\"TestOS 7.6\"}]\n}\n" headers: Cache-Control: @@ -272,7 +272,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -313,7 +313,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -333,7 +333,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -370,11 +370,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -395,7 +395,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -418,8 +418,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "architecture_id": 3, "operatingsystem_id": + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "architecture_id": 3, "operatingsystem_id": 2, "build": false, "managed": false}}' headers: Accept: @@ -438,15 +438,15 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -461,11 +461,11 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-24.yml b/tests/test_playbooks/fixtures/host-24.yml index 24312db4..022b7b09 100644 --- a/tests/test_playbooks/fixtures/host-24.yml +++ b/tests/test_playbooks/fixtures/host-24.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,15 +129,15 @@ interactions: uri: https://foreman.example.org/api/hosts/6 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:01 UTC","updated_at":"2021-08-27 11:06:01 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -156,7 +156,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -174,7 +174,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2718' + - '2753' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2021-08-27 11:05:39 UTC\",\"updated_at\":\"2021-08-27 11:05:39 UTC\",\"\ + :\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27 12:25:42 UTC\",\"\ name\":\"superARCH\",\"id\":3}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -274,7 +274,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -316,7 +316,7 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"description\"\ :null,\"major\":\"7\",\"minor\":\"6\",\"family\":\"Redhat\",\"release_name\"\ :\"reverse whip\",\"password_hash\":\"SHA256\",\"created_at\":\"2021-08-27\ - \ 11:05:40 UTC\",\"updated_at\":\"2021-08-27 11:05:40 UTC\",\"id\":2,\"name\"\ + \ 12:25:43 UTC\",\"updated_at\":\"2021-08-27 12:25:43 UTC\",\"id\":2,\"name\"\ :\"TestOS\",\"title\":\"TestOS 7.6\"}]\n}\n" headers: Cache-Control: @@ -336,7 +336,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -377,7 +377,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -397,7 +397,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -434,11 +434,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -459,7 +459,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-25.yml b/tests/test_playbooks/fixtures/host-25.yml index 3b5fe524..58bd0680 100644 --- a/tests/test_playbooks/fixtures/host-25.yml +++ b/tests/test_playbooks/fixtures/host-25.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -131,7 +131,7 @@ interactions: uri: https://foreman.example.org/api/hosts/6 response: body: - string: '{"id":6,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:01.884Z","created_at":"2021-08-27T11:06:01.884Z","root_pass":null,"architecture_id":3,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":6,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:06.786Z","created_at":"2021-08-27T12:26:06.786Z","root_pass":null,"architecture_id":3,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-26.yml b/tests/test_playbooks/fixtures/host-26.yml index e8806109..fa993930 100644 --- a/tests/test_playbooks/fixtures/host-26.yml +++ b/tests/test_playbooks/fixtures/host-26.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -114,6 +114,66 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '282' + status: + code: 200 + message: OK - request: body: null headers: @@ -133,7 +193,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,9 +213,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=98 + - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -190,11 +250,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,9 +275,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -238,8 +298,9 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "environment_id": 1, "build": false, + "managed": false}}' headers: Accept: - application/json;version=2 @@ -248,7 +309,7 @@ interactions: Connection: - keep-alive Content-Length: - - '157' + - '178' Content-Type: - application/json User-Agent: @@ -257,14 +318,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,13 +340,13 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - 4; Test Location Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains Transfer-Encoding: @@ -303,4 +364,125 @@ interactions: status: code: 201 message: Created +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Aredis_exporter%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::redis_exporter\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":38,\"name\":\"prometheus::redis_exporter\",\"created_at\"\ + :\"2021-08-27T12:24:33.522Z\",\"updated_at\":\"2021-08-27T12:24:33.522Z\"\ + }]}\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '333' + status: + code: 200 + message: OK +- request: + body: '{"puppetclass_id": 38}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids + response: + body: + string: '{"host_id":7,"puppetclass_id":38}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=93 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '33' + status: + code: 200 + message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/host-27.yml b/tests/test_playbooks/fixtures/host-27.yml index 71498042..d9736b6a 100644 --- a/tests/test_playbooks/fixtures/host-27.yml +++ b/tests/test_playbooks/fixtures/host-27.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/7 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:04 UTC","updated_at":"2021-08-27 11:06:04 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,67 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2709' + - '2893' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '282' status: code: 200 message: OK @@ -196,7 +256,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,9 +276,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -253,11 +313,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,9 +338,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -300,4 +360,65 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Aredis_exporter%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::redis_exporter\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":38,\"name\":\"prometheus::redis_exporter\",\"created_at\"\ + :\"2021-08-27T12:24:33.522Z\",\"updated_at\":\"2021-08-27T12:24:33.522Z\"\ + }]}\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '333' + status: + code: 200 + message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/host-28.yml b/tests/test_playbooks/fixtures/host-28.yml index 2efb7f90..58d0f8fa 100644 --- a/tests/test_playbooks/fixtures/host-28.yml +++ b/tests/test_playbooks/fixtures/host-28.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -67,7 +67,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts?thin=true&search=name%3D%22test-host.example.net%22&per_page=4294967296 + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 response: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -114,6 +114,373 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/7 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2893' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '282' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Ahaproxy_exporter%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::haproxy_exporter\\\"\"\ + ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":17,\"name\":\"prometheus::haproxy_exporter\",\"\ + created_at\":\"2021-08-27T12:24:20.646Z\",\"updated_at\":\"2021-08-27T12:24:20.646Z\"\ + }]}\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '337' + status: + code: 200 + message: OK +- request: + body: '{"puppetclass_id": 17}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids + response: + body: + string: '{"host_id":7,"puppetclass_id":17}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=93 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '33' + status: + code: 200 + message: OK - request: body: null headers: @@ -128,10 +495,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/38 response: body: - string: '{"id":7,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:04.443Z","created_at":"2021-08-27T11:06:04.443Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '[]' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,9 +517,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=98 + - timeout=15, max=92 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -168,7 +535,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '872' + - '2' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-29.yml b/tests/test_playbooks/fixtures/host-29.yml index 19ae12f9..6edf1f67 100644 --- a/tests/test_playbooks/fixtures/host-29.yml +++ b/tests/test_playbooks/fixtures/host-29.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -70,10 +70,10 @@ interactions: uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 response: body: - string: "{\n \"total\": 1,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ - sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": []\n\ - }\n" + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -110,7 +110,130 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '187' + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/7 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2897' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '282' status: code: 200 message: OK @@ -133,7 +256,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -153,9 +276,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=98 + - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -190,11 +313,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -215,9 +338,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -238,8 +361,7 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 5, "organization_id": 4, "host": {"name": "test-host.example.net", - "location_id": 5, "organization_id": 4, "build": false, "managed": false}}' + body: null headers: Accept: - application/json;version=2 @@ -247,24 +369,18 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '157' - Content-Type: - - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/api/hosts + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Ahaproxy_exporter%22&per_page=4294967296 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::haproxy_exporter\\\"\"\ + ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":17,\"name\":\"prometheus::haproxy_exporter\",\"\ + created_at\":\"2021-08-27T12:24:20.646Z\",\"updated_at\":\"2021-08-27T12:24:20.646Z\"\ + }]}\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,17 +395,17 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 5; Test Location + - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=94 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff X-Download-Options: @@ -300,7 +416,9 @@ interactions: - none X-XSS-Protection: - 1; mode=block + content-length: + - '337' status: - code: 201 - message: Created + code: 200 + message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/host-3.yml b/tests/test_playbooks/fixtures/host-3.yml index 8b698ad1..05cc8cf3 100644 --- a/tests/test_playbooks/fixtures/host-3.yml +++ b/tests/test_playbooks/fixtures/host-3.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2711' + - '2746' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -321,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27 11:05:38\ + created_at\":\"2021-08-27 12:25:41 UTC\",\"updated_at\":\"2021-08-27 12:25:41\ \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":5,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":5,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":4,\"name\":\"\ + ssh_keys\":[],\"default_location\":{\"id\":4,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":4,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":3,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":4,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":3,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: @@ -347,7 +347,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-30.yml b/tests/test_playbooks/fixtures/host-30.yml index 7178d350..b713d952 100644 --- a/tests/test_playbooks/fixtures/host-30.yml +++ b/tests/test_playbooks/fixtures/host-30.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/7 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2709' + - '2897' status: code: 200 message: OK @@ -189,16 +189,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location+Secondary%22&per_page=4294967296 + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ - \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 11:05:32 UTC\",\"updated_at\":\"2021-08-27 11:05:32 UTC\",\"\ - id\":7,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ - ,\"description\":null}]\n}\n" + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -217,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -235,7 +233,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '414' + - '282' status: code: 200 message: OK @@ -251,16 +249,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ - ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 11:05:31 UTC\",\"updated_at\":\"2021-08-27 11:05:31 UTC\",\"\ - id\":6,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ - \ Secondary\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,7 +276,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -297,12 +294,135 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '442' + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Aredis_exporter%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::redis_exporter\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":38,\"name\":\"prometheus::redis_exporter\",\"created_at\"\ + :\"2021-08-27T12:24:33.522Z\",\"updated_at\":\"2021-08-27T12:24:33.522Z\"\ + }]}\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '333' status: code: 200 message: OK - request: - body: '{"host": {"location_id": 7, "organization_id": 6}}' + body: '{"puppetclass_id": 38}' headers: Accept: - application/json;version=2 @@ -311,23 +431,16 @@ interactions: Connection: - keep-alive Content-Length: - - '50' + - '22' Content-Type: - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/api/hosts/8 + method: POST + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":6,"organization_name":"Test - Organization Secondary","location_id":7,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"host_id":7,"puppetclass_id":38}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -346,9 +459,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=95 + - timeout=15, max=93 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -364,7 +477,65 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2729' + - '33' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/17 + response: + body: + string: '[]' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=92 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-31.yml b/tests/test_playbooks/fixtures/host-31.yml index 7ba567db..d9736b6a 100644 --- a/tests/test_playbooks/fixtures/host-31.yml +++ b/tests/test_playbooks/fixtures/host-31.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/7 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":6,"organization_name":"Test - Organization Secondary","location_id":7,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:06:06 UTC","updated_at":"2021-08-27 11:06:06 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2729' + - '2893' status: code: 200 message: OK @@ -189,16 +189,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location+Secondary%22&per_page=4294967296 + uri: https://foreman.example.org/api/environments?search=name%3D%22production%22&per_page=4294967296 response: body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ - \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 11:05:32 UTC\",\"updated_at\":\"2021-08-27 11:05:32 UTC\",\"\ - id\":7,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ - ,\"description\":null}]\n}\n" + string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"production\\\"\",\n \"sort\": {\n\ + \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ + :\"2021-08-27 12:22:32 UTC\",\"updated_at\":\"2021-08-27 12:22:32 UTC\",\"\ + name\":\"production\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -217,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -235,7 +233,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '414' + - '282' status: code: 200 message: OK @@ -251,16 +249,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ - ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ - : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 11:05:31 UTC\",\"updated_at\":\"2021-08-27 11:05:31 UTC\",\"\ - id\":6,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ - \ Secondary\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,7 +276,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -297,7 +294,130 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '442' + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/environments/1/puppetclasses?search=name%3D%22prometheus%3A%3Aredis_exporter%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 58,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"prometheus::redis_exporter\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : {\"prometheus\":[{\"id\":38,\"name\":\"prometheus::redis_exporter\",\"created_at\"\ + :\"2021-08-27T12:24:33.522Z\",\"updated_at\":\"2021-08-27T12:24:33.522Z\"\ + }]}\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=94 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '333' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-32.yml b/tests/test_playbooks/fixtures/host-32.yml index 75267602..a7f7029a 100644 --- a/tests/test_playbooks/fixtures/host-32.yml +++ b/tests/test_playbooks/fixtures/host-32.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -67,13 +67,13 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts?thin=true&search=name%3D%22test-host.example.net%22&per_page=4294967296 + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 response: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -114,6 +114,192 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/7 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2893' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK - request: body: null headers: @@ -128,10 +314,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/38 response: body: - string: '{"id":8,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:06:07.906Z","created_at":"2021-08-27T11:06:06.943Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":6,"location_id":7,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '[]' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,9 +336,9 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - - timeout=15, max=98 + - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains Vary: @@ -168,7 +354,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '872' + - '2' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-33.yml b/tests/test_playbooks/fixtures/host-33.yml new file mode 100644 index 00000000..e87f9935 --- /dev/null +++ b/tests/test_playbooks/fixtures/host-33.yml @@ -0,0 +1,303 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/7 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2749' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/host-34.yml b/tests/test_playbooks/fixtures/host-34.yml new file mode 100644 index 00000000..d96d0051 --- /dev/null +++ b/tests/test_playbooks/fixtures/host-34.yml @@ -0,0 +1,175 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=true&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/api/hosts/7 + response: + body: + string: '{"id":7,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:09.606Z","created_at":"2021-08-27T12:26:09.606Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":1,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '869' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/host-35.yml b/tests/test_playbooks/fixtures/host-35.yml new file mode 100644 index 00000000..37c25c16 --- /dev/null +++ b/tests/test_playbooks/fixtures/host-35.yml @@ -0,0 +1,306 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 1,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": []\n\ + }\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '187' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '384' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ + : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ + A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '412' + status: + code: 200 + message: OK +- request: + body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", + "location_id": 4, "organization_id": 3, "build": false, "managed": false}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '157' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/api/hosts + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - 4; Test Location + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +version: 1 diff --git a/tests/test_playbooks/fixtures/host-36.yml b/tests/test_playbooks/fixtures/host-36.yml new file mode 100644 index 00000000..d9aa96ba --- /dev/null +++ b/tests/test_playbooks/fixtures/host-36.yml @@ -0,0 +1,371 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/8 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2744' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location+Secondary%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ + :\"2021-08-27 12:25:35 UTC\",\"updated_at\":\"2021-08-27 12:25:35 UTC\",\"\ + id\":6,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + ,\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '414' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ + ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ + :\"2021-08-27 12:25:33 UTC\",\"updated_at\":\"2021-08-27 12:25:33 UTC\",\"\ + id\":5,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + \ Secondary\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '442' + status: + code: 200 + message: OK +- request: + body: '{"host": {"location_id": 6, "organization_id": 5}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '50' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/api/hosts/8 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test + Organization Secondary","location_id":6,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2764' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/host-37.yml b/tests/test_playbooks/fixtures/host-37.yml new file mode 100644 index 00000000..3bd6a7b7 --- /dev/null +++ b/tests/test_playbooks/fixtures/host-37.yml @@ -0,0 +1,304 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=false&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts/8 + response: + body: + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test + Organization Secondary","location_id":6,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '2764' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/locations?search=title%3D%22Test+Location+Secondary%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ + :\"2021-08-27 12:25:35 UTC\",\"updated_at\":\"2021-08-27 12:25:35 UTC\",\"\ + id\":6,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + ,\"description\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '414' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization+Secondary%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ + ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ + : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ + :\"2021-08-27 12:25:33 UTC\",\"updated_at\":\"2021-08-27 12:25:33 UTC\",\"\ + id\":5,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + \ Secondary\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '442' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/host-38.yml b/tests/test_playbooks/fixtures/host-38.yml new file mode 100644 index 00000000..f413ebd7 --- /dev/null +++ b/tests/test_playbooks/fixtures/host-38.yml @@ -0,0 +1,175 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '62' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/hosts?thin=true&search=name%3D%22test-host.example.net%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ + sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ + id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '226' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/api/hosts/8 + response: + body: + string: '{"id":8,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:19.361Z","created_at":"2021-08-27T12:26:18.310Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 2.5.2 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '872' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/host-4.yml b/tests/test_playbooks/fixtures/host-4.yml index d2959462..3cc4a9dc 100644 --- a/tests/test_playbooks/fixtures/host-4.yml +++ b/tests/test_playbooks/fixtures/host-4.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,14 +129,14 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:44 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -155,7 +155,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2711' + - '2746' status: code: 200 message: OK @@ -196,7 +196,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -216,7 +216,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -253,11 +253,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -278,7 +278,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -318,8 +318,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27\ - \ 11:05:38 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27\ + \ 12:25:42 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -338,7 +338,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -379,13 +379,13 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -404,7 +404,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -422,7 +422,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2713' + - '2748' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-5.yml b/tests/test_playbooks/fixtures/host-5.yml index 8567efb8..b1bb6ba8 100644 --- a/tests/test_playbooks/fixtures/host-5.yml +++ b/tests/test_playbooks/fixtures/host-5.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,13 +129,13 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +154,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +172,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2713' + - '2748' status: code: 200 message: OK @@ -195,7 +195,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -215,7 +215,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -252,11 +252,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -277,7 +277,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -317,8 +317,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2021-08-27 11:05:38 UTC\",\"updated_at\":\"2021-08-27\ - \ 11:05:38 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27\ + \ 12:25:42 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -337,7 +337,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-6.yml b/tests/test_playbooks/fixtures/host-6.yml index 74297ba2..f4c7840e 100644 --- a/tests/test_playbooks/fixtures/host-6.yml +++ b/tests/test_playbooks/fixtures/host-6.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,13 +129,13 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:42 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 + 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -154,7 +154,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -172,7 +172,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2713' + - '2748' status: code: 200 message: OK @@ -197,7 +197,7 @@ interactions: :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ - \ 11:05:35 UTC\",\"updated_at\":\"2021-08-27 11:05:35 UTC\",\"ipam\":\"DHCP\"\ + \ 12:25:38 UTC\",\"updated_at\":\"2021-08-27 12:25:38 UTC\",\"ipam\":\"DHCP\"\ ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ @@ -223,7 +223,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -264,7 +264,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -284,7 +284,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -321,11 +321,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -346,7 +346,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: @@ -387,15 +387,15 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test + 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:47 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:51 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -414,7 +414,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: @@ -432,7 +432,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2727' + - '2762' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-7.yml b/tests/test_playbooks/fixtures/host-7.yml index 1a2138ad..a514e7a3 100644 --- a/tests/test_playbooks/fixtures/host-7.yml +++ b/tests/test_playbooks/fixtures/host-7.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -129,15 +129,15 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"ip":null,"ip6":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"bmc_available":false,"organization_id":4,"organization_name":"Test - Organization","location_id":5,"location_name":"Test Location","puppet_status":0,"model_name":null,"build_status":0,"build_status_label":"Installed","name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-11 - 13:50:38 UTC","updated_at":"2021-08-11 13:50:38 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test + 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test + Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 11:05:42 UTC","updated_at":"2021-08-27 11:05:47 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:25:46 UTC","updated_at":"2021-08-27 12:25:51 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -156,7 +156,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: @@ -174,7 +174,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2727' + - '2762' status: code: 200 message: OK @@ -199,7 +199,7 @@ interactions: :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ - \ 11:05:35 UTC\",\"updated_at\":\"2021-08-27 11:05:35 UTC\",\"ipam\":\"DHCP\"\ + \ 12:25:38 UTC\",\"updated_at\":\"2021-08-27 12:25:38 UTC\",\"ipam\":\"DHCP\"\ ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ @@ -225,7 +225,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: @@ -266,7 +266,7 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:30 UTC\",\"updated_at\":\"2021-08-27 11:05:30 UTC\",\"id\":5,\"name\"\ + \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -286,7 +286,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: @@ -323,11 +323,11 @@ interactions: uri: https://foreman.example.org/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 4,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 11:05:29 UTC\",\"updated_at\":\"2021-08-27 11:05:29 UTC\",\"id\":4,\"name\"\ + \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -348,7 +348,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-8.yml b/tests/test_playbooks/fixtures/host-8.yml index 1316b337..13367064 100644 --- a/tests/test_playbooks/fixtures/host-8.yml +++ b/tests/test_playbooks/fixtures/host-8.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: @@ -131,7 +131,7 @@ interactions: uri: https://foreman.example.org/api/hosts/2 response: body: - string: '{"id":2,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T11:05:45.956Z","created_at":"2021-08-27T11:05:42.266Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":4,"location_id":5,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":2,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:25:49.854Z","created_at":"2021-08-27T12:25:46.052Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -150,7 +150,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: diff --git a/tests/test_playbooks/fixtures/host-9.yml b/tests/test_playbooks/fixtures/host-9.yml index 708351cd..def348da 100644 --- a/tests/test_playbooks/fixtures/host-9.yml +++ b/tests/test_playbooks/fixtures/host-9.yml @@ -14,7 +14,7 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.0.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"2.5.2","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -33,7 +33,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: @@ -51,7 +51,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '66' + - '62' status: code: 200 message: OK @@ -92,7 +92,7 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.0.0-rc1 + - 2.5.2 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: From 76147712bed3db2e830a1118001b89bbb62e6f80 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 13:41:03 +0200 Subject: [PATCH 09/36] simplify code --- plugins/module_utils/foreman_helper.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index 2869d77d..d644ac01 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1795,14 +1795,13 @@ def ensure_puppetclasses(module, entity_type, entity, expected_puppetclasses=Non # Add to entity for reporting current_puppetclass_ids.append(puppetclass['id']) - if len(previous_puppetclass_ids) > 0: - for leftover_puppetclass in previous_puppetclass_ids: - payload = {'{0}_id'.format(entity_type): entity['id']} - module.ensure_entity( - puppetclasses_resource, {}, {'id': leftover_puppetclass}, - params=payload, state='absent', foreman_spec={}, - ) - current_puppetclass_ids.remove(leftover_puppetclass) + for leftover_puppetclass in previous_puppetclass_ids: + payload = {'{0}_id'.format(entity_type): entity['id']} + module.ensure_entity( + puppetclasses_resource, {}, {'id': leftover_puppetclass}, + params=payload, state='absent', foreman_spec={}, + ) + current_puppetclass_ids.remove(leftover_puppetclass) # Helper constants From 28ad0b7147dd53a0cb5e15d66c1f1f57101c5bf2 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 27 Aug 2021 14:46:49 +0200 Subject: [PATCH 10/36] report puppetclass_ids as part of the returned entity --- plugins/module_utils/foreman_helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index d644ac01..bba4e265 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1802,6 +1802,7 @@ def ensure_puppetclasses(module, entity_type, entity, expected_puppetclasses=Non params=payload, state='absent', foreman_spec={}, ) current_puppetclass_ids.remove(leftover_puppetclass) + entity['puppetclass_ids'] = current_puppetclass_ids # Helper constants From 9ebe3318e97ab50dc0f6388a9423abc0ab41462a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Sep 2021 14:52:24 +0200 Subject: [PATCH 11/36] adjust tests to verify puppetclasses *and* description can be updated --- tests/test_playbooks/fixtures/host-0.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-1.yml | 24 +++++----- tests/test_playbooks/fixtures/host-10.yml | 34 +++++++------- tests/test_playbooks/fixtures/host-11.yml | 34 +++++++------- tests/test_playbooks/fixtures/host-12.yml | 54 +++++++++++------------ tests/test_playbooks/fixtures/host-13.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-14.yml | 10 ++--- tests/test_playbooks/fixtures/host-16.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-17.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-18.yml | 10 ++--- tests/test_playbooks/fixtures/host-2.yml | 52 +++++++++++----------- tests/test_playbooks/fixtures/host-20.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-21.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-22.yml | 10 ++--- tests/test_playbooks/fixtures/host-23.yml | 32 +++++++------- tests/test_playbooks/fixtures/host-24.yml | 32 +++++++------- tests/test_playbooks/fixtures/host-25.yml | 10 ++--- tests/test_playbooks/fixtures/host-26.yml | 34 +++++++------- tests/test_playbooks/fixtures/host-27.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-28.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-29.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-3.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-30.yml | 36 +++++++-------- tests/test_playbooks/fixtures/host-31.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-32.yml | 30 ++++++------- tests/test_playbooks/fixtures/host-33.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-34.yml | 10 ++--- tests/test_playbooks/fixtures/host-35.yml | 28 ++++++------ tests/test_playbooks/fixtures/host-36.yml | 50 ++++++++++----------- tests/test_playbooks/fixtures/host-37.yml | 30 ++++++------- tests/test_playbooks/fixtures/host-38.yml | 10 ++--- tests/test_playbooks/fixtures/host-4.yml | 42 +++++++++--------- tests/test_playbooks/fixtures/host-5.yml | 26 +++++------ tests/test_playbooks/fixtures/host-6.yml | 46 +++++++++---------- tests/test_playbooks/fixtures/host-7.yml | 32 +++++++------- tests/test_playbooks/fixtures/host-8.yml | 6 +-- tests/test_playbooks/host.yml | 6 ++- 37 files changed, 533 insertions(+), 531 deletions(-) diff --git a/tests/test_playbooks/fixtures/host-0.yml b/tests/test_playbooks/fixtures/host-0.yml index 018e37cc..e51157c8 100644 --- a/tests/test_playbooks/fixtures/host-0.yml +++ b/tests/test_playbooks/fixtures/host-0.yml @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -193,8 +193,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "build": false, "managed": false}}' + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,14 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,9 +279,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-1.yml b/tests/test_playbooks/fixtures/host-1.yml index ac144d6b..0763ab71 100644 --- a/tests/test_playbooks/fixtures/host-1.yml +++ b/tests/test_playbooks/fixtures/host-1.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-10.yml b/tests/test_playbooks/fixtures/host-10.yml index 92053d55..37a42249 100644 --- a/tests/test_playbooks/fixtures/host-10.yml +++ b/tests/test_playbooks/fixtures/host-10.yml @@ -133,14 +133,14 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ + :null,\"domain_id\":3,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ - :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-08-27 12:25:39\ - \ UTC\",\"updated_at\":\"2021-08-27 12:25:39 UTC\",\"id\":1,\"name\":\"test_group\"\ + :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-09-07 12:49:57\ + \ UTC\",\"updated_at\":\"2021-09-07 12:49:57 UTC\",\"id\":3,\"name\":\"test_group\"\ ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ @@ -208,8 +208,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -269,8 +269,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -314,8 +314,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "hostgroup_id": 1, "build": false, "managed": + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "hostgroup_id": 3, "build": false, "managed": false}}' headers: Accept: @@ -334,14 +334,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","managed":true,"identifier":null,"id":10,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -356,9 +356,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-11.yml b/tests/test_playbooks/fixtures/host-11.yml index dd54b309..79ee0f86 100644 --- a/tests/test_playbooks/fixtures/host-11.yml +++ b/tests/test_playbooks/fixtures/host-11.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":3,\"name\":\"test-host.example.net\"}]\n}\n" + id\":10,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/3 + uri: https://foreman.example.org/api/hosts/10 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","managed":true,"identifier":null,"id":10,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2757' + - '2759' status: code: 200 message: OK @@ -196,14 +196,14 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\"\ :null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\"\ - :null,\"domain_id\":2,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ + :null,\"domain_id\":3,\"domain_name\":\"example.net\",\"environment_id\":null,\"\ environment_name\":null,\"compute_profile_id\":null,\"compute_profile_name\"\ :null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\"\ :null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\"\ :null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"\ compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\"\ - :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-08-27 12:25:39\ - \ UTC\",\"updated_at\":\"2021-08-27 12:25:39 UTC\",\"id\":1,\"name\":\"test_group\"\ + :null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-09-07 12:49:57\ + \ UTC\",\"updated_at\":\"2021-09-07 12:49:57 UTC\",\"id\":3,\"name\":\"test_group\"\ ,\"title\":\"test_group\",\"description\":null,\"puppet_proxy_id\":null,\"\ puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\"\ :null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\"\ @@ -271,8 +271,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -332,8 +332,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-12.yml b/tests/test_playbooks/fixtures/host-12.yml index fd652fb7..6a240f44 100644 --- a/tests/test_playbooks/fixtures/host-12.yml +++ b/tests/test_playbooks/fixtures/host-12.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":3,\"name\":\"test-host.example.net\"}]\n}\n" + id\":10,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/3 + uri: https://foreman.example.org/api/hosts/10 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":3,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"test_group","hostgroup_title":"test_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","managed":true,"identifier":null,"id":10,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2757' + - '2759' status: code: 200 message: OK @@ -196,15 +196,15 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ - \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + created_at\":\"2021-09-07 12:49:58 UTC\",\"updated_at\":\"2021-09-07 12:49:58\ + \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -271,8 +271,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -332,8 +332,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -377,7 +377,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"hostgroup_id": 2}}' + body: '{"host": {"hostgroup_id": 4}}' headers: Accept: - application/json;version=2 @@ -392,17 +392,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/3 + uri: https://foreman.example.org/api/hosts/10 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:57 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:16 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","managed":true,"identifier":null,"id":10,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -439,7 +439,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2770' + - '2772' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-13.yml b/tests/test_playbooks/fixtures/host-13.yml index 717d6fa9..a2026098 100644 --- a/tests/test_playbooks/fixtures/host-13.yml +++ b/tests/test_playbooks/fixtures/host-13.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":3,\"name\":\"test-host.example.net\"}]\n}\n" + id\":10,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/3 + uri: https://foreman.example.org/api/hosts/10 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:57 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":3,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:16 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":10,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:55 UTC","updated_at":"2021-08-27 12:25:55 UTC","managed":true,"identifier":null,"id":3,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:14 UTC","updated_at":"2021-09-07 12:50:14 UTC","managed":true,"identifier":null,"id":10,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2770' + - '2772' status: code: 200 message: OK @@ -196,15 +196,15 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ - \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + created_at\":\"2021-09-07 12:49:58 UTC\",\"updated_at\":\"2021-09-07 12:49:58\ + \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -271,8 +271,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -332,8 +332,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-14.yml b/tests/test_playbooks/fixtures/host-14.yml index 69712fc4..c0272e31 100644 --- a/tests/test_playbooks/fixtures/host-14.yml +++ b/tests/test_playbooks/fixtures/host-14.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":3,\"name\":\"test-host.example.net\"}]\n}\n" + id\":10,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/3 + uri: https://foreman.example.org/api/hosts/10 response: body: - string: '{"id":3,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:25:57.059Z","created_at":"2021-08-27T12:25:55.130Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":10,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:16.848Z","created_at":"2021-09-07T12:50:14.811Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '869' + - '870' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-16.yml b/tests/test_playbooks/fixtures/host-16.yml index 8d59322a..2888c05c 100644 --- a/tests/test_playbooks/fixtures/host-16.yml +++ b/tests/test_playbooks/fixtures/host-16.yml @@ -133,15 +133,15 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ - \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + created_at\":\"2021-09-07 12:49:58 UTC\",\"updated_at\":\"2021-09-07 12:49:58\ + \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -208,8 +208,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -269,8 +269,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -314,8 +314,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "hostgroup_id": 2, "build": false, "managed": + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "hostgroup_id": 4, "build": false, "managed": false}}' headers: Accept: @@ -334,14 +334,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:20 UTC","updated_at":"2021-09-07 12:50:20 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:20 UTC","updated_at":"2021-09-07 12:50:20 UTC","managed":true,"identifier":null,"id":11,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -356,9 +356,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-17.yml b/tests/test_playbooks/fixtures/host-17.yml index 498d189c..51d51e85 100644 --- a/tests/test_playbooks/fixtures/host-17.yml +++ b/tests/test_playbooks/fixtures/host-17.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":4,\"name\":\"test-host.example.net\"}]\n}\n" + id\":11,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/4 + uri: https://foreman.example.org/api/hosts/11 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":4,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:20 UTC","updated_at":"2021-09-07 12:50:20 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":11,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"child_group","hostgroup_title":"test_group/child_group","parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:00 UTC","updated_at":"2021-08-27 12:26:00 UTC","managed":true,"identifier":null,"id":4,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:20 UTC","updated_at":"2021-09-07 12:50:20 UTC","managed":true,"identifier":null,"id":11,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2770' + - '2772' status: code: 200 message: OK @@ -196,15 +196,15 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"test_group/child_group\\\"\",\n \ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"\ - operatingsystem_name\":null,\"domain_id\":2,\"domain_name\":\"example.net\"\ + operatingsystem_name\":null,\"domain_id\":3,\"domain_name\":\"example.net\"\ ,\"environment_id\":null,\"environment_name\":null,\"compute_profile_id\"\ - :null,\"compute_profile_name\":null,\"ancestry\":\"1\",\"parent_id\":1,\"\ + :null,\"compute_profile_name\":null,\"ancestry\":\"3\",\"parent_id\":3,\"\ parent_name\":\"test_group\",\"ptable_id\":null,\"ptable_name\":null,\"medium_id\"\ :null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\"\ :null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\"\ :null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"\ - created_at\":\"2021-08-27 12:25:40 UTC\",\"updated_at\":\"2021-08-27 12:25:40\ - \ UTC\",\"id\":2,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ + created_at\":\"2021-09-07 12:49:58 UTC\",\"updated_at\":\"2021-09-07 12:49:58\ + \ UTC\",\"id\":4,\"name\":\"child_group\",\"title\":\"test_group/child_group\"\ ,\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"\ puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"\ puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_environment_id\"\ @@ -271,8 +271,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -332,8 +332,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-18.yml b/tests/test_playbooks/fixtures/host-18.yml index d98f0a91..6ae3243d 100644 --- a/tests/test_playbooks/fixtures/host-18.yml +++ b/tests/test_playbooks/fixtures/host-18.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":4,\"name\":\"test-host.example.net\"}]\n}\n" + id\":11,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/4 + uri: https://foreman.example.org/api/hosts/11 response: body: - string: '{"id":4,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:00.553Z","created_at":"2021-08-27T12:26:00.553Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":11,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:20.681Z","created_at":"2021-09-07T12:50:20.681Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":4,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '869' + - '870' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-2.yml b/tests/test_playbooks/fixtures/host-2.yml index 22d579c2..bab8e41c 100644 --- a/tests/test_playbooks/fixtures/host-2.yml +++ b/tests/test_playbooks/fixtures/host-2.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -321,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2021-08-27 12:25:41 UTC\",\"updated_at\":\"2021-08-27 12:25:41\ - \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":4,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":4,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":3,\"name\":\"\ + created_at\":\"2021-09-07 12:49:59 UTC\",\"updated_at\":\"2021-09-07 12:49:59\ + \ UTC\",\"id\":6,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ + ssh_keys\":[],\"default_location\":{\"id\":8,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":8,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":7,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":3,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":7,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: @@ -370,7 +370,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"owner_id": 5}}' + body: '{"host": {"owner_id": 6}}' headers: Accept: - application/json;version=2 @@ -385,17 +385,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":6,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate diff --git a/tests/test_playbooks/fixtures/host-20.yml b/tests/test_playbooks/fixtures/host-20.yml index 59650d13..6d63e30f 100644 --- a/tests/test_playbooks/fixtures/host-20.yml +++ b/tests/test_playbooks/fixtures/host-20.yml @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -193,8 +193,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "ip": "192.0.2.23", "mac": "ee:ff:00:00:00:01", "build": false, "managed": false}}' headers: Accept: @@ -258,14 +258,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:24 UTC","updated_at":"2021-09-07 12:50:24 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":12,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:24 UTC","updated_at":"2021-09-07 12:50:24 UTC","managed":true,"identifier":null,"id":12,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -280,9 +280,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-21.yml b/tests/test_playbooks/fixtures/host-21.yml index 8e846e20..cd426d0a 100644 --- a/tests/test_playbooks/fixtures/host-21.yml +++ b/tests/test_playbooks/fixtures/host-21.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":12,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/12 response: body: - string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":5,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":"192.0.2.23","ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":"ee:ff:00:00:00:01","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:24 UTC","updated_at":"2021-09-07 12:50:24 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":12,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:03 UTC","updated_at":"2021-08-27 12:26:03 UTC","managed":true,"identifier":null,"id":5,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:24 UTC","updated_at":"2021-09-07 12:50:24 UTC","managed":true,"identifier":null,"id":12,"name":"test-host.example.net","ip":"192.0.2.23","ip6":null,"mac":"ee:ff:00:00:00:01","mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2790' + - '2792' status: code: 200 message: OK @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-22.yml b/tests/test_playbooks/fixtures/host-22.yml index 27c51acd..c6d9051d 100644 --- a/tests/test_playbooks/fixtures/host-22.yml +++ b/tests/test_playbooks/fixtures/host-22.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":5,\"name\":\"test-host.example.net\"}]\n}\n" + id\":12,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/5 + uri: https://foreman.example.org/api/hosts/12 response: body: - string: '{"id":5,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:03.964Z","created_at":"2021-08-27T12:26:03.964Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":12,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:24.368Z","created_at":"2021-09-07T12:50:24.368Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '872' + - '873' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-23.yml b/tests/test_playbooks/fixtures/host-23.yml index 4cf76aad..331ab5bf 100644 --- a/tests/test_playbooks/fixtures/host-23.yml +++ b/tests/test_playbooks/fixtures/host-23.yml @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27 12:25:42 UTC\",\"\ - name\":\"superARCH\",\"id\":3}]\n}\n" + :\"2021-09-07 12:50:01 UTC\",\"updated_at\":\"2021-09-07 12:50:01 UTC\",\"\ + name\":\"superARCH\",\"id\":4}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -312,8 +312,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -373,8 +373,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -418,8 +418,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "architecture_id": 3, "operatingsystem_id": + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "architecture_id": 4, "operatingsystem_id": 2, "build": false, "managed": false}}' headers: Accept: @@ -438,15 +438,15 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":4,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:27 UTC","updated_at":"2021-09-07 12:50:27 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":13,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:27 UTC","updated_at":"2021-09-07 12:50:27 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -461,9 +461,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-24.yml b/tests/test_playbooks/fixtures/host-24.yml index 022b7b09..62730328 100644 --- a/tests/test_playbooks/fixtures/host-24.yml +++ b/tests/test_playbooks/fixtures/host-24.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":13,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,18 +126,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/13 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":3,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":4,"architecture_name":"superARCH","operatingsystem_id":2,"operatingsystem_name":"TestOS 7.6","subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":6,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:27 UTC","updated_at":"2021-09-07 12:50:27 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":13,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:06 UTC","updated_at":"2021-08-27 12:26:06 UTC","managed":true,"identifier":null,"id":6,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:27 UTC","updated_at":"2021-09-07 12:50:27 UTC","managed":true,"identifier":null,"id":13,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -174,7 +174,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2753' + - '2755' status: code: 200 message: OK @@ -196,8 +196,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"superARCH\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"created_at\"\ - :\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27 12:25:42 UTC\",\"\ - name\":\"superARCH\",\"id\":3}]\n}\n" + :\"2021-09-07 12:50:01 UTC\",\"updated_at\":\"2021-09-07 12:50:01 UTC\",\"\ + name\":\"superARCH\",\"id\":4}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -376,8 +376,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -437,8 +437,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-25.yml b/tests/test_playbooks/fixtures/host-25.yml index 58bd0680..f33493ba 100644 --- a/tests/test_playbooks/fixtures/host-25.yml +++ b/tests/test_playbooks/fixtures/host-25.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":6,\"name\":\"test-host.example.net\"}]\n}\n" + id\":13,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/6 + uri: https://foreman.example.org/api/hosts/13 response: body: - string: '{"id":6,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:06.786Z","created_at":"2021-08-27T12:26:06.786Z","root_pass":null,"architecture_id":3,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":13,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:27.910Z","created_at":"2021-09-07T12:50:27.910Z","root_pass":null,"architecture_id":4,"operatingsystem_id":2,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '866' + - '867' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-26.yml b/tests/test_playbooks/fixtures/host-26.yml index fa993930..2a748d02 100644 --- a/tests/test_playbooks/fixtures/host-26.yml +++ b/tests/test_playbooks/fixtures/host-26.yml @@ -192,8 +192,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -253,8 +253,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -298,8 +298,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "environment_id": 1, "build": false, + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "environment_id": 1, "build": false, "managed": false}}' headers: Accept: @@ -318,14 +318,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -340,9 +340,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: @@ -441,10 +441,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: POST - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids response: body: - string: '{"host_id":7,"puppetclass_id":38}' + string: '{"host_id":14,"puppetclass_id":38}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -481,7 +481,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '33' + - '34' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-27.yml b/tests/test_playbooks/fixtures/host-27.yml index d9736b6a..084ce059 100644 --- a/tests/test_playbooks/fixtures/host-27.yml +++ b/tests/test_playbooks/fixtures/host-27.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2893' + - '2895' status: code: 200 message: OK @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -316,8 +316,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-28.yml b/tests/test_playbooks/fixtures/host-28.yml index 58d0f8fa..ab490285 100644 --- a/tests/test_playbooks/fixtures/host-28.yml +++ b/tests/test_playbooks/fixtures/host-28.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2893' + - '2895' status: code: 200 message: OK @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -316,8 +316,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -437,10 +437,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: POST - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids response: body: - string: '{"host_id":7,"puppetclass_id":17}' + string: '{"host_id":14,"puppetclass_id":17}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -477,7 +477,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '33' + - '34' status: code: 200 message: OK @@ -495,7 +495,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/38 + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids/38 response: body: string: '[]' diff --git a/tests/test_playbooks/fixtures/host-29.yml b/tests/test_playbooks/fixtures/host-29.yml index 6edf1f67..c0437a1b 100644 --- a/tests/test_playbooks/fixtures/host-29.yml +++ b/tests/test_playbooks/fixtures/host-29.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2897' + - '2899' status: code: 200 message: OK @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -316,8 +316,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-3.yml b/tests/test_playbooks/fixtures/host-3.yml index 05cc8cf3..1653a39a 100644 --- a/tests/test_playbooks/fixtures/host-3.yml +++ b/tests/test_playbooks/fixtures/host-3.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":6,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -321,13 +321,13 @@ interactions: Test\",\"lastname\":\"Userson\",\"mail\":\"test.userson@example.com\",\"admin\"\ :false,\"auth_source_id\":1,\"disabled\":false,\"auth_source_name\":\"Internal\"\ ,\"timezone\":\"Stockholm\",\"locale\":\"sv_SE\",\"last_login_on\":null,\"\ - created_at\":\"2021-08-27 12:25:41 UTC\",\"updated_at\":\"2021-08-27 12:25:41\ - \ UTC\",\"id\":5,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ - ssh_keys\":[],\"default_location\":{\"id\":4,\"name\":\"Test Location\",\"\ - title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":4,\"\ - name\":\"Test Location\"}],\"default_organization\":{\"id\":3,\"name\":\"\ + created_at\":\"2021-09-07 12:49:59 UTC\",\"updated_at\":\"2021-09-07 12:49:59\ + \ UTC\",\"id\":6,\"login\":\"test\",\"description\":\"Dr. Test Userson\",\"\ + ssh_keys\":[],\"default_location\":{\"id\":8,\"name\":\"Test Location\",\"\ + title\":\"Test Location\",\"description\":null},\"locations\":[{\"id\":8,\"\ + name\":\"Test Location\"}],\"default_organization\":{\"id\":7,\"name\":\"\ Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test\ - \ organization\"},\"organizations\":[{\"id\":3,\"name\":\"Test Organization\"\ + \ organization\"},\"organizations\":[{\"id\":7,\"name\":\"Test Organization\"\ }],\"effective_admin\":false}]\n}\n" headers: Cache-Control: diff --git a/tests/test_playbooks/fixtures/host-30.yml b/tests/test_playbooks/fixtures/host-30.yml index b713d952..ab2ca364 100644 --- a/tests/test_playbooks/fixtures/host-30.yml +++ b/tests/test_playbooks/fixtures/host-30.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":17,"name":"prometheus::haproxy_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2897' + - '2899' status: code: 200 message: OK @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -316,8 +316,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -437,10 +437,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: POST - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids response: body: - string: '{"host_id":7,"puppetclass_id":38}' + string: '{"host_id":14,"puppetclass_id":38}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -477,7 +477,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '33' + - '34' status: code: 200 message: OK @@ -495,7 +495,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/17 + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids/17 response: body: string: '[]' diff --git a/tests/test_playbooks/fixtures/host-31.yml b/tests/test_playbooks/fixtures/host-31.yml index d9736b6a..084ce059 100644 --- a/tests/test_playbooks/fixtures/host-31.yml +++ b/tests/test_playbooks/fixtures/host-31.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2893' + - '2895' status: code: 200 message: OK @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -316,8 +316,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-32.yml b/tests/test_playbooks/fixtures/host-32.yml index a7f7029a..9814919f 100644 --- a/tests/test_playbooks/fixtures/host-32.yml +++ b/tests/test_playbooks/fixtures/host-32.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"config_groups":[],"all_puppetclasses":[{"id":38,"name":"prometheus::redis_exporter","module_name":"prometheus"}],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2893' + - '2895' status: code: 200 message: OK @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -314,7 +314,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7/puppetclass_ids/38 + uri: https://foreman.example.org/api/hosts/14/puppetclass_ids/38 response: body: string: '[]' diff --git a/tests/test_playbooks/fixtures/host-33.yml b/tests/test_playbooks/fixtures/host-33.yml index e87f9935..71aad894 100644 --- a/tests/test_playbooks/fixtures/host-33.yml +++ b/tests/test_playbooks/fixtures/host-33.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":7,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":1,"environment_name":"production","last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":14,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:09 UTC","updated_at":"2021-08-27 12:26:09 UTC","managed":true,"identifier":null,"id":7,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:31 UTC","updated_at":"2021-09-07 12:50:31 UTC","managed":true,"identifier":null,"id":14,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2749' + - '2751' status: code: 200 message: OK @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-34.yml b/tests/test_playbooks/fixtures/host-34.yml index d96d0051..b19a505f 100644 --- a/tests/test_playbooks/fixtures/host-34.yml +++ b/tests/test_playbooks/fixtures/host-34.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":7,\"name\":\"test-host.example.net\"}]\n}\n" + id\":14,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/7 + uri: https://foreman.example.org/api/hosts/14 response: body: - string: '{"id":7,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:09.606Z","created_at":"2021-08-27T12:26:09.606Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":1,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":14,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:31.441Z","created_at":"2021-09-07T12:50:31.441Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":1,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '869' + - '870' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-35.yml b/tests/test_playbooks/fixtures/host-35.yml index 37c25c16..36d86bcd 100644 --- a/tests/test_playbooks/fixtures/host-35.yml +++ b/tests/test_playbooks/fixtures/host-35.yml @@ -132,8 +132,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -193,8 +193,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -238,8 +238,8 @@ interactions: code: 200 message: OK - request: - body: '{"location_id": 4, "organization_id": 3, "host": {"name": "test-host.example.net", - "location_id": 4, "organization_id": 3, "build": false, "managed": false}}' + body: '{"location_id": 8, "organization_id": 7, "host": {"name": "test-host.example.net", + "location_id": 8, "organization_id": 7, "build": false, "managed": false}}' headers: Accept: - application/json;version=2 @@ -257,14 +257,14 @@ interactions: uri: https://foreman.example.org/api/hosts response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":15,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -279,9 +279,9 @@ interactions: Foreman_api_version: - '2' Foreman_current_location: - - 4; Test Location + - 8; Test Location Foreman_current_organization: - - 3; Test Organization + - 7; Test Organization Foreman_version: - 2.5.2 Keep-Alive: diff --git a/tests/test_playbooks/fixtures/host-36.yml b/tests/test_playbooks/fixtures/host-36.yml index d9aa96ba..ec2d0ba3 100644 --- a/tests/test_playbooks/fixtures/host-36.yml +++ b/tests/test_playbooks/fixtures/host-36.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":15,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/15 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":15,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2744' + - '2746' status: code: 200 message: OK @@ -196,8 +196,8 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 12:25:35 UTC\",\"updated_at\":\"2021-08-27 12:25:35 UTC\",\"\ - id\":6,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + :\"2021-09-07 12:49:54 UTC\",\"updated_at\":\"2021-09-07 12:49:54 UTC\",\"\ + id\":10,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ ,\"description\":null}]\n}\n" headers: Cache-Control: @@ -235,7 +235,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '414' + - '415' status: code: 200 message: OK @@ -258,8 +258,8 @@ interactions: : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 12:25:33 UTC\",\"updated_at\":\"2021-08-27 12:25:33 UTC\",\"\ - id\":5,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + :\"2021-09-07 12:49:52 UTC\",\"updated_at\":\"2021-09-07 12:49:52 UTC\",\"\ + id\":9,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ \ Secondary\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -302,7 +302,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"location_id": 6, "organization_id": 5}}' + body: '{"host": {"location_id": 10, "organization_id": 9}}' headers: Accept: - application/json;version=2 @@ -311,23 +311,23 @@ interactions: Connection: - keep-alive Content-Length: - - '50' + - '51' Content-Type: - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/15 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization Secondary","location_id":6,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":9,"organization_name":"Test + Organization Secondary","location_id":10,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":15,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -364,7 +364,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2764' + - '2767' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-37.yml b/tests/test_playbooks/fixtures/host-37.yml index 3bd6a7b7..58611ec4 100644 --- a/tests/test_playbooks/fixtures/host-37.yml +++ b/tests/test_playbooks/fixtures/host-37.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":15,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/15 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin - User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:19 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":5,"organization_name":"Test - Organization Secondary","location_id":6,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":8,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_name":"Admin + User","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":9,"organization_name":"Test + Organization Secondary","location_id":10,"location_name":"Test Location Secondary","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":15,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:26:18 UTC","updated_at":"2021-08-27 12:26:18 UTC","managed":true,"identifier":null,"id":8,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:45 UTC","updated_at":"2021-09-07 12:50:45 UTC","managed":true,"identifier":null,"id":15,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -173,7 +173,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '2764' + - '2767' status: code: 200 message: OK @@ -196,8 +196,8 @@ interactions: : 4294967296,\n \"search\": \"title=\\\"Test Location Secondary\\\"\",\n\ \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 12:25:35 UTC\",\"updated_at\":\"2021-08-27 12:25:35 UTC\",\"\ - id\":6,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ + :\"2021-09-07 12:49:54 UTC\",\"updated_at\":\"2021-09-07 12:49:54 UTC\",\"\ + id\":10,\"name\":\"Test Location Secondary\",\"title\":\"Test Location Secondary\"\ ,\"description\":null}]\n}\n" headers: Cache-Control: @@ -235,7 +235,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '414' + - '415' status: code: 200 message: OK @@ -258,8 +258,8 @@ interactions: : 4294967296,\n \"search\": \"name=\\\"Test Organization Secondary\\\"\"\ ,\n \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\"\ : [{\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"created_at\"\ - :\"2021-08-27 12:25:33 UTC\",\"updated_at\":\"2021-08-27 12:25:33 UTC\",\"\ - id\":5,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ + :\"2021-09-07 12:49:52 UTC\",\"updated_at\":\"2021-09-07 12:49:52 UTC\",\"\ + id\":9,\"name\":\"Test Organization Secondary\",\"title\":\"Test Organization\ \ Secondary\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: diff --git a/tests/test_playbooks/fixtures/host-38.yml b/tests/test_playbooks/fixtures/host-38.yml index f413ebd7..9cc1529e 100644 --- a/tests/test_playbooks/fixtures/host-38.yml +++ b/tests/test_playbooks/fixtures/host-38.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":8,\"name\":\"test-host.example.net\"}]\n}\n" + id\":15,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -110,7 +110,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '226' + - '227' status: code: 200 message: OK @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/8 + uri: https://foreman.example.org/api/hosts/15 response: body: - string: '{"id":8,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:26:19.361Z","created_at":"2021-08-27T12:26:18.310Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":5,"location_id":6,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":15,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:47.496Z","created_at":"2021-09-07T12:50:45.921Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":4,"owner_type":"User","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":9,"location_id":10,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -168,7 +168,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '872' + - '874' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/host-4.yml b/tests/test_playbooks/fixtures/host-4.yml index 3cc4a9dc..e35b4828 100644 --- a/tests/test_playbooks/fixtures/host-4.yml +++ b/tests/test_playbooks/fixtures/host-4.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,17 +126,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":5,"owner_name":"Test - Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:47 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":6,"owner_name":"Test + Userson","owner_type":"User","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:07 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -195,8 +195,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -256,8 +256,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -318,8 +318,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27\ - \ 12:25:42 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-09-07 12:50:00 UTC\",\"updated_at\":\"2021-09-07\ + \ 12:50:00 UTC\",\"name\":\"testgroup\",\"id\":2}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -361,7 +361,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"owner_id": 1, "owner_type": "Usergroup"}}' + body: '{"host": {"owner_id": 2, "owner_type": "Usergroup"}}' headers: Accept: - application/json;version=2 @@ -376,16 +376,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:08 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate diff --git a/tests/test_playbooks/fixtures/host-5.yml b/tests/test_playbooks/fixtures/host-5.yml index b1bb6ba8..20fed9b4 100644 --- a/tests/test_playbooks/fixtures/host-5.yml +++ b/tests/test_playbooks/fixtures/host-5.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,16 +126,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:08 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -194,8 +194,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -255,8 +255,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -317,8 +317,8 @@ interactions: string: "{\n \"total\": 1,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"testgroup\\\"\",\n \"sort\": {\n\ \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"admin\"\ - :false,\"created_at\":\"2021-08-27 12:25:42 UTC\",\"updated_at\":\"2021-08-27\ - \ 12:25:42 UTC\",\"name\":\"testgroup\",\"id\":1}]\n}\n" + :false,\"created_at\":\"2021-09-07 12:50:00 UTC\",\"updated_at\":\"2021-09-07\ + \ 12:50:00 UTC\",\"name\":\"testgroup\",\"id\":2}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate diff --git a/tests/test_playbooks/fixtures/host-6.yml b/tests/test_playbooks/fixtures/host-6.yml index f4c7840e..3f90153b 100644 --- a/tests/test_playbooks/fixtures/host-6.yml +++ b/tests/test_playbooks/fixtures/host-6.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,16 +126,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:08 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:46 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":null,"subnet_name":null,"subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:05 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":null,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -196,9 +196,9 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"network\"\ :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ - :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ - \ 12:25:38 UTC\",\"updated_at\":\"2021-08-27 12:25:38 UTC\",\"ipam\":\"DHCP\"\ - ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ + :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-09-07\ + \ 12:49:56 UTC\",\"updated_at\":\"2021-09-07 12:49:56 UTC\",\"ipam\":\"DHCP\"\ + ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":2,\"name\":\"Test subnet4\"\ ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ :null,\"httpboot_name\":null,\"externalipam_id\":null,\"externalipam_name\"\ @@ -263,8 +263,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -324,8 +324,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: @@ -369,7 +369,7 @@ interactions: code: 200 message: OK - request: - body: '{"host": {"subnet_id": 1}}' + body: '{"host": {"subnet_id": 2}}' headers: Accept: - application/json;version=2 @@ -384,18 +384,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":2,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:08 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:51 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":2,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:10 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate diff --git a/tests/test_playbooks/fixtures/host-7.yml b/tests/test_playbooks/fixtures/host-7.yml index a514e7a3..3e508da1 100644 --- a/tests/test_playbooks/fixtures/host-7.yml +++ b/tests/test_playbooks/fixtures/host-7.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -126,18 +126,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":2,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":1,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:49 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":3,"organization_name":"Test - Organization","location_id":4,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":2,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 + string: '{"ip":null,"ip6":null,"environment_id":null,"environment_name":null,"last_report":null,"mac":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":3,"domain_name":"example.net","architecture_id":null,"architecture_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"subnet_id":2,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_name":"testgroup","owner_type":"Usergroup","enabled":true,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"test-host.example.net","image_id":null,"image_name":null,"created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:08 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","uptime_seconds":null,"organization_id":7,"organization_name":"Test + Organization","location_id":8,"location_name":"Test Location","puppet_status":0,"model_name":null,"name":"test-host.example.net","id":9,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":null,"hostgroup_title":null,"parameters":[],"all_parameters":[{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":2,"name":"host_registration_remote_execution","parameter_type":"boolean","value":true},{"priority":0,"created_at":"2021-08-27 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":1,"name":"host_registration_insights","parameter_type":"boolean","value":false},{"priority":0,"created_at":"2021-08-27 - 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":1,"subnet_name":"Test - subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":2,"domain_name":"example.net","created_at":"2021-08-27 - 12:25:46 UTC","updated_at":"2021-08-27 12:25:51 UTC","managed":true,"identifier":null,"id":2,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' + 12:19:24 UTC","updated_at":"2021-08-27 12:19:24 UTC","id":3,"name":"host_packages","parameter_type":"string","value":""}],"interfaces":[{"subnet_id":2,"subnet_name":"Test + subnet4","subnet6_id":null,"subnet6_name":null,"domain_id":3,"domain_name":"example.net","created_at":"2021-09-07 + 12:50:05 UTC","updated_at":"2021-09-07 12:50:10 UTC","managed":true,"identifier":null,"id":9,"name":"test-host.example.net","ip":null,"ip6":null,"mac":null,"mtu":1500,"fqdn":"test-host.example.net","primary":true,"provision":true,"type":"interface","virtual":false}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"forget_status_hosts":true}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -198,9 +198,9 @@ interactions: \ \"by\": null,\n \"order\": null\n },\n \"results\": [{\"network\"\ :\"192.168.200.0\",\"network_type\":\"IPv4\",\"cidr\":27,\"mask\":\"255.255.255.224\"\ ,\"priority\":null,\"vlanid\":null,\"mtu\":1500,\"gateway\":null,\"dns_primary\"\ - :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-08-27\ - \ 12:25:38 UTC\",\"updated_at\":\"2021-08-27 12:25:38 UTC\",\"ipam\":\"DHCP\"\ - ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":1,\"name\":\"Test subnet4\"\ + :null,\"dns_secondary\":null,\"from\":null,\"to\":null,\"created_at\":\"2021-09-07\ + \ 12:49:56 UTC\",\"updated_at\":\"2021-09-07 12:49:56 UTC\",\"ipam\":\"DHCP\"\ + ,\"boot_mode\":\"DHCP\",\"nic_delay\":null,\"id\":2,\"name\":\"Test subnet4\"\ ,\"description\":null,\"network_address\":\"192.168.200.0/27\",\"dhcp_id\"\ :null,\"dhcp_name\":null,\"tftp_id\":null,\"tftp_name\":null,\"httpboot_id\"\ :null,\"httpboot_name\":null,\"externalipam_id\":null,\"externalipam_name\"\ @@ -265,8 +265,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"title=\\\"Test Location\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:32 UTC\",\"updated_at\":\"2021-08-27 12:25:32 UTC\",\"id\":4,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:50 UTC\",\"updated_at\":\"2021-09-07 12:49:50 UTC\",\"id\":8,\"name\"\ :\"Test Location\",\"title\":\"Test Location\",\"description\":null}]\n}\n" headers: Cache-Control: @@ -326,8 +326,8 @@ interactions: string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"ancestry\"\ - :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-08-27\ - \ 12:25:30 UTC\",\"updated_at\":\"2021-08-27 12:25:30 UTC\",\"id\":3,\"name\"\ + :null,\"parent_id\":null,\"parent_name\":null,\"created_at\":\"2021-09-07\ + \ 12:49:48 UTC\",\"updated_at\":\"2021-09-07 12:49:48 UTC\",\"id\":7,\"name\"\ :\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"\ A test organization\"}]\n}\n" headers: diff --git a/tests/test_playbooks/fixtures/host-8.yml b/tests/test_playbooks/fixtures/host-8.yml index 13367064..a6e8b7d0 100644 --- a/tests/test_playbooks/fixtures/host-8.yml +++ b/tests/test_playbooks/fixtures/host-8.yml @@ -73,7 +73,7 @@ interactions: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ : 4294967296,\n \"search\": \"name=\\\"test-host.example.net\\\"\",\n \"\ sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"\ - id\":2,\"name\":\"test-host.example.net\"}]\n}\n" + id\":9,\"name\":\"test-host.example.net\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate @@ -128,10 +128,10 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/api/hosts/2 + uri: https://foreman.example.org/api/hosts/9 response: body: - string: '{"id":2,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-08-27T12:25:49.854Z","created_at":"2021-08-27T12:25:46.052Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":1,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":3,"location_id":4,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' + string: '{"id":9,"name":"test-host.example.net","last_compile":null,"last_report":null,"updated_at":"2021-09-07T12:50:08.992Z","created_at":"2021-09-07T12:50:05.113Z","root_pass":null,"architecture_id":null,"operatingsystem_id":null,"environment_id":null,"ptable_id":null,"medium_id":null,"build":false,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":null,"owner_id":2,"owner_type":"Usergroup","enabled":true,"puppet_ca_proxy_id":null,"managed":false,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"puppet_proxy_id":null,"certname":"test-host.example.net","image_id":null,"organization_id":7,"location_id":8,"otp":null,"realm_id":null,"compute_profile_id":null,"provision_method":"build","grub_pass":"","global_status":0,"lookup_value_matcher":"fqdn=test-host.example.net","pxe_loader":null,"initiated_at":null,"build_errors":null}' headers: Cache-Control: - max-age=0, private, must-revalidate diff --git a/tests/test_playbooks/host.yml b/tests/test_playbooks/host.yml index 9050e999..0a932219 100644 --- a/tests/test_playbooks/host.yml +++ b/tests/test_playbooks/host.yml @@ -415,7 +415,7 @@ - "prometheus::haproxy_exporter" expected_change: false - - name: create host with puppetclasses + - name: update host with puppetclasses and description include_tasks: tasks/host.yml vars: host_name: "test-host.{{ host.domain }}" @@ -423,12 +423,13 @@ host_location: "{{ host.location }}" host_managed: false host_build: false + host_description: nice host host_environment: production host_puppetclasses: - "prometheus::redis_exporter" expected_change: true - - name: create host with puppetclasses again, no change + - name: update host with puppetclasses and description again, no change include_tasks: tasks/host.yml vars: host_name: "test-host.{{ host.domain }}" @@ -436,6 +437,7 @@ host_location: "{{ host.location }}" host_managed: false host_build: false + host_description: nice host host_environment: production host_puppetclasses: - "prometheus::redis_exporter" From bf625c71fb8bf708f0aafc5e82accec4a4ca9243 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Sep 2021 14:54:32 +0200 Subject: [PATCH 12/36] add changelog entry --- .../fragments/1231-puppetclasses-and-description-update.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/1231-puppetclasses-and-description-update.yml diff --git a/changelogs/fragments/1231-puppetclasses-and-description-update.yml b/changelogs/fragments/1231-puppetclasses-and-description-update.yml new file mode 100644 index 00000000..9c6e4a81 --- /dev/null +++ b/changelogs/fragments/1231-puppetclasses-and-description-update.yml @@ -0,0 +1,2 @@ +bugfixes: + - host, hostgroup - fix updating puppetclasses while also updating description (or other string-like attributes) (https://github.com/theforeman/foreman-ansible-modules/issues/1231) From 5296a4abe1c802c4e6f4553e3aa571818d34e156 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 21 Sep 2021 15:46:54 +0200 Subject: [PATCH 13/36] fix dev requirements pip doesn't like multiple mentions of the same thing --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a534c90e..0f41b235 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,4 +14,4 @@ cryptography<3.1; python_version < '3.6' -r requirements-lint.txt -r requirements.txt pylint==2.6.0; python_version >= '3.6' --r https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt +voluptuous==0.12.1 # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt From a3cc0367a5672899854a2dcdbcd66ad34967b0d2 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 21 Sep 2021 16:01:17 +0200 Subject: [PATCH 14/36] make pylint unnecessary-dict-index-lookup happy --- plugins/callback/foreman.py | 2 +- plugins/module_utils/foreman_helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index 3a102196..2110c22f 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -242,7 +242,7 @@ def send_facts(self): facts = { "name": host, "facts": { - "ansible_facts": self.facts[host], + "ansible_facts": facts, "_type": "ansible", "_timestamp": get_now(), }, diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index bba4e265..f7f0fcc7 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -931,7 +931,7 @@ def auto_lookup_entities(self): def auto_lookup_nested_entities(self): for key, entity_spec in self.foreman_spec.items(): if entity_spec.get('type') in {'nested_list'}: - for nested_key, nested_spec in self.foreman_spec[key]['foreman_spec'].items(): + for nested_key, nested_spec in entity_spec['foreman_spec'].items(): for item in self.foreman_params.get(key, []): if (nested_key in item and nested_spec.get('resolve', True) and not _is_resolved(nested_spec, item[nested_key])): From e09b10032f2403a2c05b7ff4a73fc800c7f107e0 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 21 Sep 2021 16:18:49 +0200 Subject: [PATCH 15/36] don't run devel on older than 3.8 it yields annoying warnings, and I really don't care --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 712b244f..403a7a1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: - python: "2.7" ansible: "stable-2.10" - python: "2.7" - ansible: "stable-2.11" + ansible: "devel" - python: "3.6" ansible: "stable-2.8" - python: "3.6" @@ -41,7 +41,9 @@ jobs: - python: "3.6" ansible: "stable-2.10" - python: "3.6" - ansible: "stable-2.11" + ansible: "devel" + - python: "3.7" + ansible: "devel" - python: "3.8" ansible: "stable-2.8" - python: "3.8" From 2ca2a683ac254521e85977c8a05e11474ee3a483 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 25 Sep 2021 10:04:04 +0200 Subject: [PATCH 16/36] add ansible 2.12 to CI also re-work how we define the matrix, making it much easier to understand. the new logic is: test *all* Ansible branches on Python 3.8 and additionally test Ansible 2.11 on Python 2.7, 3.6, and 3.8 and Ansible devel on Python 3.9, which results in almost the same list as before, but with a much shorter definition --- .github/workflows/main.yml | 43 +++++++------------------------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 403a7a1a..df229631 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,52 +14,23 @@ jobs: fail-fast: false matrix: python: - - "2.7" - - "3.6" - - "3.7" - "3.8" - - "3.9" ansible: - stable-2.8 - stable-2.9 - stable-2.10 - stable-2.11 + - stable-2.12 - devel - exclude: + include: - python: "2.7" - ansible: "stable-2.8" - - python: "2.7" - ansible: "stable-2.9" - - python: "2.7" - ansible: "stable-2.10" - - python: "2.7" - ansible: "devel" - - python: "3.6" - ansible: "stable-2.8" - - python: "3.6" - ansible: "stable-2.9" - - python: "3.6" - ansible: "stable-2.10" + ansible: "stable-2.11" - python: "3.6" - ansible: "devel" + ansible: "stable-2.11" - python: "3.7" - ansible: "devel" - - python: "3.8" - ansible: "stable-2.8" - - python: "3.8" - ansible: "stable-2.9" - - python: "3.8" - ansible: "stable-2.10" - - python: "3.8" ansible: "stable-2.11" - python: "3.9" - ansible: "stable-2.8" - - python: "3.9" - ansible: "stable-2.9" - - python: "3.9" - ansible: "stable-2.10" - - python: "3.9" - ansible: "stable-2.11" + ansible: "devel" steps: - uses: actions/checkout@v2 - name: Set up Python @@ -88,7 +59,7 @@ jobs: run: sudo mkdir -p /etc/rhsm/ca/ && sudo touch /etc/rhsm/ca/redhat-uep.pem - name: Install required collections for ansible-base (2.10+) run: ansible-galaxy collection install community.docker - if: matrix.ansible == 'devel' || matrix.ansible == 'stable-2.10' || matrix.ansible == 'stable-2.11' + if: matrix.ansible != 'stable-2.8' && matrix.ansible != 'stable-2.9' - name: Run crud tests run: make test-crud - name: Run other tests @@ -97,7 +68,7 @@ jobs: run: make dist-test - name: Run sanity tests run: make SANITY_OPTS="--local" sanity - if: matrix.ansible == 'devel' || matrix.ansible == 'stable-2.10' || matrix.stable == 'stable-2.11' + if: matrix.ansible != 'stable-2.8' && matrix.ansible != 'stable-2.9' checkmode: runs-on: ubuntu-latest From 994d30b65a16b1a6760f1b8157477bc0d375a2ed Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 25 Sep 2021 10:43:55 +0200 Subject: [PATCH 17/36] run all other workflows on python 3.8 too --- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 24399a01..a2fb1106 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: Install dependencies run: make doc-setup - name: Build docs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df229631..4d41d070 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,7 +77,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: Restore pip cache uses: actions/cache@v2.1.6 with: @@ -99,7 +99,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: Restore pip cache uses: actions/cache@v2.1.6 with: @@ -124,7 +124,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: Restore pip cache uses: actions/cache@v2.1.6 with: From 923f0ad13af8c887400113e6f9d98dd00701c980 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Sep 2021 11:24:44 +0200 Subject: [PATCH 18/36] add arch parameter to repository module Fixes: #1265 --- changelogs/fragments/1265-repository-arch.yml | 2 ++ plugins/modules/repository.py | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 changelogs/fragments/1265-repository-arch.yml diff --git a/changelogs/fragments/1265-repository-arch.yml b/changelogs/fragments/1265-repository-arch.yml new file mode 100644 index 00000000..6cce8ad8 --- /dev/null +++ b/changelogs/fragments/1265-repository-arch.yml @@ -0,0 +1,2 @@ +minor_changes: + - repository - add ``arch`` parameter to limit architectures of the repository (https://github.com/theforeman/foreman-ansible-modules/issues/1265) diff --git a/plugins/modules/repository.py b/plugins/modules/repository.py index 28da14a1..f43acfb3 100644 --- a/plugins/modules/repository.py +++ b/plugins/modules/repository.py @@ -215,6 +215,12 @@ - rhel-6 - rhel-7 - rhel-8 + arch: + description: + - Architecture of content in the repository + - Set to C(noarch) to disable the architecture restriction again. + type: str + required: false extends_documentation_fragment: - theforeman.foreman.foreman - theforeman.foreman.foreman.entity_state_with_defaults @@ -305,6 +311,7 @@ def main(): ansible_collection_requirements=dict(), auto_enabled=dict(type='bool'), os_versions=dict(type='list', elements='str', choices=['rhel-6', 'rhel-7', 'rhel-8']), + arch=dict(), ), argument_spec=dict( state=dict(default='present', choices=['present_with_defaults', 'present', 'absent']), From 83ff30943dd1f00da498c4f63d128bb86c1c39c3 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Wed, 29 Sep 2021 12:28:53 +0200 Subject: [PATCH 19/36] Organization info module --- plugins/modules/organization_info.py | 83 +++++ tests/fixtures/apidoc/organization_info.json | 1 + .../fixtures/organization_info-0.yml | 289 ++++++++++++++++++ .../fixtures/organization_info-1.yml | 114 +++++++ tests/test_playbooks/organization_info.yml | 46 +++ 5 files changed, 533 insertions(+) create mode 100644 plugins/modules/organization_info.py create mode 120000 tests/fixtures/apidoc/organization_info.json create mode 100644 tests/test_playbooks/fixtures/organization_info-0.yml create mode 100644 tests/test_playbooks/fixtures/organization_info-1.yml create mode 100644 tests/test_playbooks/organization_info.yml diff --git a/plugins/modules/organization_info.py b/plugins/modules/organization_info.py new file mode 100644 index 00000000..f9621445 --- /dev/null +++ b/plugins/modules/organization_info.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# (c) 2021 Stejskal Leos (Red Hat) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + + +DOCUMENTATION = ''' +--- +module: organization_info +version_added: 2.3.0 +short_description: Get information about organization(s) +description: + - Get information about organization(s) +author: + - "Stejskal Leos (@lstejska)" + +extends_documentation_fragment: + - theforeman.foreman.foreman + - theforeman.foreman.foreman.infomodule +''' + +EXAMPLES = ''' +- name: "Show a organization" + theforeman.foreman.organization_info: + username: "admin" + password: "changeme" + server_url: "https://foreman.example.com" + name: "Default Organization" + +- name: "Show all organizations with 'name ~ Default'" + theforeman.foreman.organization_info: + username: "admin" + password: "changeme" + server_url: "https://foreman.example.com" + search: "name ~ Default" +''' + +RETURN = ''' +organization: + description: Details about the found organization + returned: success and I(name) was passed + type: dict +organizations: + description: List of all found organizations and their details + returned: success and I(search) was passed + type: list + elements: dict +''' + + +from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import ( + ForemanInfoAnsibleModule, +) + + +class ForemanOrganizationInfo(ForemanInfoAnsibleModule): + pass + + +def main(): + module = ForemanOrganizationInfo() + + with module.api_connection(): + module.run() + + +if __name__ == '__main__': + main() diff --git a/tests/fixtures/apidoc/organization_info.json b/tests/fixtures/apidoc/organization_info.json new file mode 120000 index 00000000..8e89899a --- /dev/null +++ b/tests/fixtures/apidoc/organization_info.json @@ -0,0 +1 @@ +katello.json \ No newline at end of file diff --git a/tests/test_playbooks/fixtures/organization_info-0.yml b/tests/test_playbooks/fixtures/organization_info-0.yml new file mode 100644 index 00000000..502336c4 --- /dev/null +++ b/tests/test_playbooks/fixtures/organization_info-0.yml @@ -0,0 +1,289 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-09-27 + 12:22:17 UTC\",\"updated_at\":\"2021-09-27 12:22:21 UTC\",\"id\":5,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/5 + response: + body: + string: '{"label":"Test_Organization","redhat_repository_url":"https://cdn.redhat.com","system_purposes":{"addons":[],"roles":[],"usage":[],"support_level":[],"support_type":[]},"service_levels":[],"service_level":null,"select_all_types":[],"description":"A + test organization","created_at":"2021-09-27 12:22:17 UTC","updated_at":"2021-09-27 + 12:22:21 UTC","ancestry":null,"parent_id":null,"parent_name":null,"id":5,"name":"Test + Organization","title":"Test Organization","users":[],"smart_proxies":[{"name":"centos7-katello-devel-stable.example.com","id":1,"url":"https://centos7-katello-devel-stable.example.com:9090","inherited":false}],"subnets":[],"compute_resources":[],"media":[],"ptables":[{"description":null,"os_family":"Suse","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"AutoYaST entire + SCSI disk","id":111,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"AutoYaST entire + virtual disk","id":112,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"AutoYaST LVM","id":113,"inherited":false},{"description":null,"os_family":"Coreos","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"CoreOS default + fake","id":114,"inherited":false},{"description":null,"os_family":"Rancheros","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Empty","id":115,"inherited":false},{"description":null,"os_family":"Freebsd","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"FreeBSD default + fake","id":116,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Jumpstart default","id":117,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Jumpstart mirrored","id":118,"inherited":false},{"description":null,"os_family":"Junos","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Junos default + fake","id":119,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Kickstart custom","id":120,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Kickstart default","id":121,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Kickstart default + thin","id":122,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Kickstart dynamic","id":123,"inherited":false},{"description":null,"os_family":"NXOS","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"NX-OS default + fake","id":124,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Preseed default","id":125,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Preseed default + LVM","id":126,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Windows default + GPT EFI partition table","id":128,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"Windows default + partition table","id":127,"inherited":false},{"description":null,"os_family":"Xenserver","created_at":"2021-09-14 + 23:40:12 UTC","updated_at":"2021-09-14 23:40:12 UTC","name":"XenServer default","id":129,"inherited":false}],"provisioning_templates":[{"id":44,"name":"Alterator + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":28,"name":"Alterator + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":10,"name":"Alterator + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":61,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":62,"name":"ansible_provisioning_callback","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":63,"name":"ansible_tower_callback_script","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":64,"name":"ansible_tower_callback_service","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":45,"name":"Atomic + Kickstart default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":46,"name":"AutoYaST + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":37,"name":"AutoYaST + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":11,"name":"AutoYaST + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":106,"name":"AutoYaST + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":47,"name":"AutoYaST + SLES default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":65,"name":"blacklist_kernel_modules","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":66,"name":"bmc_nic_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":67,"name":"built","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":68,"name":"chef_client","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":27,"name":"CloudInit + default","template_kind_id":12,"template_kind_name":"cloud-init","inherited":false},{"id":162,"name":"Content + Proxy TODO","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":69,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":48,"name":"CoreOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":12,"name":"CoreOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":70,"name":"create_users","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":71,"name":"csr_attributes.yaml","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":72,"name":"efibootmgr_netboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":73,"name":"eject_cdrom","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":74,"name":"epel","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":75,"name":"fips_packages","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":76,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":29,"name":"FreeBSD + (mfsBSD) finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":49,"name":"FreeBSD + (mfsBSD) provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":13,"name":"FreeBSD + (mfsBSD) PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":77,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":58,"name":"Global + Registration","template_kind_id":13,"template_kind_name":"registration","inherited":false},{"id":161,"name":"Global + Registration clone","template_kind_id":13,"template_kind_name":"registration","inherited":false},{"id":59,"name":"Grubby + default","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":78,"name":"http_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":79,"name":"insights","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":38,"name":"iPXE + default local boot","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":39,"name":"iPXE + global default","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":40,"name":"iPXE + intermediate script","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":50,"name":"Jumpstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":30,"name":"Jumpstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":2,"name":"Jumpstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":31,"name":"Junos + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":51,"name":"Junos + default SLAX","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":26,"name":"Junos + default ZTP config","template_kind_id":10,"template_kind_name":"ZTP","inherited":false},{"id":52,"name":"Kickstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":32,"name":"Kickstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":41,"name":"Kickstart + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":3,"name":"Kickstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":6,"name":"Kickstart + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":14,"name":"Kickstart + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":107,"name":"Kickstart + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":81,"name":"kickstart_ifcfg_bonded_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":80,"name":"kickstart_ifcfg_bond_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":82,"name":"kickstart_ifcfg_generic_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":83,"name":"kickstart_ifcfg_get_identifier_names","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":84,"name":"kickstart_kernel_options","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":85,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":53,"name":"Kickstart + oVirt-RHVH","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":15,"name":"Kickstart + oVirt-RHVH PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":36,"name":"Linux + host_init_config default","template_kind_id":1,"template_kind_name":"host_init_config","inherited":false},{"id":86,"name":"ntp","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":1,"name":"NX-OS + default POAP setup","template_kind_id":11,"template_kind_name":"POAP","inherited":false},{"id":54,"name":"Preseed + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":33,"name":"Preseed + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":42,"name":"Preseed + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":7,"name":"Preseed + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":16,"name":"Preseed + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":108,"name":"Preseed + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":87,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":88,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":90,"name":"puppetlabs_repo","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":89,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":91,"name":"pxegrub2_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":8,"name":"PXEGrub2 + default local boot","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":92,"name":"pxegrub2_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":9,"name":"PXEGrub2 + global default","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":93,"name":"pxegrub2_mac","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":94,"name":"pxegrub_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":4,"name":"PXEGrub + default local boot","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":95,"name":"pxegrub_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":5,"name":"PXEGrub + global default","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":17,"name":"PXELinux + chain iPXE","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":18,"name":"PXELinux + chain iPXE UNDI","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":96,"name":"pxelinux_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":19,"name":"PXELinux + default local boot","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":20,"name":"PXELinux + default memdisk","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":97,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":21,"name":"PXELinux + global default","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":98,"name":"rancheros_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":55,"name":"RancherOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":22,"name":"RancherOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":99,"name":"redhat_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":100,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":101,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":102,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":103,"name":"schedule_reboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":109,"name":"UserData + default","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":110,"name":"UserData + open-vm-tools","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":23,"name":"WAIK + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":34,"name":"Windows + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":43,"name":"Windows + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":56,"name":"Windows + default provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":24,"name":"Windows + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":104,"name":"Windows + network","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":60,"name":"Windows + peSetup.cmd","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":57,"name":"XenServer + default answerfile","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":35,"name":"XenServer + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":25,"name":"XenServer + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":105,"name":"yum_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false}],"domains":[],"realms":[],"hostgroups":[],"locations":[{"id":2,"name":"Default + Location","title":"Default Location","description":null}],"hosts_count":0,"parameters":[],"deprecations":{"environments":"Environments + got deprecated from this endpoint."},"simple_content_access":false,"owner_details":{"id":"ff8080817c26839d017c2734ba640009","key":"Test_Organization","created":"2021-09-27T12:22:19+0000","updated":"2021-09-27T12:22:19+0000","lastRefreshed":null,"virt_who":false,"upstreamConsumer":null},"default_content_view_id":4,"library_id":4}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])\nCall stack\n /home/vagrant/foreman/app/models/concerns/has_many_common.rb:96:in + `block in belongs_to_name_for''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:61:in + `show''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])"]' + content-length: + - '16937' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/organization_info-1.yml b/tests/test_playbooks/fixtures/organization_info-1.yml new file mode 100644 index 00000000..5501f445 --- /dev/null +++ b/tests/test_playbooks/fixtures/organization_info-1.yml @@ -0,0 +1,114 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name+~+Test&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name ~ Test\",\n \"sort\": {\n \"by\": null,\n + \ \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-09-27 + 12:22:17 UTC\",\"updated_at\":\"2021-09-27 12:22:21 UTC\",\"id\":5,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '373' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/organization_info.yml b/tests/test_playbooks/organization_info.yml new file mode 100644 index 00000000..dcbc5992 --- /dev/null +++ b/tests/test_playbooks/organization_info.yml @@ -0,0 +1,46 @@ +--- +- hosts: localhost + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - include: tasks/organization.yml + vars: + organization_state: present + +- hosts: tests + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - name: fetch organization info + organization_info: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + name: "Test Organization" + register: organization_info + - name: check organization details + assert: + that: + - organization_info['organization']['name'] == "Test Organization" + - "'parent_name' in organization_info['organization']" + + - name: search organization info + organization_info: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + search: "name ~ Test" + register: organization_info + - name: check organization details + assert: + that: + - organization_info['organizations'][0]['name'] == "Test Organization" + - "'parent_name' not in organization_info['organizations'][0]" From db9b4a5e61e0f0c54c8e994f91fee0586aee3bd5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 30 Sep 2021 13:55:54 +0200 Subject: [PATCH 20/36] enable certificate validation by default for the inventory --- changelogs/fragments/validate-inventory-certs.yml | 2 ++ plugins/inventory/foreman.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/validate-inventory-certs.yml diff --git a/changelogs/fragments/validate-inventory-certs.yml b/changelogs/fragments/validate-inventory-certs.yml new file mode 100644 index 00000000..e8b2920f --- /dev/null +++ b/changelogs/fragments/validate-inventory-certs.yml @@ -0,0 +1,2 @@ +minor_changes: + - inventory plugin - enable certificate validation by default diff --git a/plugins/inventory/foreman.py b/plugins/inventory/foreman.py index b7782ebc..770fb326 100644 --- a/plugins/inventory/foreman.py +++ b/plugins/inventory/foreman.py @@ -51,7 +51,7 @@ description: - Whether or not to verify the TLS certificates of the Foreman server. type: boolean - default: False + default: True env: - name: FOREMAN_VALIDATE_CERTS group_prefix: From eeae3e11e98231f74ea34b29b49295c41e6b96b9 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 5 Oct 2021 08:27:05 +0200 Subject: [PATCH 21/36] add python 3.10 to CI matrix --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d41d070..a726126a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,8 @@ jobs: ansible: "stable-2.11" - python: "3.9" ansible: "devel" + - python: "3.10" + ansible: "devel" steps: - uses: actions/checkout@v2 - name: Set up Python From de558af247ed9669d7994f584a96c7345e7225c3 Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Fri, 4 Jun 2021 13:58:04 +0200 Subject: [PATCH 22/36] Host Report Format Introduces new Host Reports format which is similar to the original one, but slightly simplified. Root key is removed, logs hash is sent as an array and few keys dropped as it is no longer needed to simulate Puppet report anymore. --- plugins/callback/foreman.py | 130 ++++- .../dir_store/{ => foreman}/testhost.json | 0 .../dir_store/{ => foreman}/testhostA.json | 0 .../dir_store/{ => foreman}/testhostB.json | 0 .../callback/dir_store/proxy/testhost.json | 444 ++++++++++++++++++ .../callback/dir_store/proxy/testhostA.json | 137 ++++++ .../callback/dir_store/proxy/testhostB.json | 137 ++++++ tests/test_callback.py | 51 +- 8 files changed, 869 insertions(+), 30 deletions(-) rename tests/fixtures/callback/dir_store/{ => foreman}/testhost.json (100%) rename tests/fixtures/callback/dir_store/{ => foreman}/testhostA.json (100%) rename tests/fixtures/callback/dir_store/{ => foreman}/testhostB.json (100%) create mode 100644 tests/fixtures/callback/dir_store/proxy/testhost.json create mode 100644 tests/fixtures/callback/dir_store/proxy/testhostA.json create mode 100644 tests/fixtures/callback/dir_store/proxy/testhostB.json diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index 2110c22f..f20951d9 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -19,6 +19,15 @@ - whitelisting in configuration - requests (python library) options: + report_type: + description: + - "endpoint type for reports: foreman or proxy" + env: + - name: FOREMAN_REPORT_TYPE + default: foreman + ini: + - section: callback_foreman + key: report_type url: description: - URL of the Foreman server. @@ -31,6 +40,14 @@ ini: - section: callback_foreman key: url + proxy_url: + description: + - URL of the Foreman Smart Proxy server. + env: + - name: FOREMAN_PROXY_URL + ini: + - section: callback_foreman + key: proxy_url client_cert: description: - X509 certificate to authenticate to Foreman if https is used @@ -106,15 +123,19 @@ from ansible.plugins.callback import CallbackBase -def build_log(data): +def build_log_foreman(data_list): """ Transform the internal log structure to one accepted by Foreman's config_report API. """ - for source, msg in data: - if msg.get('failed'): + for data in data_list: + result = data.pop('result') + task = data.pop('task') + result['failed'] = data.get('failed') + result['module'] = task.get('action') + if data.get('failed'): level = 'err' - elif msg.get('changed'): + elif result.get('changed'): level = 'notice' else: level = 'info' @@ -122,10 +143,10 @@ def build_log(data): yield { "log": { 'sources': { - 'source': source, + 'source': task.get('name'), }, 'messages': { - 'message': json.dumps(msg, sort_keys=True), + 'message': json.dumps(result, sort_keys=True), }, 'level': level, } @@ -169,7 +190,9 @@ def set_options(self, task_keys=None, var_options=None, direct=None): if self.get_option('disable_callback'): self._disable_plugin('Callback disabled by environment.') + self.report_type = self.get_option('report_type') self.foreman_url = self.get_option('url') + self.proxy_url = self.get_option('proxy_url') ssl_cert = self.get_option('client_cert') ssl_key = self.get_option('client_key') self.dir_store = self.get_option('dir_store') @@ -178,7 +201,6 @@ def set_options(self, task_keys=None, var_options=None, direct=None): self._disable_plugin(u'The `requests` python module is not installed') self.session = requests.Session() - if self.foreman_url.startswith('https://'): if not os.path.exists(ssl_cert): self._disable_plugin(u'FOREMAN_SSL_CERT %s not found.' % ssl_cert) @@ -210,13 +232,15 @@ def _ssl_verify(self, option): return verify - def _send_data(self, endpoint, host, data): - if endpoint == 'facts': + def _send_data(self, data_type, report_type, host, data): + if data_type == 'facts': url = self.foreman_url + '/api/v2/hosts/facts' - elif endpoint == 'report': + elif data_type == 'report' and report_type == 'foreman': url = self.foreman_url + '/api/v2/config_reports' + elif data_type == 'report' and report_type == 'proxy': + url = self.proxy_url + '/host_reports/ansible' else: - self._display.warning(u'Unknown endpoint type: {type}'.format(type=endpoint)) + self._display.warning(u'Unknown report_type: {rt}'.format(rt=report_type)) if len(self.dir_store) > 0: filename = u'{host}.json'.format(host=to_text(host)) @@ -248,12 +272,43 @@ def send_facts(self): }, } - self._send_data('facts', host, facts) + self._send_data('facts', 'foreman', host, facts) - def send_reports(self, stats): + def send_reports_proxy_host_report(self, stats): + """ + Send reports to Foreman Smart Proxy running Host Reports + plugin. The format is native Ansible report without any + changes. + """ + for host in stats.processed.keys(): + total = stats.summarize(host) + report = { + "host": host, + "reported_at": get_now(), + "metrics": { + "time": { + "total": int(get_time() - self.start_time) + } + }, + "status": { + "applied": total['changed'], + "failed": total['failures'] + total['unreachable'], + "skipped": total['skipped'], + }, + "results": self.items[host], + "check_mode": self.check_mode, + } + if self.check_mode: + report['status']['pending'] = total['changed'] + report['status']['applied'] = 0 + + self._send_data('report', 'proxy', host, report) + self.items[host] = [] + + def send_reports_foreman(self, stats): """ Send reports to Foreman to be parsed by its config report - importer. THe data is in a format that Foreman can handle + importer. The data is in a format that Foreman can handle without writing another report importer. """ for host in stats.processed.keys(): @@ -272,7 +327,7 @@ def send_reports(self, stats): "failed": total['failures'] + total['unreachable'], "skipped": total['skipped'], }, - "logs": list(build_log(self.items[host])), + "logs": list(build_log_foreman(self.items[host])), "reporter": "ansible", "check_mode": self.check_mode, } @@ -281,20 +336,47 @@ def send_reports(self, stats): report['config_report']['status']['pending'] = total['changed'] report['config_report']['status']['applied'] = 0 - self._send_data('report', host, report) - + self._send_data('report', 'foreman', host, report) self.items[host] = [] + def send_reports(self, stats): + if self.report_type == "foreman": + self.send_reports_foreman(stats) + elif self.report_type == "proxy": + self.send_reports_proxy_host_report(stats) + else: + self._display.warning(u'Unknown foreman endpoint type: {type}'.format(type=self.report_type)) + + def drop_nones(self, d): + """Recursively drop Nones or empty dicts/arrays in dict d and return a new dict""" + dd = {} + for k, v in d.items(): + if isinstance(v, dict) and v: + dd[k] = self.drop_nones(v) + elif isinstance(v, list) and len(v) == 1 and v[0] == {}: + pass + elif isinstance(v, (list, set, tuple)) and v: + dd[k] = type(v)(self.drop_nones(vv) if isinstance(vv, dict) else vv + for vv in v) + elif not isinstance(v, (dict, list, set, tuple)) and v is not None: + dd[k] = v + return dd + def append_result(self, result, failed=False): - name = result._task.get_name() - host = result._host.get_name() - value = result._result + result_info = result._result + task_info = result._task.serialize() + task_info['args'] = None + value = {} + value['result'] = result_info + value['task'] = task_info value['failed'] = failed - value['module'] = result._task.action - self.items[host].append((name, value)) + if self.report_type == "proxy": + value = self.drop_nones(value) + host = result._host.get_name() + self.items[host].append(value) self.check_mode = result._task.check_mode - if 'ansible_facts' in value: - self.facts[host].update(value['ansible_facts']) + if 'ansible_facts' in result_info: + self.facts[host].update(result_info['ansible_facts']) # Ansible callback API def v2_runner_on_failed(self, result, ignore_errors=False): diff --git a/tests/fixtures/callback/dir_store/testhost.json b/tests/fixtures/callback/dir_store/foreman/testhost.json similarity index 100% rename from tests/fixtures/callback/dir_store/testhost.json rename to tests/fixtures/callback/dir_store/foreman/testhost.json diff --git a/tests/fixtures/callback/dir_store/testhostA.json b/tests/fixtures/callback/dir_store/foreman/testhostA.json similarity index 100% rename from tests/fixtures/callback/dir_store/testhostA.json rename to tests/fixtures/callback/dir_store/foreman/testhostA.json diff --git a/tests/fixtures/callback/dir_store/testhostB.json b/tests/fixtures/callback/dir_store/foreman/testhostB.json similarity index 100% rename from tests/fixtures/callback/dir_store/testhostB.json rename to tests/fixtures/callback/dir_store/foreman/testhostB.json diff --git a/tests/fixtures/callback/dir_store/proxy/testhost.json b/tests/fixtures/callback/dir_store/proxy/testhost.json new file mode 100644 index 00000000..69fdecd5 --- /dev/null +++ b/tests/fixtures/callback/dir_store/proxy/testhost.json @@ -0,0 +1,444 @@ +{ + "check_mode": false, + "host": "testhost", + "metrics": { + "time": { + "total": 1 + } + }, + "reported_at": "2000-01-01 12:00:00.0000", + "results": [ + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + true + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Changed task", + "notify": [ + "test handlers" + ], + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": false, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + false + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Ok task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": true, + "result": { + "_ansible_no_log": false, + "changed": false + }, + "task": { + "action": "fail", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "ignore_errors": true, + "name": "Failed task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Task with var in name (foo bar)", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "changed": true, + "results": [ + { + "_ansible_item_label": "foo-1", + "_ansible_no_log": false, + "ansible_loop_var": "item", + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "failed": false, + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "item": 1, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + { + "_ansible_item_label": "foo-2", + "_ansible_no_log": false, + "ansible_loop_var": "item", + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "failed": false, + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "item": 2, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + { + "_ansible_item_label": "foo-3", + "_ansible_no_log": false, + "ansible_loop_var": "item", + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "failed": false, + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "item": 3, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + } + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "loop": [ + 1, + 2, + 3 + ], + "loop_control": { + "finalized": false, + "label": "foo-{{ item }}", + "loop_var": "item", + "pause": 0, + "squashed": false + }, + "name": "Loop task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "is_handler": true, + "listen": "test handlers", + "name": "Test handler 1", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": false, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + false + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "is_handler": true, + "listen": "test handlers", + "name": "Test handler 2", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "is_handler": true, + "listen": "test handlers", + "name": "Test handler 3", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + } + ], + "status": { + "applied": 5, + "failed": 0, + "skipped": 1 + } +} \ No newline at end of file diff --git a/tests/fixtures/callback/dir_store/proxy/testhostA.json b/tests/fixtures/callback/dir_store/proxy/testhostA.json new file mode 100644 index 00000000..6ace0fe1 --- /dev/null +++ b/tests/fixtures/callback/dir_store/proxy/testhostA.json @@ -0,0 +1,137 @@ +{ + "check_mode": false, + "host": "testhostA", + "metrics": { + "time": { + "total": 1 + } + }, + "reported_at": "2000-01-01 12:00:00.0000", + "results": [ + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + true + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Changed task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": false, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + false + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Ok task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": true, + "result": { + "_ansible_no_log": false, + "changed": false + }, + "task": { + "action": "fail", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "ignore_errors": true, + "name": "Failed task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + } + ], + "status": { + "applied": 1, + "failed": 0, + "skipped": 1 + } +} \ No newline at end of file diff --git a/tests/fixtures/callback/dir_store/proxy/testhostB.json b/tests/fixtures/callback/dir_store/proxy/testhostB.json new file mode 100644 index 00000000..9e0f8a06 --- /dev/null +++ b/tests/fixtures/callback/dir_store/proxy/testhostB.json @@ -0,0 +1,137 @@ +{ + "check_mode": false, + "host": "testhostB", + "metrics": { + "time": { + "total": 1 + } + }, + "reported_at": "2000-01-01 12:00:00.0000", + "results": [ + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": true, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + true + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Changed task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": false, + "result": { + "_ansible_no_log": false, + "changed": false, + "cmd": [ + "echo", + "foo" + ], + "invocation": { + "module_args": { + "_raw_params": "echo foo", + "_uses_shell": false, + "stdin_add_newline": true, + "strip_empty_ends": true, + "warn": false + } + }, + "rc": 0, + "stderr": "", + "stdout": "foo", + "stdout_lines": [ + "foo" + ] + }, + "task": { + "action": "command", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "changed_when": [ + false + ], + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "name": "Ok task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + }, + { + "failed": true, + "result": { + "_ansible_no_log": false, + "changed": false + }, + "task": { + "action": "fail", + "any_errors_fatal": false, + "async": 0, + "async_val": 0, + "become": false, + "become_method": "sudo", + "check_mode": false, + "connection": "smart", + "delay": 5, + "diff": false, + "finalized": true, + "ignore_errors": true, + "name": "Failed task", + "poll": 15, + "retries": 3, + "squashed": true, + "throttle": 0 + } + } + ], + "status": { + "applied": 1, + "failed": 0, + "skipped": 1 + } +} \ No newline at end of file diff --git a/tests/test_callback.py b/tests/test_callback.py index 5a4a5fc5..79d47d3c 100644 --- a/tests/test_callback.py +++ b/tests/test_callback.py @@ -8,11 +8,13 @@ from .conftest import run_playbook, get_ansible_version -def run_playbook_callback(tmpdir): +def run_playbook_callback(tmpdir, report_type): extra_env = {} ansible_version = get_ansible_version() if ansible_version is None: pytest.skip("Couldn't figure out Ansible version?!") + if distutils.version.LooseVersion(ansible_version) < distutils.version.LooseVersion('2.9'): + pytest.skip("Callbacks do not work correctly on 2.8") if distutils.version.LooseVersion(ansible_version) < distutils.version.LooseVersion('2.11'): extra_env['ANSIBLE_CALLBACK_WHITELIST'] = "theforeman.foreman.foreman" extra_env['ANSIBLE_COMMAND_WARNINGS'] = "0" @@ -21,7 +23,10 @@ def run_playbook_callback(tmpdir): extra_env['ANSIBLE_STDOUT_CALLBACK'] = "theforeman.foreman.foreman" extra_env['ANSIBLE_LOAD_CALLBACK_PLUGINS'] = "1" # No connection is actually performed during the test + extra_env['FOREMAN_REPORT_TYPE'] = report_type extra_env['FOREMAN_URL'] = "http://localhost" + if report_type == "proxy": + extra_env['FOREMAN_PROXY_URL'] = "http://localhost" extra_env['FOREMAN_SSL_CERT'] = "/dev/zero" extra_env['FOREMAN_SSL_KEY'] = "/dev/zero" extra_env['FOREMAN_DIR_STORE'] = tmpdir.strpath @@ -30,18 +35,42 @@ def run_playbook_callback(tmpdir): return run_playbook(playbook, inventory=inventory, extra_env=extra_env) -def test_callback(tmpdir, vcrmode): - run = run_playbook_callback(tmpdir) +def drop_incompatible_items(d): + """ + Recursively drop report items that vary on invocations + and versions and cannot be reasonably fixed + """ + dd = {} + for k, v in d.items(): + if isinstance(v, dict): + dd[k] = drop_incompatible_items(v) + elif isinstance(v, (list, set, tuple)): + dd[k] = type(v)(drop_incompatible_items(vv) if isinstance(vv, dict) else vv + for vv in v) + elif k not in ['msg', 'start', 'end', 'delta', 'uuid', 'timeout']: + dd[k] = v + return dd + + +def run_callback(tmpdir, report_type, vcrmode): + run = run_playbook_callback(tmpdir, report_type) assert run.rc == 0 + assert len(tmpdir.listdir()) > 0, "Directory with results is empty" for real_file in tmpdir.listdir(sort=True): contents = real_file.read() contents = re.sub(r"\d+-\d+-\d+[ T]\d+:\d+:\d+\.\d+", "2000-01-01 12:00:00.0000", contents) contents = re.sub(r"\d+:\d+:\d+\.\d+", "12:00:00.0000", contents) - contents = re.sub(r", \\\"msg\\\": \\\"\\\"", "", contents) + if report_type == "foreman": + # drop_incompatible_items cannot be used for the legacy format + contents = re.sub(r", \\\"msg\\\": \\\"\\\"", "", contents) real_contents = json.loads(contents) - real_contents['config_report']['metrics']['time']['total'] = 1 + if report_type == "foreman": + real_contents['config_report']['metrics']['time']['total'] = 1 + else: + real_contents['metrics']['time']['total'] = 1 + real_contents = drop_incompatible_items(real_contents) fixture_name = real_file.basename - fixture = os.path.join(os.getcwd(), 'tests', 'fixtures', 'callback', 'dir_store', fixture_name) + fixture = os.path.join(os.getcwd(), 'tests', 'fixtures', 'callback', 'dir_store', report_type, fixture_name) if vcrmode == "record": print("Writing: ", str(fixture)) with open(fixture, 'w') as f: @@ -49,4 +78,14 @@ def test_callback(tmpdir, vcrmode): else: with open(fixture, 'r') as f: expected_contents = json.load(f) + expected_contents = drop_incompatible_items(expected_contents) + real_contents = drop_incompatible_items(real_contents) assert expected_contents == real_contents, "Fixture {fixture_name} differs, run with -vvvv to see the diff".format(fixture_name=fixture_name) + + +def test_callback_foreman(tmpdir, vcrmode): + run_callback(tmpdir, "foreman", vcrmode) + + +def test_callback_proxy(tmpdir, vcrmode): + run_callback(tmpdir, "proxy", vcrmode) From 1ca30290b941cd68f9e06f283afb858bc81c2171 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 8 Oct 2021 12:24:06 +0200 Subject: [PATCH 23/36] drop the default url from the callback the url parameter is `required: True`, so if you don't define it in your configuration, ansible yields an error and the default value is never used anyways --- plugins/callback/foreman.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index f20951d9..7ec87967 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -36,7 +36,6 @@ - name: FOREMAN_SERVER_URL - name: FOREMAN_SERVER required: True - default: http://localhost:3000 ini: - section: callback_foreman key: url From f31badaac7ca4d1e02da8b57be081a2821f5459e Mon Sep 17 00:00:00 2001 From: pipopopo Date: Tue, 12 Oct 2021 17:32:37 +0200 Subject: [PATCH 24/36] Use reports API by default in inventory plugin --- changelogs/fragments/1291-foreman-ansible-inventory-default.yml | 2 ++ plugins/inventory/foreman.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1291-foreman-ansible-inventory-default.yml diff --git a/changelogs/fragments/1291-foreman-ansible-inventory-default.yml b/changelogs/fragments/1291-foreman-ansible-inventory-default.yml new file mode 100644 index 00000000..a3816244 --- /dev/null +++ b/changelogs/fragments/1291-foreman-ansible-inventory-default.yml @@ -0,0 +1,2 @@ +breaking_changes: + - Set use_reports_api default value to true for the inventory plugin diff --git a/plugins/inventory/foreman.py b/plugins/inventory/foreman.py index 770fb326..9e34b083 100644 --- a/plugins/inventory/foreman.py +++ b/plugins/inventory/foreman.py @@ -88,7 +88,7 @@ use_reports_api: description: Use Reporting API. type: boolean - default: False + default: True foreman: description: - Foreman server related configuration, deprecated. From 2f35831656dd4fbcc30e41818d52fb5c41c2da99 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 14 Oct 2021 09:26:06 +0200 Subject: [PATCH 25/36] Remove support for Ansible 2.8 --- .github/workflows/main.yml | 10 ++-------- Makefile | 12 ------------ README.md | 10 +++++----- changelogs/fragments/drop-ansible28.yml | 2 ++ meta/runtime.yml | 2 +- tests/test_callback.py | 2 -- 6 files changed, 10 insertions(+), 28 deletions(-) create mode 100644 changelogs/fragments/drop-ansible28.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a726126a..39f763a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,6 @@ jobs: python: - "3.8" ansible: - - stable-2.8 - stable-2.9 - stable-2.10 - stable-2.11 @@ -50,18 +49,13 @@ jobs: run: sudo apt-get install -y libyaml-dev - name: Install Ansible run: pip install --upgrade git+https://github.com/ansible/ansible.git@${{ matrix.ansible }} - - name: Set Environment to use mazer - run: | - echo "COLLECTION_COMMAND=mazer" >> $GITHUB_ENV - pip install --upgrade mazer - if: matrix.ansible == 'stable-2.8' - name: Install dependencies run: make test-setup - name: fake redhat-uep.pem for redhat_manifest module run: sudo mkdir -p /etc/rhsm/ca/ && sudo touch /etc/rhsm/ca/redhat-uep.pem - name: Install required collections for ansible-base (2.10+) run: ansible-galaxy collection install community.docker - if: matrix.ansible != 'stable-2.8' && matrix.ansible != 'stable-2.9' + if: matrix.ansible != 'stable-2.9' - name: Run crud tests run: make test-crud - name: Run other tests @@ -70,7 +64,7 @@ jobs: run: make dist-test - name: Run sanity tests run: make SANITY_OPTS="--local" sanity - if: matrix.ansible != 'stable-2.8' && matrix.ansible != 'stable-2.9' + if: matrix.ansible != 'stable-2.9' checkmode: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 6fc218ea..ac6fe318 100644 --- a/Makefile +++ b/Makefile @@ -93,25 +93,13 @@ dist-test: $(MANIFEST) ansible-doc $(NAMESPACE).$(NAME).organization | grep -q "Manage Organization" $(MANIFEST): $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz -ifeq ($(COLLECTION_COMMAND),mazer) - # No idea, why this fails. But mazer is old and deprecated so unlikely to beeing fixed... - # mazer install --collections-path build/collections $< - -mkdir build/collections build/collections/ansible_collections build/collections/ansible_collections/$(NAMESPACE) build/collections/ansible_collections/$(NAMESPACE)/$(NAME) - tar xf $< -C build/collections/ansible_collections/$(NAMESPACE)/$(NAME) -else ansible-galaxy collection install -p build/collections $< --force -endif build/src/%: % install -m 644 -DT $< $@ $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz: $(addprefix build/src/,$(DEPENDENCIES)) -ifeq ($(COLLECTION_COMMAND),mazer) - mazer build --collection-path=build/src - cp build/src/releases/$@ . -else ansible-galaxy collection build build/src --force -endif dist: $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz diff --git a/README.md b/README.md index 89c7c51e..fbcdde27 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ We actively test the modules against the latest stable Foreman release and the m ### Supported Ansible Versions -The supported Ansible versions are aligned with currently maintained Ansible versions that support Collections (2.8+). -You can find the list of maintained Ansible versions [here](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status). +The supported Ansible versions are aligned with currently maintained Ansible versions that support Collections (2.9+). +You can find the list of maintained Ansible versions [here](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html). ### Supported Python Versions -Starting with Ansible 2.7, Ansible only supports Python 2.7 and 3.5 (and higher). These are also the only Python versions we develop and test the modules against. +Ansible only supports Python 2.7 and 3.5 (and higher). These are also the only Python versions we develop and test the modules against. ### Known issues @@ -58,7 +58,7 @@ There are currently two ways to use the modules in your setup: install from Ansi ### Installation from Ansible Galaxy -You can install the collection from [Ansible Galaxy](https://galaxy.ansible.com/theforeman/foreman) by running `ansible-galaxy collection install theforeman.foreman` (Ansible 2.9 and later) or `mazer install theforeman.foreman` (Ansible 2.8). +You can install the collection from [Ansible Galaxy](https://galaxy.ansible.com/theforeman/foreman) by running `ansible-galaxy collection install theforeman.foreman`. After the installation, the modules are available as `theforeman.foreman.`. Please see the [Using Ansible collections documentation](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for further details. @@ -100,7 +100,7 @@ And install all specified requirements with `ansible-galaxy install -r requireme ### Building and Installing the Collection Locally -For all currently supported versions of Ansible (i.e. Ansible >= 2.8, and particularly Ansible < 2.10 where the above approach is not yet supported), you can build the collection locally: +For all currently supported versions of Ansible (i.e. Ansible >= 2.9, and particularly Ansible < 2.10 where the above approach is not yet supported), you can build the collection locally: `make dist` diff --git a/changelogs/fragments/drop-ansible28.yml b/changelogs/fragments/drop-ansible28.yml new file mode 100644 index 00000000..de7130cd --- /dev/null +++ b/changelogs/fragments/drop-ansible28.yml @@ -0,0 +1,2 @@ +breaking_changes: + - Support for Ansible 2.8 is removed diff --git a/meta/runtime.yml b/meta/runtime.yml index 76292261..64777c26 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,5 +1,5 @@ --- -requires_ansible: '>=2.8' +requires_ansible: '>=2.9' plugin_routing: modules: foreman_architecture: diff --git a/tests/test_callback.py b/tests/test_callback.py index 79d47d3c..79450c73 100644 --- a/tests/test_callback.py +++ b/tests/test_callback.py @@ -13,8 +13,6 @@ def run_playbook_callback(tmpdir, report_type): ansible_version = get_ansible_version() if ansible_version is None: pytest.skip("Couldn't figure out Ansible version?!") - if distutils.version.LooseVersion(ansible_version) < distutils.version.LooseVersion('2.9'): - pytest.skip("Callbacks do not work correctly on 2.8") if distutils.version.LooseVersion(ansible_version) < distutils.version.LooseVersion('2.11'): extra_env['ANSIBLE_CALLBACK_WHITELIST'] = "theforeman.foreman.foreman" extra_env['ANSIBLE_COMMAND_WARNINGS'] = "0" From a5fc2ae90eca409e2193ca0c450e28f63aeaf92e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 14 Oct 2021 09:58:41 +0200 Subject: [PATCH 26/36] test python 3.5 -- Ansible does still support it --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 39f763a4..a38cf4eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,8 @@ jobs: include: - python: "2.7" ansible: "stable-2.11" + - python: "3.5" + ansible: "stable-2.11" - python: "3.6" ansible: "stable-2.11" - python: "3.7" From 9bc756596bbfb510989cd33d6c7f9d7020481925 Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Mon, 25 Oct 2021 16:37:52 +0200 Subject: [PATCH 27/36] Rename host reports endpoint --- plugins/callback/foreman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index 7ec87967..b57803c2 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -237,7 +237,7 @@ def _send_data(self, data_type, report_type, host, data): elif data_type == 'report' and report_type == 'foreman': url = self.foreman_url + '/api/v2/config_reports' elif data_type == 'report' and report_type == 'proxy': - url = self.proxy_url + '/host_reports/ansible' + url = self.proxy_url + '/reports/ansible' else: self._display.warning(u'Unknown report_type: {rt}'.format(rt=report_type)) From 975978568d668ce7ec28ec761375c31a46723d60 Mon Sep 17 00:00:00 2001 From: Kenny Tordeurs Date: Wed, 13 Oct 2021 09:45:45 +0200 Subject: [PATCH 28/36] Fix for misleading documentation 1298 Signed-off-by: Kenny Tordeurs --- plugins/modules/host.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/modules/host.py b/plugins/modules/host.py index e37357c0..5beece8d 100644 --- a/plugins/modules/host.py +++ b/plugins/modules/host.py @@ -36,7 +36,8 @@ type: str hostgroup: description: - - Name of related hostgroup. + - Title of related hostgroup + - Example parent hostgroup I(foo) with a child hostgroup I(bar) would have the title I(foo/bar) required: false type: str location: From 65033ca724f15a621fc9dd4e1c23c5d78d0a25ad Mon Sep 17 00:00:00 2001 From: pipopopo Date: Wed, 13 Oct 2021 09:53:25 +0200 Subject: [PATCH 29/36] Update plugins/modules/host.py Co-authored-by: Matthias Dellweg <2500@gmx.de> --- plugins/modules/host.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/host.py b/plugins/modules/host.py index 5beece8d..c41747db 100644 --- a/plugins/modules/host.py +++ b/plugins/modules/host.py @@ -37,7 +37,7 @@ hostgroup: description: - Title of related hostgroup - - Example parent hostgroup I(foo) with a child hostgroup I(bar) would have the title I(foo/bar) + - "Example: A child hostgroup I(bar) within a parent hostgroup I(foo) would have the title I(foo/bar)." required: false type: str location: From 2f4a686aad82bc76622d26334fff9c19cd08f410 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 27 Oct 2021 09:01:26 +0200 Subject: [PATCH 30/36] pin python-debian for 3.6 too 0.1.42 (accidentally) dropped support for 3.5/3.6 [1], and as we've already had a pin for 3.5 and older, let's just extend it to also include 3.6 -- 3.7 and newer can then use "latest" [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=997857 --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0f41b235..2c6d46b5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,8 +4,8 @@ pytest-clarity; python_version >= '3.6' vcrpy ansible_runner<2.0; python_version < '3.6' ansible_runner; python_version >= '3.6' -python-debian<0.1.40; python_version < '3.6' -python-debian; python_version >= '3.6' +python-debian<0.1.40; python_version < '3.7' +python-debian; python_version >= '3.7' rpm-py-installer rstcheck docker From a3b35b429f32da720aac4de06c231e7807fd7e0e Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Tue, 26 Oct 2021 11:14:57 +0200 Subject: [PATCH 31/36] Do not send facts when proxy is set --- plugins/callback/foreman.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index b57803c2..41f3f661 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -260,6 +260,9 @@ def send_facts(self): parser. The default fact importer should import these facts properly. """ + # proxy parses facts from report directly + if self.report_type == "proxy": + return for host, facts in self.facts.items(): facts = { From cf6a76cc21433ad8e856ee3c03a8b95fe50c3be9 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Mon, 8 Nov 2021 20:49:39 +0100 Subject: [PATCH 32/36] Convert2RHEL role Conver2RHEL role creates a basic configuration & data for registering and converting CentOS clients to RHEL. Co-authored-by: Evgeni Golov --- .github/workflows/main.yml | 6 +- changelogs/fragments/convert2rhel.yml | 2 + roles/content_rhel/README.md | 3 + roles/content_rhel/defaults/main.yml | 1 + roles/content_rhel/tasks/main.yml | 4 +- roles/convert2rhel/README.md | 42 ++ roles/convert2rhel/defaults/main.yml | 20 + roles/convert2rhel/tasks/activation_keys.yml | 82 +++ roles/convert2rhel/tasks/host_groups.yml | 26 + roles/convert2rhel/tasks/main.yml | 8 + .../convert2rhel/tasks/products_and_repos.yml | 75 +++ roles/manifest/tasks/main.yml | 2 +- tests/fixtures/apidoc/convert2rhel.json | 1 + tests/test_playbooks/convert2rhel.yml | 29 + .../fixtures/convert2rhel-1.yml | 241 +++++++++ .../fixtures/convert2rhel-2.yml | 248 +++++++++ .../fixtures/convert2rhel-3.yml | 373 +++++++++++++ .../fixtures/convert2rhel-4.yml | 504 ++++++++++++++++++ .../fixtures/convert2rhel-5.yml | 288 ++++++++++ .../fixtures/convert2rhel-6.yml | 466 ++++++++++++++++ .../fixtures/convert2rhel-7.yml | 352 ++++++++++++ .../fixtures/convert2rhel-8.yml | 409 ++++++++++++++ 22 files changed, 3177 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/convert2rhel.yml create mode 100644 roles/convert2rhel/README.md create mode 100644 roles/convert2rhel/defaults/main.yml create mode 100644 roles/convert2rhel/tasks/activation_keys.yml create mode 100644 roles/convert2rhel/tasks/host_groups.yml create mode 100644 roles/convert2rhel/tasks/main.yml create mode 100644 roles/convert2rhel/tasks/products_and_repos.yml create mode 120000 tests/fixtures/apidoc/convert2rhel.json create mode 100644 tests/test_playbooks/convert2rhel.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-1.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-2.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-3.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-4.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-5.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-6.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-7.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-8.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a38cf4eb..bde00bb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,8 +53,8 @@ jobs: run: pip install --upgrade git+https://github.com/ansible/ansible.git@${{ matrix.ansible }} - name: Install dependencies run: make test-setup - - name: fake redhat-uep.pem for redhat_manifest module - run: sudo mkdir -p /etc/rhsm/ca/ && sudo touch /etc/rhsm/ca/redhat-uep.pem + - name: prepare a redhat-uep.pem, even if we run on Ubuntu + run: sudo mkdir -p /etc/rhsm/ca/ && sudo curl -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem - name: Install required collections for ansible-base (2.10+) run: ansible-galaxy collection install community.docker if: matrix.ansible != 'stable-2.9' @@ -87,6 +87,8 @@ jobs: run: pip install --upgrade ansible - name: Install dependencies run: make test-setup + - name: prepare a redhat-uep.pem, even if we run on Ubuntu + run: sudo mkdir -p /etc/rhsm/ca/ && sudo curl -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem - name: Run check_mode tests run: make test-check-mode diff --git a/changelogs/fragments/convert2rhel.yml b/changelogs/fragments/convert2rhel.yml new file mode 100644 index 00000000..deff6516 --- /dev/null +++ b/changelogs/fragments/convert2rhel.yml @@ -0,0 +1,2 @@ +minor_changes: + - Add a role `convert2rhel` to perform setup for converting systems to RHEL diff --git a/roles/content_rhel/README.md b/roles/content_rhel/README.md index f10a20b1..f41514b9 100644 --- a/roles/content_rhel/README.md +++ b/roles/content_rhel/README.md @@ -38,6 +38,8 @@ Repository behavior is controlled via the variables: `foreman_content_rhel_enable_rhel8`: Enable rhel-8-for-x86_64-baseos-rpms and rhel-8-for-x86_64-appstream-rpms (x86 architecture). Default true. +`foreman_content_rhel_rhel8_releasever`: Version of RHEL 8 repositories. Default `8`. + `foreman_content_rhel_sync_now`: Sync repositories immediately after enabling. Default true. `foreman_content_rhel_wait_for_syncs`: Monitor status of sync tasks. When false, the sync tasks will continue running in the background after the playbook has finished running. This option is most useful when other automation (for example, registering and patching a client) requires the repository syncs to have completed. Default true. @@ -99,6 +101,7 @@ This example downloads a manifest with the provided UUID from the RHSM portal us foreman_sync_plan_interval: daily foreman_sync_plan_sync_date: 2021-02-02 00:00:00 UTC foreman_activation_key_name: "RHEL_Key" + foreman_content_rhel_rhel8_releasever: 8.4 ``` This example assumes the manifest has already been downloaded to ~/my_subscription_manifesst.zip on localhost and uploads that manifest to the ACME organization. It enables the rhel-7-server-rpms repository only, syncs it immediately, and also creates a custom cron sync plan for it. It creates an activation key "RHEL_Key" to register existing RHEL content hosts. diff --git a/roles/content_rhel/defaults/main.yml b/roles/content_rhel/defaults/main.yml index 05d1b004..1ed1023e 100644 --- a/roles/content_rhel/defaults/main.yml +++ b/roles/content_rhel/defaults/main.yml @@ -3,3 +3,4 @@ foreman_content_rhel_enable_rhel7: true foreman_content_rhel_enable_rhel8: true foreman_content_rhel_sync_now: true foreman_content_rhel_wait_for_syncs: true +foreman_content_rhel_rhel8_releasever: 8 diff --git a/roles/content_rhel/tasks/main.yml b/roles/content_rhel/tasks/main.yml index 76f6b0b7..88384a47 100644 --- a/roles/content_rhel/tasks/main.yml +++ b/roles/content_rhel/tasks/main.yml @@ -23,9 +23,9 @@ - name: Red Hat Enterprise Linux for x86_64 repository_sets: - name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) - releasever: 8 + releasever: "{{ foreman_content_rhel_rhel8_releasever }}" - name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) - releasever: 8 + releasever: "{{ foreman_content_rhel_rhel8_releasever }}" when: foreman_content_rhel_enable_rhel8 - name: "Sync RHEL7 repository" diff --git a/roles/convert2rhel/README.md b/roles/convert2rhel/README.md new file mode 100644 index 00000000..d597db20 --- /dev/null +++ b/roles/convert2rhel/README.md @@ -0,0 +1,42 @@ +theforeman.foreman.convert2rhel +=============================== + +This role creates a basic configuration for everything needed to register and convert CentOS clients to Red hat Enterprise Linux. + +First step is upload of manifest and synchronization of RHEL repositories. For more detail see [content_rhel Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/content_rhel/README.md). + +Then the role creates Convert2RHEL products & repositories (and synchronizes them), activation keys and host groups for each OS. + +If simple content access is disabled, subscriptions and repositories for RHEL activation keys must be added manually. + +Role Variables +-------------- + +This role supports the [Common Role Variables](https://github.com/theforeman/foreman-ansible-modules/blob/develop/README.md#common-role-variables) and [Content RHEL variables](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/content_rhel/README.md) + +- `foreman_convert2rhel_manage_subscription`: Run [content_rhel Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/content_rhel/README.md) role, default: `true` +- `foreman_convert2rhel_lifecycle_env`: Lifecycle environment for activation keys, default: Library. +- `foreman_convert2rhel_content_view`: Content view for activation keys, default: Default Organization View. + +Example Playbooks +----------------- + +Convert2RHEL + +```yaml +- hosts: localhost + roles: + - role: theforeman.foreman.convert2rhel + vars: + foreman_server_url: "https://foreman.example.com" + foreman_username: "admin" + foreman_password: "changeme" + foreman_organization: "Default Organization" + foreman_manifest_path: "~/manifest.zip" + foreman_content_rhel_enable_rhel7: true + foreman_content_rhel_enable_rhel8: true + foreman_content_rhel_rhel8_releasever: 8.4 + foreman_content_rhel_wait_for_syncs: false + foreman_convert2rhel_lifecycle_env: "Library" + foreman_convert2rhel_content_view: "Default Organization View" +``` diff --git a/roles/convert2rhel/defaults/main.yml b/roles/convert2rhel/defaults/main.yml new file mode 100644 index 00000000..c3874898 --- /dev/null +++ b/roles/convert2rhel/defaults/main.yml @@ -0,0 +1,20 @@ +--- +foreman_convert2rhel_manage_subscription: true + +# Convert2RHEL Products & repos +foreman_convert2rhel_rhel7_product: "Convert2RHEL7" +foreman_convert2rhel_rhel7_repo: "Convert2RHEL7 main" +foreman_convert2rhel_rhel8_product: "Convert2RHEL8" +foreman_convert2rhel_rhel8_repo: "Convert2RHEL8 main" + +# Activation keys +foreman_convert2rhel_key_centos7: "convert2rhel_centos7" +foreman_convert2rhel_key_centos8: "convert2rhel_centos8" +foreman_convert2rhel_key_rhel7: "convert2rhel_rhel7" +foreman_convert2rhel_key_rhel8: "convert2rhel_rhel8" +foreman_convert2rhel_lifecycle_env: "Library" +foreman_convert2rhel_content_view: "Default Organization View" + +# Host groups +foreman_convert2rhel_hostgroup7: "CentOS 7 converting" +foreman_convert2rhel_hostgroup8: "CentOS 8 converting" diff --git a/roles/convert2rhel/tasks/activation_keys.yml b/roles/convert2rhel/tasks/activation_keys.yml new file mode 100644 index 00000000..db1ed45e --- /dev/null +++ b/roles/convert2rhel/tasks/activation_keys.yml @@ -0,0 +1,82 @@ +--- +- name: "Get organization (SCA) info" + theforeman.foreman.organization_info: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + name: "{{ foreman_organization }}" + register: foreman_convert2rhel_org_info + +- name: "Set non SCA facts" + set_fact: + foreman_convert2rhel_centos7_subs: + - name: "Convert2RHEL7" + foreman_convert2rhel_centos8_subs: + - name: "Convert2RHEL8" + when: not foreman_convert2rhel_org_info['organization']['simple_content_access'] + +- name: "Create '{{ foreman_convert2rhel_key_centos7 }}' activation key" + theforeman.foreman.activation_key: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_key_centos7 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + subscriptions: "{{ foreman_convert2rhel_org_info['organization']['simple_content_access'] | ternary(omit, foreman_convert2rhel_centos7_subs) }}" + when: foreman_content_rhel_enable_rhel7 + +- name: "Create '{{ foreman_convert2rhel_key_centos8 }}' activation key" + theforeman.foreman.activation_key: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_key_centos8 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + auto_attach: false + subscriptions: "{{ foreman_convert2rhel_org_info['organization']['simple_content_access'] | ternary(omit, foreman_convert2rhel_centos8_subs) }}" + when: foreman_content_rhel_enable_rhel8 + +- name: "Create '{{ foreman_convert2rhel_key_rhel7 }}' activation key" + theforeman.foreman.activation_key: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_key_rhel7 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + auto_attach: false + when: foreman_content_rhel_enable_rhel7 + +- name: "Create '{{ foreman_convert2rhel_key_rhel8 }}' activation key" + theforeman.foreman.activation_key: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_key_rhel8 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + auto_attach: false + when: foreman_content_rhel_enable_rhel8 + +- name: "Add subscriptions to '{{ foreman_convert2rhel_key_rhel7 }}'" + ansible.builtin.debug: + msg: + - "Simple content access is disabled, please add subscriptions to '{{ foreman_convert2rhel_key_rhel7 }}' activation key manually" + when: not foreman_convert2rhel_org_info['organization']['simple_content_access'] and foreman_content_rhel_enable_rhel7 + +- name: "Add subscriptions to '{{ foreman_convert2rhel_key_rhel8 }}'" + ansible.builtin.debug: + msg: + - "Simple content access is disabled, please add subscriptions to '{{ foreman_convert2rhel_key_rhel8 }}' activation key manually" + when: not foreman_convert2rhel_org_info['organization']['simple_content_access'] and foreman_content_rhel_enable_rhel8 diff --git a/roles/convert2rhel/tasks/host_groups.yml b/roles/convert2rhel/tasks/host_groups.yml new file mode 100644 index 00000000..fec90cfb --- /dev/null +++ b/roles/convert2rhel/tasks/host_groups.yml @@ -0,0 +1,26 @@ +--- +- name: "Create '{{ foreman_convert2rhel_hostgroup7 }}' host group" + theforeman.foreman.hostgroup: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_hostgroup7 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + activation_keys: "{{ foreman_convert2rhel_key_centos7 }}" + when: foreman_content_rhel_enable_rhel7 + +- name: "Create '{{ foreman_convert2rhel_hostgroup8 }}' host group" + theforeman.foreman.hostgroup: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_hostgroup8 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + activation_keys: "{{ foreman_convert2rhel_key_centos8 }}" + when: foreman_content_rhel_enable_rhel8 diff --git a/roles/convert2rhel/tasks/main.yml b/roles/convert2rhel/tasks/main.yml new file mode 100644 index 00000000..26ee0446 --- /dev/null +++ b/roles/convert2rhel/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: "Upload Subscription Manifest and sync RHEL repository" + include_role: + name: theforeman.foreman.content_rhel + when: foreman_convert2rhel_manage_subscription +- import_tasks: products_and_repos.yml +- import_tasks: activation_keys.yml +- import_tasks: host_groups.yml diff --git a/roles/convert2rhel/tasks/products_and_repos.yml b/roles/convert2rhel/tasks/products_and_repos.yml new file mode 100644 index 00000000..2acbd226 --- /dev/null +++ b/roles/convert2rhel/tasks/products_and_repos.yml @@ -0,0 +1,75 @@ +--- +- name: Check /etc/rhsm/ca/redhat-uep.pem + stat: + path: "/etc/rhsm/ca/redhat-uep.pem" + register: ct + +- name: "Create 'Convert2RHEL' credentials" + theforeman.foreman.content_credential: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "Convert2RHEL CA" + content_type: cert + content: "{{ ct.stat.exists | ternary(lookup('file', '/etc/rhsm/ca/redhat-uep.pem', errors='ignore', rstrip=False), lookup('url', 'https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem', split_lines=False)) }}" + state: present + +- name: "Create '{{ foreman_convert2rhel_rhel7_product }}' product and repositories" + include_role: + name: theforeman.foreman.repositories + vars: + foreman_products: + - name: "{{ foreman_convert2rhel_rhel7_product }}" + repositories: + - name: "{{ foreman_convert2rhel_rhel7_repo }}" + content_type: "yum" + product: "{{ foreman_convert2rhel_rhel7_product }}" + url: "https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/" + mirror_on_sync: true + verify_ssl_on_sync: true + download_policy: immediate + ssl_ca_cert: "Convert2RHEL CA" + state: present + when: foreman_content_rhel_enable_rhel7 + +- name: "Create '{{ foreman_convert2rhel_rhel8_product }}' product and repositories" + include_role: + name: theforeman.foreman.repositories + vars: + foreman_products: + - name: "{{ foreman_convert2rhel_rhel8_product }}" + repositories: + - name: "{{ foreman_convert2rhel_rhel8_repo }}" + content_type: "yum" + product: "{{ foreman_convert2rhel_rhel8_product }}" + url: "https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/" + mirror_on_sync: true + verify_ssl_on_sync: true + download_policy: immediate + ssl_ca_cert: "Convert2RHEL CA" + state: present + when: foreman_content_rhel_enable_rhel8 + +- name: "Synchronize '{{ foreman_convert2rhel_rhel7_repo }}' repository" + theforeman.foreman.repository_sync: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + repository: "{{ foreman_convert2rhel_rhel7_repo }}" + product: "{{ foreman_convert2rhel_rhel7_product }}" + when: foreman_content_rhel_enable_rhel7 + +- name: "Synchronize '{{ foreman_convert2rhel_rhel8_repo }}' repository" + theforeman.foreman.repository_sync: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + repository: "{{ foreman_convert2rhel_rhel8_repo }}" + product: "{{ foreman_convert2rhel_rhel8_product }}" + when: foreman_content_rhel_enable_rhel8 diff --git a/roles/manifest/tasks/main.yml b/roles/manifest/tasks/main.yml index 2908663b..01ab15cc 100644 --- a/roles/manifest/tasks/main.yml +++ b/roles/manifest/tasks/main.yml @@ -15,4 +15,4 @@ validate_certs: "{{ foreman_validate_certs | default(omit) }}" organization: "{{ foreman_organization }}" manifest_path: "{{ foreman_manifest_path }}" - state: present + state: "{{ foreman_manifest_state | default('present') }}" diff --git a/tests/fixtures/apidoc/convert2rhel.json b/tests/fixtures/apidoc/convert2rhel.json new file mode 120000 index 00000000..8e89899a --- /dev/null +++ b/tests/fixtures/apidoc/convert2rhel.json @@ -0,0 +1 @@ +katello.json \ No newline at end of file diff --git a/tests/test_playbooks/convert2rhel.yml b/tests/test_playbooks/convert2rhel.yml new file mode 100644 index 00000000..c36a1d6e --- /dev/null +++ b/tests/test_playbooks/convert2rhel.yml @@ -0,0 +1,29 @@ +--- +- hosts: localhost + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - name: ensure test organization + include_tasks: tasks/organization.yml + vars: + organization_name: "Test Organization" + organization_state: "present" + +- hosts: tests + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + roles: + - role: convert2rhel + vars: + foreman_organization: "Test Organization" + foreman_validate_certs: false + foreman_convert2rhel_manage_subscription: false + foreman_content_rhel_wait_for_syncs: false + foreman_content_rhel_enable_rhel7: true + foreman_content_rhel_enable_rhel8: false diff --git a/tests/test_playbooks/fixtures/convert2rhel-1.yml b/tests/test_playbooks/fixtures/convert2rhel-1.yml new file mode 100644 index 00000000..00510083 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-1.yml @@ -0,0 +1,241 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/content_credentials?organization_id=4&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL + CA\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Convert2RHEL + CA","content_type":"cert","content":"-----BEGIN CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END + CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '8387' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/content_credentials/2 + response: + body: + string: ' {"name":"Convert2RHEL CA","content_type":"cert","content":"-----BEGIN + CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END + CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '8220' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-2.yml b/tests/test_playbooks/fixtures/convert2rhel-2.yml new file mode 100644 index 00000000..af9794df --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-2.yml @@ -0,0 +1,248 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' + content-length: + - '659' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/products/32?organization_id=4 + response: + body: + string: ' {"sync_state_aggregated":"Syncing Complete.","redhat":false,"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1,"created_at":"2021-11-04 + 11:33:08 UTC","updated_at":"2021-11-04 11:33:08 UTC","product_content":[{"enabled":true,"product_id":32,"content":{"name":"Convert2RHEL7 + main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636025591688","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"available_content":[{"enabled":true,"product_id":32,"content":{"name":"Convert2RHEL7 + main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636025591688","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"repositories":[{"name":"Convert2RHEL7 + main","id":6}],"provider":{"name":"Anonymous"},"sync_status":{"id":6,"product_id":32,"progress":{"progress":100.0},"sync_id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","state":"Syncing + Complete.","raw_state":"stopped","start_time":"1 minute ago","finish_time":"1 + minute ago","duration":"less than a minute","display_size":"No content added.","size":"No + content added.","is_running":false,"error_details":"#"},"permissions":{"view_products":true,"edit_products":true,"destroy_products":true,"sync_products":true},"published_content_view_ids":[],"active_task_count":0} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1970' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-3.yml b/tests/test_playbooks/fixtures/convert2rhel-3.yml new file mode 100644 index 00000000..542bdd43 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-3.yml @@ -0,0 +1,373 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' + content-length: + - '659' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/content_credentials?organization_id=4&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL + CA\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Convert2RHEL + CA","content_type":"cert","content":"-----BEGIN CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END + CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END + CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '8387' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/products/32/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7 + main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 + 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 + minute"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1813' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/repositories/6 + response: + body: + string: ' {"ostree_branches":[],"relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2021-11-04 + 11:33:25 UTC","organization_id":4,"organization":{"name":"Test Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:10 UTC","updated_at":"2021-11-04 11:33:12 UTC","backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 + 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 + minute","environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"mirror_on_sync":true,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":2,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"ostree_upstream_sync_policy":null,"ostree_upstream_sync_depth":null,"computed_ostree_upstream_sync_depth":0,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"gpg_key":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":2,"name":"Convert2RHEL + CA"},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"permissions":{"deletable":true},"upstream_password_exists":false,"upstream_auth_exists":false} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '3041' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-4.yml b/tests/test_playbooks/fixtures/convert2rhel-4.yml new file mode 100644 index 00000000..b0f44ef5 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-4.yml @@ -0,0 +1,504 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"2 minutes","organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' + content-length: + - '660' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/products/32/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7 + main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 + 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 + minute"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1813' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: http://foreman.example.org/katello/api/repositories/6/sync + response: + body: + string: ' {"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 + UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"repository":{"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/4/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2021-11-08 + 09:41:39 UTC","available_actions":{"cancellable":false,"resumable":false}} + + ' + headers: + Cache-Control: + - no-cache + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f + response: + body: + string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 + UTC","ended_at":null,"duration":"00:00:05.068979","state":"running","result":"pending","progress":0.08,"input":{"repository":{"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/4/edit"}]],"output":"Waiting + to start.\n--------------------------------","errors":[]},"cli_example":null,"start_at":"2021-11-08 + 09:41:39 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1609' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f + response: + body: + string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 + UTC","ended_at":null,"duration":"00:00:09.679269","state":"running","result":"pending","progress":0.46,"input":{"repository":{"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/4/edit"}]],"output":"Total steps: + 13/13\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 9/9\nParsed Advisories: 2/2\nParsed + Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-08 + 09:41:39 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1791' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f + response: + body: + string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":false,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 + UTC","ended_at":"2021-11-08 09:41:52 UTC","duration":"00:00:13.149","state":"stopped","result":"success","progress":1.0,"input":{"repository":{"id":6,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"publication_provided":false,"contents_changed":false},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/4/edit"}]],"output":"No content + added.\nTotal steps: 13/13\n--------------------------------\nAssociating + Content: 0/0\nDownloading Artifacts: 0/0\nDownloading Metadata Files: 9/9\nParsed + Advisories: 2/2\nParsed Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: + 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-08 09:41:39 UTC","available_actions":{"cancellable":false,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1734' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-5.yml b/tests/test_playbooks/fixtures/convert2rhel-5.yml new file mode 100644 index 00000000..42d947ea --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-5.yml @@ -0,0 +1,288 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4 + response: + body: + string: '{"label":"Test_Organization","redhat_repository_url":"https://cdn.redhat.com","system_purposes":{"addons":[],"roles":[],"usage":[],"support_level":[],"support_type":[]},"service_levels":[],"service_level":null,"select_all_types":[],"description":"A + test organization","created_at":"2021-11-03 12:39:45 UTC","updated_at":"2021-11-03 + 12:39:48 UTC","ancestry":null,"parent_id":null,"parent_name":null,"id":4,"name":"Test + Organization","title":"Test Organization","users":[{"id":5,"login":"manager","description":"","inherited":false}],"smart_proxies":[{"name":"centos7-katello-devel-stable.example.com","id":1,"url":"http://centos7-katello-devel-stable.example.com:8000","inherited":false}],"subnets":[],"compute_resources":[],"media":[],"ptables":[{"description":null,"os_family":"Suse","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST entire + SCSI disk","id":112,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST entire + virtual disk","id":113,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST LVM","id":114,"inherited":false},{"description":null,"os_family":"Coreos","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"CoreOS default + fake","id":115,"inherited":false},{"description":null,"os_family":"Rancheros","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"Empty","id":116,"inherited":false},{"description":null,"os_family":"Freebsd","created_at":"2021-10-20 + 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"FreeBSD default + fake","id":117,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Jumpstart default","id":118,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Jumpstart mirrored","id":119,"inherited":false},{"description":null,"os_family":"Junos","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Junos default + fake","id":120,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart custom","id":121,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart default","id":122,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart default + thin","id":123,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart dynamic","id":124,"inherited":false},{"description":null,"os_family":"NXOS","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"NX-OS default + fake","id":125,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Preseed default","id":126,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Preseed default + LVM","id":127,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Windows default + GPT EFI partition table","id":129,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Windows default + partition table","id":128,"inherited":false},{"description":null,"os_family":"Xenserver","created_at":"2021-10-20 + 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"XenServer default","id":130,"inherited":false}],"provisioning_templates":[{"id":44,"name":"Alterator + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":28,"name":"Alterator + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":10,"name":"Alterator + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":61,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":62,"name":"ansible_provisioning_callback","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":63,"name":"ansible_tower_callback_script","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":64,"name":"ansible_tower_callback_service","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":45,"name":"Atomic + Kickstart default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":46,"name":"AutoYaST + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":37,"name":"AutoYaST + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":11,"name":"AutoYaST + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":107,"name":"AutoYaST + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":47,"name":"AutoYaST + SLES default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":65,"name":"blacklist_kernel_modules","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":66,"name":"bmc_nic_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":67,"name":"built","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":68,"name":"chef_client","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":27,"name":"CloudInit + default","template_kind_id":12,"template_kind_name":"cloud-init","inherited":false},{"id":69,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":48,"name":"CoreOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":12,"name":"CoreOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":70,"name":"create_users","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":71,"name":"csr_attributes.yaml","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":72,"name":"efibootmgr_netboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":73,"name":"eject_cdrom","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":74,"name":"epel","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":75,"name":"fips_packages","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":76,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":29,"name":"FreeBSD + (mfsBSD) finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":49,"name":"FreeBSD + (mfsBSD) provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":13,"name":"FreeBSD + (mfsBSD) PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":77,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":58,"name":"Global + Registration","template_kind_id":13,"template_kind_name":"registration","inherited":false},{"id":59,"name":"Grubby + default","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":78,"name":"http_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":79,"name":"insights","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":38,"name":"iPXE + default local boot","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":39,"name":"iPXE + global default","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":40,"name":"iPXE + intermediate script","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":50,"name":"Jumpstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":30,"name":"Jumpstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":2,"name":"Jumpstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":31,"name":"Junos + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":51,"name":"Junos + default SLAX","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":26,"name":"Junos + default ZTP config","template_kind_id":10,"template_kind_name":"ZTP","inherited":false},{"id":52,"name":"Kickstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":32,"name":"Kickstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":41,"name":"Kickstart + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":3,"name":"Kickstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":6,"name":"Kickstart + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":14,"name":"Kickstart + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":108,"name":"Kickstart + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":81,"name":"kickstart_ifcfg_bonded_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":80,"name":"kickstart_ifcfg_bond_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":82,"name":"kickstart_ifcfg_generic_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":83,"name":"kickstart_ifcfg_get_identifier_names","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":84,"name":"kickstart_kernel_options","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":85,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":53,"name":"Kickstart + oVirt-RHVH","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":15,"name":"Kickstart + oVirt-RHVH PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":36,"name":"Linux + host_init_config default","template_kind_id":1,"template_kind_name":"host_init_config","inherited":false},{"id":86,"name":"ntp","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":1,"name":"NX-OS + default POAP setup","template_kind_id":11,"template_kind_name":"POAP","inherited":false},{"id":87,"name":"pkg_manager","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":54,"name":"Preseed + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":33,"name":"Preseed + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":42,"name":"Preseed + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":7,"name":"Preseed + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":16,"name":"Preseed + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":109,"name":"Preseed + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":88,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":89,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":91,"name":"puppetlabs_repo","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":90,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":92,"name":"pxegrub2_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":8,"name":"PXEGrub2 + default local boot","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":93,"name":"pxegrub2_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":9,"name":"PXEGrub2 + global default","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":94,"name":"pxegrub2_mac","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":95,"name":"pxegrub_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":4,"name":"PXEGrub + default local boot","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":96,"name":"pxegrub_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":5,"name":"PXEGrub + global default","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":17,"name":"PXELinux + chain iPXE","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":18,"name":"PXELinux + chain iPXE UNDI","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":97,"name":"pxelinux_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":19,"name":"PXELinux + default local boot","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":20,"name":"PXELinux + default memdisk","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":98,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":21,"name":"PXELinux + global default","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":99,"name":"rancheros_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":55,"name":"RancherOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":22,"name":"RancherOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":100,"name":"redhat_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":101,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":102,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":103,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":104,"name":"schedule_reboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":110,"name":"UserData + default","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":111,"name":"UserData + open-vm-tools","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":23,"name":"WAIK + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":34,"name":"Windows + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":43,"name":"Windows + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":56,"name":"Windows + default provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":24,"name":"Windows + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":105,"name":"Windows + network","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":60,"name":"Windows + peSetup.cmd","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":57,"name":"XenServer + default answerfile","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":35,"name":"XenServer + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":25,"name":"XenServer + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":106,"name":"yum_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false}],"domains":[],"realms":[],"hostgroups":[{"id":2,"name":"CentOS + 7 converting","title":"CentOS 7 converting","description":null,"inherited":false}],"locations":[],"hosts_count":0,"parameters":[],"deprecations":{"environments":"Environments + got deprecated from this endpoint."},"simple_content_access":false,"owner_details":{"id":"ff8080817ce4eb7c017ce5d0031e0008","key":"Test_Organization","created":"2021-11-03T12:39:47+0000","updated":"2021-11-04T11:33:11+0000","lastRefreshed":null,"virt_who":false,"upstreamConsumer":null},"default_content_view_id":2,"composite_content_views_count":null,"content_view_components_count":null,"library_id":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])\nCall stack\n /home/vagrant/foreman/app/models/concerns/has_many_common.rb:96:in + `block in belongs_to_name_for''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:61:in + `show''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])"]' + content-length: + - '16965' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-6.yml b/tests/test_playbooks/fixtures/convert2rhel-6.yml new file mode 100644 index 00000000..5427143a --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-6.yml @@ -0,0 +1,466 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/activation_keys?search=name%3D%22convert2rhel_centos7%22&per_page=4294967296 + response: + body: + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_centos7\"","sort":{"by":"name","order":"asc"},"results":[{"id":7,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:34 UTC","updated_at":"2021-11-04 11:33:34 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":32,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '889' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/7?organization_id=4 + response: + body: + string: ' {"service_level":null,"content_overrides":[],"id":7,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:34 UTC","updated_at":"2021-11-04 11:33:34 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":32,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '761' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '955' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 + 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 + 12:39:46 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1224' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/subscriptions?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"organization":{},"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":5,"cp_id":"ff8080817cea1d1e017ceab95c430be2","subscription_id":5,"name":"Convert2RHEL7","start_date":"2021-11-04 + 11:33:08 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"780361625466","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '746' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/7/subscriptions?per_page=4294967296&organization_id=4 + response: + body: + string: '{"organization":{},"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":null,"sort":{"by":"name","order":"asc"},"results":[{"quantity_attached":1,"id":5,"cp_id":"ff8080817cea1d1e017ceab95c430be2","subscription_id":5,"name":"Convert2RHEL7","start_date":"2021-11-04 + 11:33:08 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"780361625466","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '748' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-7.yml b/tests/test_playbooks/fixtures/convert2rhel-7.yml new file mode 100644 index 00000000..0612741e --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-7.yml @@ -0,0 +1,352 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/activation_keys?search=name%3D%22convert2rhel_rhel7%22&per_page=4294967296 + response: + body: + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_rhel7\"","sort":{"by":"name","order":"asc"},"results":[{"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:36 UTC","updated_at":"2021-11-04 11:33:36 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '854' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/8?organization_id=4 + response: + body: + string: ' {"service_level":null,"content_overrides":[],"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 + 11:33:36 UTC","updated_at":"2021-11-04 11:33:36 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '728' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '955' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 + 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 + 12:39:46 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1224' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-8.yml b/tests/test_playbooks/fixtures/convert2rhel-8.yml new file mode 100644 index 00000000..a7b0abb3 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-8.yml @@ -0,0 +1,409 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/hostgroups?search=title%3D%22CentOS+7+converting%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"title=\\\"CentOS 7 converting\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\":null,\"domain_id\":null,\"domain_name\":null,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-11-04 + 09:50:41 UTC\",\"updated_at\":\"2021-11-04 09:50:41 UTC\",\"id\":2,\"name\":\"CentOS + 7 converting\",\"title\":\"CentOS 7 converting\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1394' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/hostgroups/2 + response: + body: + string: '{"content_source_id":null,"content_source_name":null,"content_view_id":2,"content_view_name":"Default + Organization View","lifecycle_environment_id":2,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-11-04 + 09:50:41 UTC","updated_at":"2021-11-04 09:50:41 UTC","id":2,"name":"CentOS + 7 converting","title":"CentOS 7 converting","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-11-04 + 09:50:42 UTC","updated_at":"2021-11-04 09:50:42 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"convert2rhel_centos7"}],"template_combinations":[],"locations":[],"organizations":[{"id":4,"name":"Test + Organization","title":"Test Organization","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1788' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 + 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '955' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/4/content_views?environment_id=2&search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test + Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 + 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 + 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 + 12:39:46 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 4; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1224' + status: + code: 200 + message: OK +version: 1 From 0420787d7a93a303f610a8a4eacdecced70333f7 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Thu, 14 Oct 2021 14:09:51 +0200 Subject: [PATCH 33/36] Convert2RHEL - support for Oracle 7 --- roles/convert2rhel/README.md | 2 + roles/convert2rhel/defaults/main.yml | 7 + roles/convert2rhel/tasks/activation_keys.yml | 16 + roles/convert2rhel/tasks/host_groups.yml | 13 + .../convert2rhel/tasks/products_and_repos.yml | 28 + tests/test_playbooks/convert2rhel.yml | 1 + .../fixtures/convert2rhel-1.yml | 67 +- .../fixtures/convert2rhel-10.yml | 562 +++ .../fixtures/convert2rhel-11.yml | 352 ++ .../fixtures/convert2rhel-12.yml | 474 +++ .../fixtures/convert2rhel-13.yml | 412 +++ .../fixtures/convert2rhel-2.yml | 42 +- .../fixtures/convert2rhel-3.yml | 117 +- .../fixtures/convert2rhel-4.yml | 301 +- .../fixtures/convert2rhel-5.yml | 288 +- .../fixtures/convert2rhel-6.yml | 290 +- .../fixtures/convert2rhel-7.yml | 3068 ++++++++++++++++- .../fixtures/convert2rhel-8.yml | 377 +- .../fixtures/convert2rhel-9.yml | 466 +++ 19 files changed, 6085 insertions(+), 798 deletions(-) create mode 100644 tests/test_playbooks/fixtures/convert2rhel-10.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-11.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-12.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-13.yml create mode 100644 tests/test_playbooks/fixtures/convert2rhel-9.yml diff --git a/roles/convert2rhel/README.md b/roles/convert2rhel/README.md index d597db20..817e7112 100644 --- a/roles/convert2rhel/README.md +++ b/roles/convert2rhel/README.md @@ -17,6 +17,7 @@ This role supports the [Common Role Variables](https://github.com/theforeman/for - `foreman_convert2rhel_manage_subscription`: Run [content_rhel Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/content_rhel/README.md) role, default: `true` - `foreman_convert2rhel_lifecycle_env`: Lifecycle environment for activation keys, default: Library. - `foreman_convert2rhel_content_view`: Content view for activation keys, default: Default Organization View. +- `foreman_convert2rhel_enable_oracle7`: Create data for Oracle Linux 7 conversion, default: `false` Example Playbooks ----------------- @@ -39,4 +40,5 @@ Convert2RHEL foreman_content_rhel_wait_for_syncs: false foreman_convert2rhel_lifecycle_env: "Library" foreman_convert2rhel_content_view: "Default Organization View" + foreman_convert2rhel_enable_oracle7: true ``` diff --git a/roles/convert2rhel/defaults/main.yml b/roles/convert2rhel/defaults/main.yml index c3874898..334cfc9d 100644 --- a/roles/convert2rhel/defaults/main.yml +++ b/roles/convert2rhel/defaults/main.yml @@ -6,10 +6,13 @@ foreman_convert2rhel_rhel7_product: "Convert2RHEL7" foreman_convert2rhel_rhel7_repo: "Convert2RHEL7 main" foreman_convert2rhel_rhel8_product: "Convert2RHEL8" foreman_convert2rhel_rhel8_repo: "Convert2RHEL8 main" +foreman_convert2rhel_oracle7_product: "Oracle Linux 7 Convert2RHEL" +foreman_convert2rhel_oracle7_repo: "Oracle Linux 7 Convert2RHEL main" # Activation keys foreman_convert2rhel_key_centos7: "convert2rhel_centos7" foreman_convert2rhel_key_centos8: "convert2rhel_centos8" +foreman_convert2rhel_key_oracle7: "convert2rhel_oracle7" foreman_convert2rhel_key_rhel7: "convert2rhel_rhel7" foreman_convert2rhel_key_rhel8: "convert2rhel_rhel8" foreman_convert2rhel_lifecycle_env: "Library" @@ -18,3 +21,7 @@ foreman_convert2rhel_content_view: "Default Organization View" # Host groups foreman_convert2rhel_hostgroup7: "CentOS 7 converting" foreman_convert2rhel_hostgroup8: "CentOS 8 converting" +foreman_convert2rhel_hostgroup_oracle7: "Oracle Linux 7 converting" + +# Oracle Linux +foreman_convert2rhel_enable_oracle7: false diff --git a/roles/convert2rhel/tasks/activation_keys.yml b/roles/convert2rhel/tasks/activation_keys.yml index db1ed45e..c6738003 100644 --- a/roles/convert2rhel/tasks/activation_keys.yml +++ b/roles/convert2rhel/tasks/activation_keys.yml @@ -14,6 +14,9 @@ - name: "Convert2RHEL7" foreman_convert2rhel_centos8_subs: - name: "Convert2RHEL8" + foreman_convert2rhel_ol7_subs: + - name: "Convert2RHEL7" + - name: "{{ foreman_convert2rhel_oracle7_product }}" when: not foreman_convert2rhel_org_info['organization']['simple_content_access'] - name: "Create '{{ foreman_convert2rhel_key_centos7 }}' activation key" @@ -43,6 +46,19 @@ subscriptions: "{{ foreman_convert2rhel_org_info['organization']['simple_content_access'] | ternary(omit, foreman_convert2rhel_centos8_subs) }}" when: foreman_content_rhel_enable_rhel8 +- name: "Create '{{ foreman_convert2rhel_key_oracle7 }}' activation key" + theforeman.foreman.activation_key: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_key_oracle7 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + subscriptions: "{{ foreman_convert2rhel_org_info['organization']['simple_content_access'] | ternary(omit, foreman_convert2rhel_ol7_subs) }}" + when: foreman_convert2rhel_enable_oracle7 + - name: "Create '{{ foreman_convert2rhel_key_rhel7 }}' activation key" theforeman.foreman.activation_key: username: "{{ foreman_username }}" diff --git a/roles/convert2rhel/tasks/host_groups.yml b/roles/convert2rhel/tasks/host_groups.yml index fec90cfb..4f8121c6 100644 --- a/roles/convert2rhel/tasks/host_groups.yml +++ b/roles/convert2rhel/tasks/host_groups.yml @@ -24,3 +24,16 @@ content_view: "{{ foreman_convert2rhel_content_view }}" activation_keys: "{{ foreman_convert2rhel_key_centos8 }}" when: foreman_content_rhel_enable_rhel8 + +- name: "Create '{{ foreman_convert2rhel_hostgroup_oracle7 }}' host group" + theforeman.foreman.hostgroup: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + name: "{{ foreman_convert2rhel_hostgroup_oracle7 }}" + lifecycle_environment: "{{ foreman_convert2rhel_lifecycle_env }}" + content_view: "{{ foreman_convert2rhel_content_view }}" + activation_keys: "{{ foreman_convert2rhel_key_oracle7 }}" + when: foreman_convert2rhel_enable_oracle7 diff --git a/roles/convert2rhel/tasks/products_and_repos.yml b/roles/convert2rhel/tasks/products_and_repos.yml index 2acbd226..5514b4a8 100644 --- a/roles/convert2rhel/tasks/products_and_repos.yml +++ b/roles/convert2rhel/tasks/products_and_repos.yml @@ -52,6 +52,23 @@ state: present when: foreman_content_rhel_enable_rhel8 +- name: "Create '{{ foreman_convert2rhel_oracle7_product }}' product and repositories" + include_role: + name: theforeman.foreman.repositories + vars: + foreman_products: + - name: "{{ foreman_convert2rhel_oracle7_product }}" + repositories: + - name: "{{ foreman_convert2rhel_oracle7_repo }}" + content_type: "yum" + product: "{{ foreman_convert2rhel_oracle7_product }}" + url: "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os" + mirror_on_sync: true + verify_ssl_on_sync: true + download_policy: immediate + state: present + when: foreman_convert2rhel_enable_oracle7 + - name: "Synchronize '{{ foreman_convert2rhel_rhel7_repo }}' repository" theforeman.foreman.repository_sync: username: "{{ foreman_username }}" @@ -73,3 +90,14 @@ repository: "{{ foreman_convert2rhel_rhel8_repo }}" product: "{{ foreman_convert2rhel_rhel8_product }}" when: foreman_content_rhel_enable_rhel8 + +- name: "Synchronize '{{ foreman_convert2rhel_oracle7_repo }}' repository" + theforeman.foreman.repository_sync: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organization: "{{ foreman_organization }}" + repository: "{{ foreman_convert2rhel_oracle7_repo }}" + product: "{{ foreman_convert2rhel_oracle7_product }}" + when: foreman_convert2rhel_enable_oracle7 diff --git a/tests/test_playbooks/convert2rhel.yml b/tests/test_playbooks/convert2rhel.yml index c36a1d6e..283cd5fa 100644 --- a/tests/test_playbooks/convert2rhel.yml +++ b/tests/test_playbooks/convert2rhel.yml @@ -27,3 +27,4 @@ foreman_content_rhel_wait_for_syncs: false foreman_content_rhel_enable_rhel7: true foreman_content_rhel_enable_rhel8: false + foreman_convert2rhel_enable_oracle7: true diff --git a/tests/test_playbooks/fixtures/convert2rhel-1.yml b/tests/test_playbooks/fixtures/convert2rhel-1.yml index 00510083..fc506c3f 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-1.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-1.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,7 +123,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/content_credentials?organization_id=4&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL @@ -131,10 +131,12 @@ interactions: CA","content_type":"cert","content":"-----BEGIN CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END - CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 - main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + CERTIFICATE-----\n","id":2,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:39 UTC","updated_at":"2021-11-09 09:00:39 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":4,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7"},"library_instance_id":4},{"id":5,"name":"Oracle + Linux Convert2RHEL main","content_type":"yum","product":{"id":5,"cp_id":"9480733332","name":"Oracle + Linux Convert2RHEL"},"library_instance_id":5}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -153,7 +155,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -170,8 +172,27 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])\nCall stack\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])"]' content-length: - - '8387' + - '8555' status: code: 200 message: OK @@ -194,10 +215,12 @@ interactions: CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END - CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 - main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}} + CERTIFICATE-----\n","id":2,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:39 UTC","updated_at":"2021-11-09 09:00:39 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":4,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7"},"library_instance_id":4},{"id":5,"name":"Oracle + Linux Convert2RHEL main","content_type":"yum","product":{"id":5,"cp_id":"9480733332","name":"Oracle + Linux Convert2RHEL"},"library_instance_id":5}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}} ' headers: @@ -233,8 +256,24 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])\nCall stack\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])"]' content-length: - - '8220' + - '8388' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-10.yml b/tests/test_playbooks/fixtures/convert2rhel-10.yml new file mode 100644 index 00000000..3af0e263 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-10.yml @@ -0,0 +1,562 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/activation_keys?search=name%3D%22convert2rhel_oracle7%22&per_page=4294967296 + response: + body: + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_oracle7\"","sort":{"by":"name","order":"asc"},"results":[{"id":7,"name":"convert2rhel_oracle7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:18 UTC","updated_at":"2021-11-09 11:05:18 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":4,"name":"Convert2RHEL7"},{"id":9,"name":"Oracle + Linux 7 Convert2RHEL"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '934' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/7?organization_id=3 + response: + body: + string: ' {"service_level":null,"content_overrides":[],"id":7,"name":"convert2rhel_oracle7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:18 UTC","updated_at":"2021-11-09 11:05:18 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":4,"name":"Convert2RHEL7"},{"id":9,"name":"Oracle + Linux 7 Convert2RHEL"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '806' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:32 UTC","updated_at":"2021-11-09 09:00:32 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":1001,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":3,"docker_repositories":0,"ostree_repositories":0,"products":3},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '958' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:33 UTC","updated_at":"2021-11-09 09:00:33 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-09 + 09:00:33 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":6,"name":"convert2rhel_centos7"},{"id":7,"name":"convert2rhel_oracle7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-09 + 09:00:33 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1263' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/subscriptions?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"organization":{},"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":4,"cp_id":"ff8080817d03c6cc017d03ed96c30023","subscription_id":4,"name":"Convert2RHEL7","start_date":"2021-11-09 + 09:00:41 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"561915692945","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '746' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/subscriptions?search=name%3D%22Oracle+Linux+7+Convert2RHEL%22&per_page=4294967296 + response: + body: + string: '{"organization":{},"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL\"","sort":{"by":"name","order":"asc"},"results":[{"id":9,"cp_id":"ff8080817d03f869017d0431e677002a","subscription_id":9,"name":"Oracle + Linux 7 Convert2RHEL","start_date":"2021-11-09 10:15:18 UTC","end_date":"2049-12-01 + 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"411938769108","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Oracle + Linux 7 Convert2RHEL","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '788' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/7/subscriptions?per_page=4294967296&organization_id=3 + response: + body: + string: '{"organization":{},"total":2,"subtotal":2,"selectable":2,"page":1,"per_page":"4294967296","error":null,"search":null,"sort":{"by":"name","order":"asc"},"results":[{"quantity_attached":1,"id":4,"cp_id":"ff8080817d03c6cc017d03ed96c30023","subscription_id":4,"name":"Convert2RHEL7","start_date":"2021-11-09 + 09:00:41 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"561915692945","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null},{"quantity_attached":1,"id":9,"cp_id":"ff8080817d03f869017d0431e677002a","subscription_id":9,"name":"Oracle + Linux 7 Convert2RHEL","start_date":"2021-11-09 10:15:18 UTC","end_date":"2049-12-01 + 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"411938769108","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Oracle + Linux 7 Convert2RHEL","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=92 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n Katello::Subscription =\u003e + [:organization]\n Add to your query: .includes([:organization])\nCall stack\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n","user: root\nUSE eager loading detected\n Katello::Pool =\u003e + [:hypervisor]\n Add to your query: .includes([:hypervisor])\nCall stack\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected Katello::Subscription =\u003e + [:organization]\n Add to your query: .includes([:organization])","user: root USE + eager loading detected Katello::Pool =\u003e [:hypervisor]\n Add to your + query: .includes([:hypervisor])"]' + content-length: + - '1359' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-11.yml b/tests/test_playbooks/fixtures/convert2rhel-11.yml new file mode 100644 index 00000000..53b2c9e6 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-11.yml @@ -0,0 +1,352 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/activation_keys?search=name%3D%22convert2rhel_rhel7%22&per_page=4294967296 + response: + body: + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_rhel7\"","sort":{"by":"name","order":"asc"},"results":[{"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:20 UTC","updated_at":"2021-11-09 11:05:20 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '854' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/8?organization_id=3 + response: + body: + string: ' {"service_level":null,"content_overrides":[],"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:20 UTC","updated_at":"2021-11-09 11:05:20 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '728' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:32 UTC","updated_at":"2021-11-09 09:00:32 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":1001,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":3,"docker_repositories":0,"ostree_repositories":0,"products":3},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '958' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:33 UTC","updated_at":"2021-11-09 09:00:33 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-09 + 09:00:33 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":6,"name":"convert2rhel_centos7"},{"id":7,"name":"convert2rhel_oracle7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-09 + 09:00:33 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1263' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-12.yml b/tests/test_playbooks/fixtures/convert2rhel-12.yml new file mode 100644 index 00000000..7ca85ee1 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-12.yml @@ -0,0 +1,474 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/hostgroups?search=title%3D%22CentOS+7+converting%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"title=\\\"CentOS 7 converting\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\":null,\"domain_id\":null,\"domain_name\":null,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-11-09 + 08:51:25 UTC\",\"updated_at\":\"2021-11-09 08:51:25 UTC\",\"id\":1,\"name\":\"CentOS + 7 converting\",\"title\":\"CentOS 7 converting\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\":null}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1394' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/hostgroups/1 + response: + body: + string: '{"content_source_id":null,"content_source_name":null,"content_view_id":2,"content_view_name":"Default + Organization View","lifecycle_environment_id":2,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-11-09 + 08:51:25 UTC","updated_at":"2021-11-09 08:51:25 UTC","id":1,"name":"CentOS + 7 converting","title":"CentOS 7 converting","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-11-09 + 08:51:25 UTC","updated_at":"2021-11-09 08:51:25 UTC","id":4,"name":"kt_activation_keys","parameter_type":"string","value":"convert2rhel_centos7"}],"template_combinations":[],"locations":[{"id":2,"name":"Default + Location","title":"Default Location","description":null}],"organizations":[{"id":1,"name":"Default + Organization","title":"Default Organization","description":null},{"id":3,"name":"Test + Organization","title":"Test Organization","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1957' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:32 UTC","updated_at":"2021-11-09 09:00:32 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":1001,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":3,"docker_repositories":0,"ostree_repositories":0,"products":3},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '958' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/content_views?environment_id=2&search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:33 UTC","updated_at":"2021-11-09 09:00:33 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-09 + 09:00:33 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":6,"name":"convert2rhel_centos7"},{"id":7,"name":"convert2rhel_oracle7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-09 + 09:00:33 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1263' + status: + code: 200 + message: OK +- request: + body: '{"hostgroup": {"organization_ids": [3]}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '40' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: http://foreman.example.org/api/hostgroups/1 + response: + body: + string: '{"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-11-09 + 08:51:25 UTC","updated_at":"2021-11-09 08:51:25 UTC","id":1,"name":"CentOS + 7 converting","title":"CentOS 7 converting","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-11-09 + 08:51:25 UTC","updated_at":"2021-11-09 08:51:25 UTC","id":4,"name":"kt_activation_keys","parameter_type":"string","value":"convert2rhel_centos7"}],"template_combinations":[],"locations":[{"id":2,"name":"Default + Location","title":"Default Location","description":null}],"organizations":[{"id":3,"name":"Test + Organization","title":"Test Organization","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1649' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-13.yml b/tests/test_playbooks/fixtures/convert2rhel-13.yml new file mode 100644 index 00000000..99165d34 --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-13.yml @@ -0,0 +1,412 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/hostgroups?search=title%3D%22Oracle+Linux+7+converting%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 3,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"title=\\\"Oracle Linux 7 converting\\\"\",\n + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": + []\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '192' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:32 UTC","updated_at":"2021-11-09 09:00:32 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":1001,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":3,"docker_repositories":0,"ostree_repositories":0,"products":3},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '958' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/content_views?environment_id=2&search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:33 UTC","updated_at":"2021-11-09 09:00:33 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-09 + 09:00:33 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":6,"name":"convert2rhel_centos7"},{"id":7,"name":"convert2rhel_oracle7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-09 + 09:00:33 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1263' + status: + code: 200 + message: OK +- request: + body: '{"hostgroup": {"name": "Oracle Linux 7 converting", "group_parameters_attributes": + [{"name": "kt_activation_keys", "parameter_type": "string", "value": "convert2rhel_oracle7"}], + "organization_ids": [3], "content_view_id": 2, "lifecycle_environment_id": 2}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '256' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: http://foreman.example.org/api/hostgroups + response: + body: + string: '{"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-11-11 + 08:17:09 UTC","updated_at":"2021-11-11 08:17:09 UTC","id":4,"name":"Oracle + Linux 7 converting","title":"Oracle Linux 7 converting","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-11-11 + 08:17:09 UTC","updated_at":"2021-11-11 08:17:09 UTC","id":8,"name":"kt_activation_keys","parameter_type":"string","value":"convert2rhel_oracle7"}],"template_combinations":[],"locations":[{"id":2,"name":"Default + Location","title":"Default Location","description":null}],"organizations":[{"id":3,"name":"Test + Organization","title":"Test Organization","description":"A test organization"}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +version: 1 diff --git a/tests/test_playbooks/fixtures/convert2rhel-2.yml b/tests/test_playbooks/fixtures/convert2rhel-2.yml index af9794df..3e0c5ed2 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-2.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-2.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,12 +123,12 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing - Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:43 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -147,7 +147,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -176,7 +176,7 @@ interactions: - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove from your query: .includes([:provider])"]' content-length: - - '659' + - '656' status: code: 200 message: OK @@ -192,19 +192,19 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/products/32?organization_id=4 + uri: http://foreman.example.org/katello/api/products/4?organization_id=3 response: body: - string: ' {"sync_state_aggregated":"Syncing Complete.","redhat":false,"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing - Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1,"created_at":"2021-11-04 - 11:33:08 UTC","updated_at":"2021-11-04 11:33:08 UTC","product_content":[{"enabled":true,"product_id":32,"content":{"name":"Convert2RHEL7 - main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636025591688","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"available_content":[{"enabled":true,"product_id":32,"content":{"name":"Convert2RHEL7 - main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636025591688","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"repositories":[{"name":"Convert2RHEL7 - main","id":6}],"provider":{"name":"Anonymous"},"sync_status":{"id":6,"product_id":32,"progress":{"progress":100.0},"sync_id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","state":"Syncing - Complete.","raw_state":"stopped","start_time":"1 minute ago","finish_time":"1 - minute ago","duration":"less than a minute","display_size":"No content added.","size":"No - content added.","is_running":false,"error_details":"#"},"permissions":{"view_products":true,"edit_products":true,"destroy_products":true,"sync_products":true},"published_content_view_ids":[],"active_task_count":0} + string: ' {"sync_state_aggregated":"Syncing Complete.","redhat":false,"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:43 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1,"created_at":"2021-11-09 + 09:00:41 UTC","updated_at":"2021-11-09 09:00:41 UTC","product_content":[{"enabled":true,"product_id":4,"content":{"name":"Convert2RHEL7 + main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636448445894","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"available_content":[{"enabled":true,"product_id":4,"content":{"name":"Convert2RHEL7 + main","label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","vendor":"Custom","content_url":"/custom/Convert2RHEL7/Convert2RHEL7_main","gpg_url":null,"id":"1636448445894","type":"yum","gpgUrl":null,"contentUrl":"/custom/Convert2RHEL7/Convert2RHEL7_main"}}],"repositories":[{"name":"Convert2RHEL7 + main","id":4}],"provider":{"name":"Anonymous"},"sync_status":{"id":4,"product_id":4,"progress":{"progress":100.0},"sync_id":"333097e4-0199-47ce-85ad-b2381124f731","state":"Syncing + Complete.","raw_state":"stopped","start_time":"2 days ago","finish_time":"2 + days ago","duration":"less than a minute","display_size":"No content added.","size":"No + content added.","is_running":false,"error_details":"#"},"permissions":{"view_products":true,"edit_products":true,"destroy_products":true,"sync_products":true},"published_content_view_ids":[],"active_task_count":0} ' headers: @@ -223,7 +223,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -241,7 +241,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1970' + - '1960' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-3.yml b/tests/test_playbooks/fixtures/convert2rhel-3.yml index 542bdd43..9cdc8069 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-3.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-3.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,12 +123,12 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing - Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"1 minute","organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:43 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -147,7 +147,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -176,7 +176,7 @@ interactions: - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove from your query: .includes([:provider])"]' content-length: - - '659' + - '656' status: code: 200 message: OK @@ -192,7 +192,7 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/content_credentials?organization_id=4&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Convert2RHEL+CA%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL @@ -200,10 +200,12 @@ interactions: CA","content_type":"cert","content":"-----BEGIN CERTIFICATE-----\nMIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx\nFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu\nMRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50\naXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh\nLXN1cHBvcnRAcmVkaGF0LmNvbTAeFw0xMDEwMDQxMzI3NDhaFw0zMDA5MjkxMzI3\nNDhaMIGuMQswCQYDVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAU\nBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEu\nMCwGA1UEAwwlUmVkIEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEk\nMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIICIjANBgkqhkiG\n9w0BAQEFAAOCAg8AMIICCgKCAgEA2QurMeAVnCHVsuZNQzciWMdpd4LAVk2eGugN\n0cxmBpzoVI8lIsJOmJkpOAuFOQMX9CBr8RuQyg4r1/OH/rfhm6FgGIw8TGKZoWC/\n1B9teZqTiM85k6/1GRNxdk6dUK77HVO0PMIKtNBHRxIsXcRzJ1q+u5WPBes9pEVG\nnbidTNUkknrSIdynTJcqAI/I0VAsqLqX87XJSzXKvRilE+p/fLHmVTAffl1Cn/Dy\nKULxna7ooyrKKnfqeQ5dK8aMr1ASQ1wphWohLjegly9V0amEi+HHWnOL8toxJy8v\nWUTUzzAvZ4ZTtTV26xGetZZWEaNyv7YCv2AexjcBQ2x+ejrFJrVNo9jizHS06HK8\nUgHVDKhmVcAe2/5yrJCjKDLwg1FJfjKwhzhLYdNVCejpy8CHQndwO0EX1hHv/AfP\nRTAmr5qPhHFD+uuIrYrSLUpgMLmWa9dinJcGeKlA1KJvG5emGMM3k64Xr7dJToXo\n5loGyZ6lvKPIKLmfeXMRW/4+BqyzwbO1i4aIHAZcSPDFGKWwuvF0iVUYUUVxw0nv\nqPZA4roq5+j/YSz0q5XGVgiIt34htlvunLp/ICGYJBR6zEHcB9aZGJdDcJvoYZjw\n7Gphw6lFF6Ta4imoyhGECWKjd1ips3opcN+DlU0yCUrcIXVIXAnkTwu5ocOgAkxr\nf/6FjqcCAwEAAaOCAR8wggEbMB0GA1UdDgQWBBSW/bscQED/QIStsh8LJsHDam/W\nfDCB5QYDVR0jBIHdMIHagBTESXhWRZ0eLGFgw2ZLWAU3LwMie6GBtqSBszCBsDEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHDAdS\nYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0\nIE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBDQTEkMCIGCSqG\nSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkAkYrPyoUAAAAwEgYDVR0T\nAQH/BAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOCAgEArWBznYWKpY4LqAzhOSop\nt30D2/UlCSr50l33uUCNYD4D4nTr/pyX3AR6P3JcOCz0t22pVCg8D3DZc5VlzY7y\nP5RD3KbLxFNJTloclMG0n6aIN7baA4b8zwkduMQvKZnA/YNR5xE7V7J2WJHCEBBB\nZ+ZFwGpGsoZpPZP4hHLVke3xHm6A5F5SzP1Ug0T9W80VLK4jtgyGs8l1R7rXiOIt\nNik8317KGq7DU8TI2Rw/9Gc8FKNfUYcVD7uC/MMQXJTRvkADmNLtZM63nhzpg1Hr\nhA6U5YcDCBKsPA43/wsPOONYtrAlToD5hJhU+1Rhmwcw3qvWBO3NkdilqGFOTc2K\n50PQrqoRTCZFS41nv2WqZFfbvSq4dZRJl8xpB4LAHSspsMrbr9WZHX5fbggf6ixw\nS9KDqQbM7asP0FEKBFXJV1rE8P/oSK6yVWQyigTsNcdGR4AUzDsTO9udcwoM2Ed4\nXdakVkF+dXm9ZBwv5UBf5ITSyMXL3qlusIOblJVGUQizumoq0LiSnjwbkxh2XHhd\nXD/B/qax7FnaNg+TfujR/kk3kF1OpqWx/wC/qPR+zho1+35Al31gZOfNIn/sReoM\ntcci9LFHGvijIy4VUDQK8HmGjIxJPrIIe1nB5BkiGyjwn00D5q+BwYVst1C68Rwx\niRZpyzOZmeineJvhrJZ4Tvs=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGejCCBGKgAwIBAgIJAJGKz8qFAAAIMA0GCSqGSIb3DQEBDAUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTgwOTEyMTgxMzIxWhcNMzAw\nMzE1MTgxMzIxWjCBsTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQLDA9SZWQgSGF0IE5l\ndHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50aXRsZW1lbnQgT3BlcmF0aW9ucyBB\ndXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALsmiohDnNvIpBMZVJR5pbP6\nGrE5B4doUmvTeR4XJ5C66uvFTwuGTVigNXAL+0UWf9r2AwxKEPCy65h7fLbyK4W7\n/xEZPVsamQYDHpyBwlkPkJ3WhHneqQWC8bKkv8Iqu08V+86biCDDAh6uP0SiAz7a\nNGaLEnOe5L9WNfsYyNwrG+2AfiLy/1LUtmmg5dc6Ln7R+uv0PZJ5J2iUbiT6lMz3\nv73zAxuEjiDNurZzxzHSSEYzw0W1eO6zM4F26gcOuH2BHemPMjHi+c1OnheaafDE\nHQJTNgECz5Xe7WGdZwOyn9a8GtMvm0PAhGVyp7RAWxxfoU1B794cBb66IKKjliJQ\n5DKoqyxD9qJbMF8U4Kd1ZIVB0Iy2WEaaqCFMIi3xtlWVUNku5x21ewMmJvwjnWZA\ntUeKQUFwIXqSjuOoZDu80H6NQb+4dnRSjWlx/m7HPk75m0zErshpB2HSKUnrs4wR\ni7GsWDDcqBus7eLMwUZPvDNVcLQu/2Y4DUHNbJbn7+DwEqi5D0heC+dyY8iS45gp\nI/yhVvq/GfKL+dqjaNaE4CorJJA5qJ9f383Ol/aub+aJeBahCBNuVa2daA9Bo3BA\ndnL7KkILPFyCcEhQITnu70Qn9sQlwYcRoYF2LWAm9DtLrBT0Y0w7wQHh8vNhwEQ7\nk5G87WpwzcC8y6ePR0vFAgMBAAGjgZMwgZAwHQYDVR0OBBYEFMRJeFZFnR4sYWDD\nZktYBTcvAyJ7MB8GA1UdIwQYMBaAFIhLpkXERuyP1s+m9hrPJjyQzH8XMAwGA1Ud\nEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIBBjAgBgNVHREE\nGTAXgRVjYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAGKk\nq5Ab0AC7SOCYq9up5z0twbe+gI72cm854+VhcxafnLP2/4nH6nQauKLKEFLI8+fV\nRAwYxm1f5nuEiaTvjPE0umYdgMlpEJQeGdW/+/DotDaOon1G6bSMEKFvaKcBHKqa\nkBxQ29trwMG2WN8qZ7/H3XzBvLZ+JrYr01vDSV0P4tcBFOytbMZeJr4xmfxiqWxp\nVUM9eGf6z+ngXyth8lohxGd9MMXwsaPdvM+wptp3AQpq5wFPWyfJqCd6uBxu09k1\nns3Y/sya2GHqDK4bUW6gCHO13gkYviTCIBLAlX7PDeK5nYVcq8HvTLU9+H9BFGix\nYGDdHphz7i5qO/gLLLcfKhENP6jtbe8i6nwqeDzj+DMy38iMWNYFVWn1OrBaQMtf\nwlVfyRJij9SfyiUAVFld1RoPAN/haf1VmF/0dGrOigibYijqnHvDJffMUND/sbk8\ndf6O6VYjvLLlwry4W4dHiLLA7NAHGtkUv2g1+oH1lQIfRG+PvZhWz4pGT1AlzfwD\naXUfX2X+Bo9tYr9BGy5Li1pLGLvfw+an7cBAbBaw8+HhAHt+Vm4F03KX/bHlge0a\nfMYK6FoA/xQSaZ6IPm4HfPSMvhboguVG+/AZQN4/UxjDleoEz8b0CWYafcJRRZch\nBdxBjTy7JLf3j0HCbenZQF83wwtrSmiTOTK1tLsm\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD\nVQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp\nZ2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0\nd29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN\nAQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw\nMzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s\naW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw\nFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h\nc3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC\nIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2\ncsMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV\no3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O\nscgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw\nMiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW\nE8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4\netgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit\nCLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq\nrevM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU\nojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ\nDGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs\nbfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP\npvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB\ntqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw\nDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL\nDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD\nQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ\n5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG\nMCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj\nYS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr\n6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE\ngH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE\nOpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM\n8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G\nEm8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn\npYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+\n/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL\nYf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f\ng0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW\n3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9\nKg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC\n-----END - CERTIFICATE-----\n","id":2,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:07 UTC","updated_at":"2021-11-04 11:33:07 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":6,"name":"Convert2RHEL7 - main","content_type":"yum","product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7"},"library_instance_id":6}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + CERTIFICATE-----\n","id":2,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:39 UTC","updated_at":"2021-11-09 09:00:39 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[{"id":4,"name":"Convert2RHEL7 + main","content_type":"yum","product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7"},"library_instance_id":4},{"id":5,"name":"Oracle + Linux Convert2RHEL main","content_type":"yum","product":{"id":5,"cp_id":"9480733332","name":"Oracle + Linux Convert2RHEL"},"library_instance_id":5}],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -222,7 +224,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -239,8 +241,27 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])\nCall stack\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected Katello::RootRepository =\u003e + [:product]\n Add to your query: .includes([:product])"]' content-length: - - '8387' + - '8555' status: code: 200 message: OK @@ -256,16 +277,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/products/32/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/products/4/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7 - main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 - 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"1a134c99-53ed-4456-b864-ee8aaaa3c1c2","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/0b249af7-6da0-4313-b6ee-89c6acf36e09/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/7c43c8a6-9ca7-4cbe-a2de-e54f02b3b4eb/","publication_href":"/pulp/api/v3/publications/rpm/rpm/15c3e895-783f-4dd5-b1ed-f8037c1b9821/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"333097e4-0199-47ce-85ad-b2381124f731","username":"admin","started_at":"2021-11-09 + 11:03:43 UTC","ended_at":"2021-11-09 11:03:52 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default Organization View"},"content_view_version":{"id":2,"name":"Default Organization - View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 - minute"}]} + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636448445894","generic_remote_options":null,"major":null,"minor":null,"product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"2 + days"}]} ' headers: @@ -301,8 +322,24 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' content-length: - - '1813' + - '1810' status: code: 200 message: OK @@ -318,17 +355,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/repositories/6 + uri: http://foreman.example.org/katello/api/repositories/4 response: body: - string: ' {"ostree_branches":[],"relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2021-11-04 - 11:33:25 UTC","organization_id":4,"organization":{"name":"Test Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:10 UTC","updated_at":"2021-11-04 11:33:12 UTC","backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 - 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + string: ' {"ostree_branches":[],"relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2021-11-09 + 09:01:04 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:44 UTC","updated_at":"2021-11-09 09:00:46 UTC","backend_identifier":"1a134c99-53ed-4456-b864-ee8aaaa3c1c2","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","version_href":"/pulp/api/v3/repositories/rpm/rpm/0b249af7-6da0-4313-b6ee-89c6acf36e09/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/7c43c8a6-9ca7-4cbe-a2de-e54f02b3b4eb/","publication_href":"/pulp/api/v3/publications/rpm/rpm/15c3e895-783f-4dd5-b1ed-f8037c1b9821/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"333097e4-0199-47ce-85ad-b2381124f731","username":"admin","started_at":"2021-11-09 + 11:03:43 UTC","ended_at":"2021-11-09 11:03:52 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default Organization View"},"content_view_version":{"id":2,"name":"Default Organization - View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 - minute","environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"mirror_on_sync":true,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":2,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"ostree_upstream_sync_policy":null,"ostree_upstream_sync_depth":null,"computed_ostree_upstream_sync_depth":0,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"gpg_key":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":2,"name":"Convert2RHEL + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636448445894","generic_remote_options":null,"major":null,"minor":null,"product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"2 + days","environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"mirror_on_sync":true,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":2,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"ostree_upstream_sync_policy":null,"ostree_upstream_sync_depth":null,"computed_ostree_upstream_sync_depth":0,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"gpg_key":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":2,"name":"Convert2RHEL CA"},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"permissions":{"deletable":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' @@ -365,8 +402,26 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' content-length: - - '3041' + - '3038' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-4.yml b/tests/test_playbooks/fixtures/convert2rhel-4.yml index b0f44ef5..d5b97634 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-4.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-4.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,12 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Oracle+Linux+7+Convert2RHEL%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing - Complete.","last_sync":"2021-11-08 09:40:07 UTC","last_sync_words":"2 minutes","organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"sync_plan":null,"repository_count":1}]} + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL\"","sort":{"by":"name","order":"asc"},"results":[{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:57 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -147,7 +149,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -176,7 +178,7 @@ interactions: - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove from your query: .includes([:provider])"]' content-length: - - '660' + - '698' status: code: 200 message: OK @@ -192,16 +194,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/products/32/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/products/9?organization_id=3 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7 - main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"31f3b2f2-0aff-4347-b25a-1419477dad25","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/4180bec4-e8b7-4268-ac08-387306bb86f1/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/b8f503bb-eba9-4f72-a0ea-d8c186aeebe1/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3d512cf0-f408-43d4-a35b-adf9324dbbe3/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"92bc0c64-3f80-4c6b-a4e2-2026f77d6ea1","username":"admin","started_at":"2021-11-08 - 09:40:07 UTC","ended_at":"2021-11-08 09:40:26 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default - Organization View"},"content_view_version":{"id":2,"name":"Default Organization - View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636025591688","generic_remote_options":null,"major":null,"minor":null,"product":{"id":32,"cp_id":"780361625466","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"1 - minute"}]} + string: ' {"sync_state_aggregated":"Syncing Complete.","redhat":false,"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:57 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1,"created_at":"2021-11-09 + 10:15:18 UTC","updated_at":"2021-11-09 10:15:18 UTC","product_content":[{"enabled":true,"product_id":9,"content":{"name":"Oracle + Linux 7 Convert2RHEL main","label":"Test_Organization_Oracle_Linux_7_Convert2RHEL_Oracle_Linux_7_Convert2RHEL_main","vendor":"Custom","content_url":"/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main","gpg_url":null,"id":"1636452922233","type":"yum","gpgUrl":null,"contentUrl":"/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main"}}],"available_content":[{"enabled":true,"product_id":9,"content":{"name":"Oracle + Linux 7 Convert2RHEL main","label":"Test_Organization_Oracle_Linux_7_Convert2RHEL_Oracle_Linux_7_Convert2RHEL_main","vendor":"Custom","content_url":"/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main","gpg_url":null,"id":"1636452922233","type":"yum","gpgUrl":null,"contentUrl":"/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main"}}],"repositories":[{"name":"Oracle + Linux 7 Convert2RHEL main","id":9}],"provider":{"name":"Anonymous"},"sync_status":{"id":9,"product_id":9,"progress":{"progress":100.0},"sync_id":"63c8ff5b-d33d-4ab4-b434-6d97d05de1ed","state":"Syncing + Complete.","raw_state":"stopped","start_time":"2 days ago","finish_time":"2 + days ago","duration":"1 minute","display_size":"Added Rpms: 999","size":"Added + Rpms: 999","is_running":false,"error_details":"#"},"permissions":{"view_products":true,"edit_products":true,"destroy_products":true,"sync_products":true},"published_content_view_ids":[],"active_task_count":0} ' headers: @@ -220,7 +226,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - ; ANY + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -238,266 +244,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1813' - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: http://foreman.example.org/katello/api/repositories/6/sync - response: - body: - string: ' {"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize - repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization - ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 - UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"repository":{"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test - Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository - ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization - ''Test Organization''","link":"/organizations/4/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2021-11-08 - 09:41:39 UTC","available_actions":{"cancellable":false,"resumable":false}} - - ' - headers: - Cache-Control: - - no-cache - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=96 - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f - response: - body: - string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize - repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization - ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 - UTC","ended_at":null,"duration":"00:00:05.068979","state":"running","result":"pending","progress":0.08,"input":{"repository":{"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test - Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository - ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization - ''Test Organization''","link":"/organizations/4/edit"}]],"output":"Waiting - to start.\n--------------------------------","errors":[]},"cli_example":null,"start_at":"2021-11-08 - 09:41:39 UTC","available_actions":{"cancellable":true,"resumable":false}}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=95 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '1609' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f - response: - body: - string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize - repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization - ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 - UTC","ended_at":null,"duration":"00:00:09.679269","state":"running","result":"pending","progress":0.46,"input":{"repository":{"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test - Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"64c238a4-572a-4234-bee6-9bcb7a230ad6","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository - ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization - ''Test Organization''","link":"/organizations/4/edit"}]],"output":"Total steps: - 13/13\n--------------------------------\nAssociating Content: 0/0\nDownloading - Artifacts: 0/0\nDownloading Metadata Files: 9/9\nParsed Advisories: 2/2\nParsed - Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-08 - 09:41:39 UTC","available_actions":{"cancellable":true,"resumable":false}}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=94 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '1791' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/foreman_tasks/api/tasks/0b634483-1db2-499e-922a-611c72aa0d1f - response: - body: - string: '{"id":"0b634483-1db2-499e-922a-611c72aa0d1f","label":"Actions::Katello::Repository::Sync","pending":false,"action":"Synchronize - repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization - ''Test Organization''","username":"admin","started_at":"2021-11-08 09:41:39 - UTC","ended_at":"2021-11-08 09:41:52 UTC","duration":"00:00:13.149","state":"stopped","result":"success","progress":1.0,"input":{"repository":{"id":6,"name":"Convert2RHEL7 - main","label":"Convert2RHEL7_main"},"product":{"id":32,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"780361625466"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":4,"name":"Test - Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":6,"sync_result":{"publication_provided":false,"contents_changed":false},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"de2f72a9-fc79-47ec-aa60-bbc94cb638fb","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository - ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/32/"}],["organization",{"text":"organization - ''Test Organization''","link":"/organizations/4/edit"}]],"output":"No content - added.\nTotal steps: 13/13\n--------------------------------\nAssociating - Content: 0/0\nDownloading Artifacts: 0/0\nDownloading Metadata Files: 9/9\nParsed - Advisories: 2/2\nParsed Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: - 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-08 09:41:39 UTC","available_actions":{"cancellable":false,"resumable":false}}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=93 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '1734' + - '2184' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-5.yml b/tests/test_playbooks/fixtures/convert2rhel-5.yml index 42d947ea..c6ad5964 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-5.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-5.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,110 +123,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Oracle+Linux+7+Convert2RHEL%22&per_page=4294967296 response: body: - string: '{"label":"Test_Organization","redhat_repository_url":"https://cdn.redhat.com","system_purposes":{"addons":[],"roles":[],"usage":[],"support_level":[],"support_type":[]},"service_levels":[],"service_level":null,"select_all_types":[],"description":"A - test organization","created_at":"2021-11-03 12:39:45 UTC","updated_at":"2021-11-03 - 12:39:48 UTC","ancestry":null,"parent_id":null,"parent_name":null,"id":4,"name":"Test - Organization","title":"Test Organization","users":[{"id":5,"login":"manager","description":"","inherited":false}],"smart_proxies":[{"name":"centos7-katello-devel-stable.example.com","id":1,"url":"http://centos7-katello-devel-stable.example.com:8000","inherited":false}],"subnets":[],"compute_resources":[],"media":[],"ptables":[{"description":null,"os_family":"Suse","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST entire - SCSI disk","id":112,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST entire - virtual disk","id":113,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"AutoYaST LVM","id":114,"inherited":false},{"description":null,"os_family":"Coreos","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"CoreOS default - fake","id":115,"inherited":false},{"description":null,"os_family":"Rancheros","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"Empty","id":116,"inherited":false},{"description":null,"os_family":"Freebsd","created_at":"2021-10-20 - 23:54:42 UTC","updated_at":"2021-10-20 23:54:42 UTC","name":"FreeBSD default - fake","id":117,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Jumpstart default","id":118,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Jumpstart mirrored","id":119,"inherited":false},{"description":null,"os_family":"Junos","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Junos default - fake","id":120,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart custom","id":121,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart default","id":122,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart default - thin","id":123,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Kickstart dynamic","id":124,"inherited":false},{"description":null,"os_family":"NXOS","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"NX-OS default - fake","id":125,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Preseed default","id":126,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Preseed default - LVM","id":127,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Windows default - GPT EFI partition table","id":129,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"Windows default - partition table","id":128,"inherited":false},{"description":null,"os_family":"Xenserver","created_at":"2021-10-20 - 23:54:43 UTC","updated_at":"2021-10-20 23:54:43 UTC","name":"XenServer default","id":130,"inherited":false}],"provisioning_templates":[{"id":44,"name":"Alterator - default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":28,"name":"Alterator - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":10,"name":"Alterator - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":61,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":62,"name":"ansible_provisioning_callback","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":63,"name":"ansible_tower_callback_script","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":64,"name":"ansible_tower_callback_service","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":45,"name":"Atomic - Kickstart default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":46,"name":"AutoYaST - default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":37,"name":"AutoYaST - default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":11,"name":"AutoYaST - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":107,"name":"AutoYaST - default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":47,"name":"AutoYaST - SLES default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":65,"name":"blacklist_kernel_modules","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":66,"name":"bmc_nic_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":67,"name":"built","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":68,"name":"chef_client","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":27,"name":"CloudInit - default","template_kind_id":12,"template_kind_name":"cloud-init","inherited":false},{"id":69,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":48,"name":"CoreOS - provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":12,"name":"CoreOS - PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":70,"name":"create_users","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":71,"name":"csr_attributes.yaml","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":72,"name":"efibootmgr_netboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":73,"name":"eject_cdrom","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":74,"name":"epel","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":75,"name":"fips_packages","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":76,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":29,"name":"FreeBSD - (mfsBSD) finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":49,"name":"FreeBSD - (mfsBSD) provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":13,"name":"FreeBSD - (mfsBSD) PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":77,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":58,"name":"Global - Registration","template_kind_id":13,"template_kind_name":"registration","inherited":false},{"id":59,"name":"Grubby - default","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":78,"name":"http_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":79,"name":"insights","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":38,"name":"iPXE - default local boot","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":39,"name":"iPXE - global default","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":40,"name":"iPXE - intermediate script","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":50,"name":"Jumpstart - default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":30,"name":"Jumpstart - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":2,"name":"Jumpstart - default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":31,"name":"Junos - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":51,"name":"Junos - default SLAX","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":26,"name":"Junos - default ZTP config","template_kind_id":10,"template_kind_name":"ZTP","inherited":false},{"id":52,"name":"Kickstart - default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":32,"name":"Kickstart - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":41,"name":"Kickstart - default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":3,"name":"Kickstart - default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":6,"name":"Kickstart - default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":14,"name":"Kickstart - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":108,"name":"Kickstart - default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":81,"name":"kickstart_ifcfg_bonded_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":80,"name":"kickstart_ifcfg_bond_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":82,"name":"kickstart_ifcfg_generic_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":83,"name":"kickstart_ifcfg_get_identifier_names","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":84,"name":"kickstart_kernel_options","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":85,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":53,"name":"Kickstart - oVirt-RHVH","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":15,"name":"Kickstart - oVirt-RHVH PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":36,"name":"Linux - host_init_config default","template_kind_id":1,"template_kind_name":"host_init_config","inherited":false},{"id":86,"name":"ntp","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":1,"name":"NX-OS - default POAP setup","template_kind_id":11,"template_kind_name":"POAP","inherited":false},{"id":87,"name":"pkg_manager","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":54,"name":"Preseed - default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":33,"name":"Preseed - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":42,"name":"Preseed - default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":7,"name":"Preseed - default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":16,"name":"Preseed - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":109,"name":"Preseed - default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":88,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":89,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":91,"name":"puppetlabs_repo","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":90,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":92,"name":"pxegrub2_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":8,"name":"PXEGrub2 - default local boot","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":93,"name":"pxegrub2_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":9,"name":"PXEGrub2 - global default","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":94,"name":"pxegrub2_mac","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":95,"name":"pxegrub_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":4,"name":"PXEGrub - default local boot","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":96,"name":"pxegrub_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":5,"name":"PXEGrub - global default","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":17,"name":"PXELinux - chain iPXE","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":18,"name":"PXELinux - chain iPXE UNDI","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":97,"name":"pxelinux_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":19,"name":"PXELinux - default local boot","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":20,"name":"PXELinux - default memdisk","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":98,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":21,"name":"PXELinux - global default","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":99,"name":"rancheros_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":55,"name":"RancherOS - provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":22,"name":"RancherOS - PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":100,"name":"redhat_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":101,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":102,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":103,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":104,"name":"schedule_reboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":110,"name":"UserData - default","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":111,"name":"UserData - open-vm-tools","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":23,"name":"WAIK - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":34,"name":"Windows - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":43,"name":"Windows - default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":56,"name":"Windows - default provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":24,"name":"Windows - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":105,"name":"Windows - network","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":60,"name":"Windows - peSetup.cmd","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":57,"name":"XenServer - default answerfile","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":35,"name":"XenServer - default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":25,"name":"XenServer - default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":106,"name":"yum_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false}],"domains":[],"realms":[],"hostgroups":[{"id":2,"name":"CentOS - 7 converting","title":"CentOS 7 converting","description":null,"inherited":false}],"locations":[],"hosts_count":0,"parameters":[],"deprecations":{"environments":"Environments - got deprecated from this endpoint."},"simple_content_access":false,"owner_details":{"id":"ff8080817ce4eb7c017ce5d0031e0008","key":"Test_Organization","created":"2021-11-03T12:39:47+0000","updated":"2021-11-04T11:33:11+0000","lastRefreshed":null,"virt_who":false,"upstreamConsumer":null},"default_content_view_id":2,"composite_content_views_count":null,"content_view_components_count":null,"library_id":2}' + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL\"","sort":{"by":"name","order":"asc"},"results":[{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:57 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} + + ' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -243,7 +149,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - ; ANY + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -261,14 +167,166 @@ interactions: X-XSS-Protection: - 1; mode=block X-bullet-console-text: - - '["user: root\nUSE eager loading detected\n ProvisioningTemplate =\u003e - [:template_kind]\n Add to your query: .includes([:template_kind])\nCall stack\n /home/vagrant/foreman/app/models/concerns/has_many_common.rb:96:in - `block in belongs_to_name_for''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in - `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in - `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' + content-length: + - '698' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/products/9/repositories?search=name%3D%22Oracle+Linux+7+Convert2RHEL+main%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"f8fa2a37-c9d6-46a4-8865-a2dc916d973b","relative_path":"Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/65e871ff-f56b-4c0a-8856-6ffa146aedb9/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ac792dec-e2d8-45a6-a84d-b60f112ff319/","publication_href":"/pulp/api/v3/publications/rpm/rpm/38b55529-e510-4d1c-a9dd-8b6b7a44e9b4/","content_counts":{"rpm":999,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main","description":null,"content_view_versions":[],"last_sync":{"id":"63c8ff5b-d33d-4ab4-b434-6d97d05de1ed","username":"admin","started_at":"2021-11-09 + 11:03:57 UTC","ended_at":"2021-11-09 11:05:08 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os","arch":"noarch","os_versions":[],"content_id":"1636452922233","generic_remote_options":null,"major":null,"minor":null,"product":{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Oracle_Linux_7_Convert2RHEL_Oracle_Linux_7_Convert2RHEL_main","last_sync_words":"2 + days"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' + content-length: + - '1970' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/repositories/9 + response: + body: + string: ' {"ostree_branches":[],"relative_path":"Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2021-11-09 + 11:05:03 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 10:15:21 UTC","updated_at":"2021-11-09 10:15:22 UTC","backend_identifier":"f8fa2a37-c9d6-46a4-8865-a2dc916d973b","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main/","version_href":"/pulp/api/v3/repositories/rpm/rpm/65e871ff-f56b-4c0a-8856-6ffa146aedb9/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ac792dec-e2d8-45a6-a84d-b60f112ff319/","publication_href":"/pulp/api/v3/publications/rpm/rpm/38b55529-e510-4d1c-a9dd-8b6b7a44e9b4/","content_counts":{"rpm":999,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main","description":null,"content_view_versions":[],"last_sync":{"id":"63c8ff5b-d33d-4ab4-b434-6d97d05de1ed","username":"admin","started_at":"2021-11-09 + 11:03:57 UTC","ended_at":"2021-11-09 11:05:08 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os","arch":"noarch","os_versions":[],"content_id":"1636452922233","generic_remote_options":null,"major":null,"minor":null,"product":{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Oracle_Linux_7_Convert2RHEL_Oracle_Linux_7_Convert2RHEL_main","last_sync_words":"2 + days","environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"mirror_on_sync":true,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"ostree_upstream_sync_policy":null,"ostree_upstream_sync_depth":null,"computed_ostree_upstream_sync_depth":0,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"gpg_key":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"permissions":{"deletable":true},"upstream_password_exists":false,"upstream_auth_exists":false} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in - `render''\n /home/vagrant/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:61:in - `show''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in @@ -278,10 +336,10 @@ interactions: `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call''\n\n"]' X-bullet-footer-text: - - '["user: root USE eager loading detected ProvisioningTemplate =\u003e - [:template_kind]\n Add to your query: .includes([:template_kind])"]' + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' content-length: - - '16965' + - '3177' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-6.yml b/tests/test_playbooks/fixtures/convert2rhel-6.yml index 5427143a..d1ed46c1 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-6.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-6.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,13 +123,12 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/activation_keys?search=name%3D%22convert2rhel_centos7%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 response: body: - string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_centos7\"","sort":{"by":"name","order":"asc"},"results":[{"id":7,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:34 UTC","updated_at":"2021-11-04 11:33:34 UTC","content_view":{"id":2,"name":"Default - Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":32,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","label":"Convert2RHEL7","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:43 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -148,7 +147,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -165,8 +164,19 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' content-length: - - '889' + - '656' status: code: 200 message: OK @@ -182,13 +192,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/activation_keys/7?organization_id=4 + uri: http://foreman.example.org/katello/api/products/4/repositories?search=name%3D%22Convert2RHEL7+main%22&per_page=4294967296 response: body: - string: ' {"service_level":null,"content_overrides":[],"id":7,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:34 UTC","updated_at":"2021-11-04 11:33:34 UTC","content_view":{"id":2,"name":"Default - Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":32,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7 + main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"1a134c99-53ed-4456-b864-ee8aaaa3c1c2","relative_path":"Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Convert2RHEL7/Convert2RHEL7_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/0b249af7-6da0-4313-b6ee-89c6acf36e09/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/7c43c8a6-9ca7-4cbe-a2de-e54f02b3b4eb/","publication_href":"/pulp/api/v3/publications/rpm/rpm/15c3e895-783f-4dd5-b1ed-f8037c1b9821/","content_counts":{"rpm":2,"erratum":2,"package_group":0,"srpm":0,"module_stream":0},"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main","description":null,"content_view_versions":[],"last_sync":{"id":"333097e4-0199-47ce-85ad-b2381124f731","username":"admin","started_at":"2021-11-09 + 11:03:43 UTC","ended_at":"2021-11-09 11:03:52 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/","arch":"noarch","os_versions":[],"content_id":"1636448445894","generic_remote_options":null,"major":null,"minor":null,"product":{"id":4,"cp_id":"561915692945","name":"Convert2RHEL7","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Convert2RHEL7_Convert2RHEL7_main","last_sync_words":"2 + days"}]} ' headers: @@ -207,7 +220,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: @@ -224,13 +237,29 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' content-length: - - '761' + - '1810' status: code: 200 message: OK - request: - body: null + body: '{}' headers: Accept: - application/json;version=2 @@ -238,20 +267,30 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + method: POST + uri: http://foreman.example.org/katello/api/repositories/4/sync response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + string: ' {"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"32563bf6-4695-4f7b-a3d0-14c6db78eb69","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:31 UTC","available_actions":{"cancellable":false,"resumable":false}} ' headers: Cache-Control: - - max-age=0, private, must-revalidate + - no-cache Connection: - Keep-Alive Content-Security-Policy: @@ -265,11 +304,72 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - timeout=15, max=96 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/94e8b979-1776-4b7c-b62e-e1b8bbef2082 + response: + body: + string: '{"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":null,"duration":"00:00:04.843006","state":"running","result":"pending","progress":0.08,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"32563bf6-4695-4f7b-a3d0-14c6db78eb69","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Waiting + to start.\n--------------------------------","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:31 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 Vary: - Accept-Encoding X-Content-Type-Options: @@ -283,7 +383,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '955' + - '1607' status: code: 200 message: OK @@ -299,18 +399,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + uri: http://foreman.example.org/foreman_tasks/api/tasks/94e8b979-1776-4b7c-b62e-e1b8bbef2082 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default - Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default - Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 - 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 - 12:39:46 UTC"}]} - - ' + string: '{"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":null,"duration":"00:00:09.007691","state":"running","result":"pending","progress":0.08,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"32563bf6-4695-4f7b-a3d0-14c6db78eb69","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 2/2\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 2/2","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:31 UTC","available_actions":{"cancellable":true,"resumable":false}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -327,11 +429,11 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=95 + - timeout=15, max=94 Vary: - Accept-Encoding X-Content-Type-Options: @@ -345,7 +447,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1224' + - '1693' status: code: 200 message: OK @@ -361,13 +463,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/subscriptions?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + uri: http://foreman.example.org/foreman_tasks/api/tasks/94e8b979-1776-4b7c-b62e-e1b8bbef2082 response: body: - string: '{"organization":{},"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":5,"cp_id":"ff8080817cea1d1e017ceab95c430be2","subscription_id":5,"name":"Convert2RHEL7","start_date":"2021-11-04 - 11:33:08 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"780361625466","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} - - ' + string: '{"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":null,"duration":"00:00:13.137675","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"32563bf6-4695-4f7b-a3d0-14c6db78eb69","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 2/2\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 2/2","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:31 UTC","available_actions":{"cancellable":true,"resumable":false}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -384,11 +493,11 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=94 + - timeout=15, max=93 Vary: - Accept-Encoding X-Content-Type-Options: @@ -402,7 +511,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '746' + - '1693' status: code: 200 message: OK @@ -418,13 +527,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/activation_keys/7/subscriptions?per_page=4294967296&organization_id=4 + uri: http://foreman.example.org/foreman_tasks/api/tasks/94e8b979-1776-4b7c-b62e-e1b8bbef2082 response: body: - string: '{"organization":{},"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":null,"sort":{"by":"name","order":"asc"},"results":[{"quantity_attached":1,"id":5,"cp_id":"ff8080817cea1d1e017ceab95c430be2","subscription_id":5,"name":"Convert2RHEL7","start_date":"2021-11-04 - 11:33:08 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"780361625466","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} - - ' + string: '{"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":null,"duration":"00:00:17.344865","state":"running","result":"pending","progress":0.48,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"32563bf6-4695-4f7b-a3d0-14c6db78eb69","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 14/14\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 1/1\nDownloading Metadata Files: 9/9\nParsed Advisories: 2/2\nParsed + Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:31 UTC","available_actions":{"cancellable":true,"resumable":false}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -441,11 +558,76 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=93 + - timeout=15, max=92 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1789' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/94e8b979-1776-4b7c-b62e-e1b8bbef2082 + response: + body: + string: '{"id":"94e8b979-1776-4b7c-b62e-e1b8bbef2082","label":"Actions::Katello::Repository::Sync","pending":false,"action":"Synchronize + repository ''Convert2RHEL7 main''; product ''Convert2RHEL7''; organization + ''Test Organization''","username":"admin","started_at":"2021-11-11 08:13:31 + UTC","ended_at":"2021-11-11 08:13:49 UTC","duration":"00:00:17.927","state":"stopped","result":"success","progress":1.0,"input":{"repository":{"id":4,"name":"Convert2RHEL7 + main","label":"Convert2RHEL7_main"},"product":{"id":4,"name":"Convert2RHEL7","label":"Convert2RHEL7","cp_id":"561915692945"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":4,"sync_result":{"publication_provided":false,"contents_changed":false},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f262451-76d0-4a75-a49c-39d0e74b9e41","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Convert2RHEL7 main''","link":null}],["product",{"text":"product ''Convert2RHEL7''","link":"/products/4/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"No content + added.\nTotal steps: 14/14\n--------------------------------\nAssociating + Content: 0/0\nDownloading Artifacts: 1/1\nDownloading Metadata Files: 9/9\nParsed + Advisories: 2/2\nParsed Comps: 0/0\nParsed Packages: 2/2\nUn-Associating Content: + 0/0","errors":[]},"cli_example":null,"start_at":"2021-11-11 08:13:31 UTC","available_actions":{"cancellable":false,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=91 Vary: - Accept-Encoding X-Content-Type-Options: @@ -459,7 +641,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '748' + - '1732' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-7.yml b/tests/test_playbooks/fixtures/convert2rhel-7.yml index 0612741e..fdc33210 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-7.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-7.yml @@ -70,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -123,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/activation_keys?search=name%3D%22convert2rhel_rhel7%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Oracle+Linux+7+Convert2RHEL%22&per_page=4294967296 response: body: - string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_rhel7\"","sort":{"by":"name","order":"asc"},"results":[{"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:36 UTC","updated_at":"2021-11-04 11:33:36 UTC","content_view":{"id":2,"name":"Default - Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL\"","sort":{"by":"name","order":"asc"},"results":[{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","description":null,"provider_id":3,"sync_plan_id":null,"sync_summary":{"success":1},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":"Syncing + Complete.","last_sync":"2021-11-09 11:03:57 UTC","last_sync_words":"2 days","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -148,7 +149,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - 3; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: @@ -165,8 +166,19 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nAVOID eager loading detected\n Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])\nCall stack\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root AVOID eager loading detected Katello::Product =\u003e [:provider]\n Remove + from your query: .includes([:provider])"]' content-length: - - '854' + - '698' status: code: 200 message: OK @@ -182,13 +194,17 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/activation_keys/8?organization_id=4 + uri: http://foreman.example.org/katello/api/products/9/repositories?search=name%3D%22Oracle+Linux+7+Convert2RHEL+main%22&per_page=4294967296 response: body: - string: ' {"service_level":null,"content_overrides":[],"id":8,"name":"convert2rhel_rhel7","description":null,"unlimited_hosts":true,"auto_attach":false,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-04 - 11:33:36 UTC","updated_at":"2021-11-04 11:33:36 UTC","content_view":{"id":2,"name":"Default - Organization View"},"environment":{"name":"Library","id":2},"products":[],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Oracle + Linux 7 Convert2RHEL main\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"f8fa2a37-c9d6-46a4-8865-a2dc916d973b","relative_path":"Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main","container_repository_name":null,"full_path":"https://centos7-katello-devel-stable.example.com/pulp/content/Test_Organization/Library/custom/Oracle_Linux_7_Convert2RHEL/Oracle_Linux_7_Convert2RHEL_main/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/65e871ff-f56b-4c0a-8856-6ffa146aedb9/versions/1/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ac792dec-e2d8-45a6-a84d-b60f112ff319/","publication_href":"/pulp/api/v3/publications/rpm/rpm/38b55529-e510-4d1c-a9dd-8b6b7a44e9b4/","content_counts":{"rpm":999,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main","description":null,"content_view_versions":[],"last_sync":{"id":"63c8ff5b-d33d-4ab4-b434-6d97d05de1ed","username":"admin","started_at":"2021-11-09 + 11:03:57 UTC","ended_at":"2021-11-09 11:05:08 UTC","state":"stopped","result":"success","progress":1.0},"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os","arch":"noarch","os_versions":[],"content_id":"1636452922233","generic_remote_options":null,"major":null,"minor":null,"product":{"id":9,"cp_id":"411938769108","name":"Oracle + Linux 7 Convert2RHEL","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Oracle_Linux_7_Convert2RHEL_Oracle_Linux_7_Convert2RHEL_main","last_sync_words":"2 + days"}]} ' headers: @@ -207,7 +223,7 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: @@ -224,13 +240,29 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])\nCall stack\n /home/vagrant/foreman/app/models/smart_proxy.rb:91:in + `smart_proxy_feature_by_name''\n /home/vagrant/foreman/app/models/smart_proxy.rb:108:in + `setting''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected SmartProxy =\u003e [:smart_proxy_features]\n Add + to your query: .includes([:smart_proxy_features])"]' content-length: - - '728' + - '1970' status: code: 200 message: OK - request: - body: null + body: '{}' headers: Accept: - application/json;version=2 @@ -238,20 +270,32 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + method: POST + uri: http://foreman.example.org/katello/api/repositories/9/sync response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + string: ' {"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":false,"resumable":false}} ' headers: Cache-Control: - - max-age=0, private, must-revalidate + - no-cache Connection: - Keep-Alive Content-Security-Policy: @@ -265,11 +309,74 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - timeout=15, max=96 + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:04.822582","state":"running","result":"pending","progress":0.08,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Waiting + to start.\n--------------------------------","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 Vary: - Accept-Encoding X-Content-Type-Options: @@ -283,7 +390,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '955' + - '1719' status: code: 200 message: OK @@ -299,18 +406,22 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default - Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default - Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 - 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 - 12:39:46 UTC"}]} - - ' + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:08.959818","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 8/8\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 8/8","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -327,11 +438,2892 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization + - ; ANY Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=95 + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1805' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:13.080493","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 8/8\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 8/8","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1805' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:17.214382","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1008/1008\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 0/0\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=92 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1880' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:21.327871","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1035/1035\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 27/27\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=91 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1882' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:25.442715","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1064/1064\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 56/56\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=90 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1882' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:29.541404","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1087/1087\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 79/79\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=89 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1882' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:33.632787","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1110/1110\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 102/102\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=88 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:37.767589","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1134/1134\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 126/126\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=87 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:41.901516","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1148/1148\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 140/140\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=86 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:46.008035","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1148/1148\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 140/140\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=85 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:50.135923","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1195/1195\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 187/187\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=84 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:54.248045","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1195/1195\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 187/187\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=83 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:00:58.358543","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1256/1256\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 248/248\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=82 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:02.469937","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1256/1256\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 248/248\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=81 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:06.577128","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1310/1310\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 302/302\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=80 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:10.706376","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1310/1310\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 302/302\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=79 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:14.859023","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1353/1353\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 345/345\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=78 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:19.045134","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1353/1353\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 345/345\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=77 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:23.18438","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1396/1396\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 388/388\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=76 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1883' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:27.299351","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1396/1396\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 388/388\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=75 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:31.434107","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1396/1396\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 388/388\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=74 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:35.534083","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1396/1396\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 388/388\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=73 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:39.64541","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1496/1496\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 488/488\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=72 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1883' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:43.783961","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1496/1496\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 488/488\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=71 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:47.903074","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1496/1496\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 488/488\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=70 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:52.023808","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1496/1496\n--------------------------------\nAssociating Content: 0/0\nDownloading + Artifacts: 488/488\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=69 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:01:56.153165","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1607/1607\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 596/596\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=68 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:00.314935","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1607/1607\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 596/596\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=67 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:04.436659","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1607/1607\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 596/596\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=66 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:08.564677","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1607/1607\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 596/596\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=65 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:12.700898","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1720/1720\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 709/709\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=64 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:16.811566","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1720/1720\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 709/709\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=63 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:20.93748","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1720/1720\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 709/709\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=62 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1883' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:25.039316","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1720/1720\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 709/709\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=61 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:29.154251","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1825/1825\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 814/814\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=60 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:33.26876","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1825/1825\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 814/814\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=59 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1883' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:37.393557","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1825/1825\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 814/814\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=58 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:41.511875","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1825/1825\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 814/814\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=57 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:45.654782","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1940/1940\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 929/929\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=56 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:49.758105","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1940/1940\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 929/929\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=55 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:53.877916","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1940/1940\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 929/929\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=54 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:02:57.981945","state":"running","result":"pending","progress":0.42,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 1940/1940\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 929/929\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=53 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1884' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":true,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":null,"duration":"00:03:02.722565","state":"running","result":"pending","progress":0.58,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"class":"Dynflow::ExecutionPlan::OutputReference","execution_plan_id":"75ec389e-dc5b-4a6b-a271-7d2b6505fc83","step_id":15,"action_id":2,"subkeys":[]},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"Total steps: + 2011/2011\n--------------------------------\nAssociating Content: 3/3\nDownloading + Artifacts: 997/997\nDownloading Metadata Files: 9/9\nParsed Advisories: 0/0\nParsed + Comps: 0/0\nParsed Packages: 999/999\nUn-Associating Content: 3/3","errors":[]},"cli_example":null,"start_at":"2021-11-11 + 08:13:53 UTC","available_actions":{"cancellable":false,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=52 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1914' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/foreman_tasks/api/tasks/d444e622-44a4-4ec2-88a7-57ce68997283 + response: + body: + string: '{"id":"d444e622-44a4-4ec2-88a7-57ce68997283","label":"Actions::Katello::Repository::Sync","pending":false,"action":"Synchronize + repository ''Oracle Linux 7 Convert2RHEL main''; product ''Oracle Linux 7 + Convert2RHEL''; organization ''Test Organization''","username":"admin","started_at":"2021-11-11 + 08:13:53 UTC","ended_at":"2021-11-11 08:16:57 UTC","duration":"00:03:03.985","state":"stopped","result":"success","progress":1.0,"input":{"repository":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL main","label":"Oracle_Linux_7_Convert2RHEL_main"},"product":{"id":9,"name":"Oracle + Linux 7 Convert2RHEL","label":"Oracle_Linux_7_Convert2RHEL","cp_id":"411938769108"},"provider":{"id":3,"name":"Anonymous"},"organization":{"id":3,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["pulp3"],"id":9,"sync_result":{"publication_provided":true,"contents_changed":true},"skip_metadata_check":false,"validate_contents":false,"contents_changed":null,"locale":"en","current_request_id":"3f797c8a-03b5-4032-9cce-8cd1c9c62f24","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Synchronize","input":[["repository",{"text":"repository + ''Oracle Linux 7 Convert2RHEL main''","link":null}],["product",{"text":"product + ''Oracle Linux 7 Convert2RHEL''","link":"/products/9/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/3/edit"}]],"output":"No content + added.\nTotal steps: 2011/2011\n--------------------------------\nAssociating + Content: 3/3\nDownloading Artifacts: 997/997\nDownloading Metadata Files: + 9/9\nParsed Advisories: 0/0\nParsed Comps: 0/0\nParsed Packages: 999/999\nUn-Associating + Content: 3/3","errors":[]},"cli_example":null,"start_at":"2021-11-11 08:13:53 + UTC","available_actions":{"cancellable":false,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=51 Vary: - Accept-Encoding X-Content-Type-Options: @@ -345,7 +3337,7 @@ interactions: X-XSS-Protection: - 1; mode=block content-length: - - '1224' + - '1854' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-8.yml b/tests/test_playbooks/fixtures/convert2rhel-8.yml index a7b0abb3..b8bd21cd 100644 --- a/tests/test_playbooks/fixtures/convert2rhel-8.yml +++ b/tests/test_playbooks/fixtures/convert2rhel-8.yml @@ -53,123 +53,6 @@ interactions: status: code: 200 message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/api/hostgroups?search=title%3D%22CentOS+7+converting%22&per_page=4294967296 - response: - body: - string: "{\n \"total\": 3,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"title=\\\"CentOS 7 converting\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"subnet_id\":null,\"subnet_name\":null,\"operatingsystem_id\":null,\"operatingsystem_name\":null,\"domain_id\":null,\"domain_name\":null,\"compute_profile_id\":null,\"compute_profile_name\":null,\"ancestry\":null,\"parent_id\":null,\"parent_name\":null,\"ptable_id\":null,\"ptable_name\":null,\"medium_id\":null,\"medium_name\":null,\"pxe_loader\":null,\"subnet6_id\":null,\"subnet6_name\":null,\"compute_resource_id\":null,\"compute_resource_name\":null,\"architecture_id\":null,\"architecture_name\":null,\"realm_id\":null,\"realm_name\":null,\"created_at\":\"2021-11-04 - 09:50:41 UTC\",\"updated_at\":\"2021-11-04 09:50:41 UTC\",\"id\":2,\"name\":\"CentOS - 7 converting\",\"title\":\"CentOS 7 converting\",\"description\":null,\"puppet_proxy_id\":null,\"puppet_proxy_name\":null,\"puppet_ca_proxy_id\":null,\"puppet_ca_proxy_name\":null,\"puppet_proxy\":null,\"puppet_ca_proxy\":null,\"inherited_compute_profile_id\":null,\"inherited_domain_id\":null,\"inherited_puppet_proxy_id\":null,\"inherited_puppet_ca_proxy_id\":null,\"inherited_compute_resource_id\":null,\"inherited_operatingsystem_id\":null,\"inherited_architecture_id\":null,\"inherited_medium_id\":null,\"inherited_ptable_id\":null,\"inherited_subnet_id\":null,\"inherited_subnet6_id\":null,\"inherited_realm_id\":null,\"inherited_pxe_loader\":null}]\n}\n" - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=99 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '1394' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/api/hostgroups/2 - response: - body: - string: '{"content_source_id":null,"content_source_name":null,"content_view_id":2,"content_view_name":"Default - Organization View","lifecycle_environment_id":2,"lifecycle_environment_name":"Library","kickstart_repository_id":null,"subnet_id":null,"subnet_name":null,"operatingsystem_id":null,"operatingsystem_name":null,"domain_id":null,"domain_name":null,"compute_profile_id":null,"compute_profile_name":null,"ancestry":null,"parent_id":null,"parent_name":null,"ptable_id":null,"ptable_name":null,"medium_id":null,"medium_name":null,"pxe_loader":null,"subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":null,"architecture_id":null,"architecture_name":null,"realm_id":null,"realm_name":null,"created_at":"2021-11-04 - 09:50:41 UTC","updated_at":"2021-11-04 09:50:41 UTC","id":2,"name":"CentOS - 7 converting","title":"CentOS 7 converting","description":null,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"inherited_compute_profile_id":null,"inherited_domain_id":null,"inherited_puppet_proxy_id":null,"inherited_puppet_ca_proxy_id":null,"inherited_compute_resource_id":null,"inherited_operatingsystem_id":null,"inherited_architecture_id":null,"inherited_medium_id":null,"inherited_ptable_id":null,"inherited_subnet_id":null,"inherited_subnet6_id":null,"inherited_realm_id":null,"inherited_pxe_loader":null,"parameters":[{"priority":60,"created_at":"2021-11-04 - 09:50:42 UTC","updated_at":"2021-11-04 09:50:42 UTC","id":7,"name":"kt_activation_keys","parameter_type":"string","value":"convert2rhel_centos7"}],"template_combinations":[],"locations":[],"organizations":[{"id":4,"name":"Test - Organization","title":"Test Organization","description":"A test organization"}]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=98 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '1788' - status: - code: 200 - message: OK - request: body: null headers: @@ -187,8 +70,8 @@ interactions: body: string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: @@ -210,65 +93,7 @@ interactions: Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=97 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '388' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 - response: - body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": - {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-03 - 12:39:45 UTC\",\"updated_at\":\"2021-11-03 12:39:48 UTC\",\"id\":4,\"name\":\"Test - Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=99 Vary: - Accept-Encoding X-Content-Type-Options: @@ -298,14 +123,112 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: http://foreman.example.org/katello/api/organizations/4/environments?search=name%3D%22Library%22&per_page=4294967296 + uri: http://foreman.example.org/katello/api/organizations/3 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":2,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":1,"docker_repositories":0,"ostree_repositories":0,"products":1},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} - - ' + string: '{"label":"Test_Organization","redhat_repository_url":"https://cdn.redhat.com","system_purposes":{"addons":[],"roles":[],"usage":[],"support_level":[],"support_type":[]},"service_levels":[],"service_level":null,"select_all_types":[],"description":"A + test organization","created_at":"2021-11-09 09:00:31 UTC","updated_at":"2021-11-09 + 09:00:35 UTC","ancestry":null,"parent_id":null,"parent_name":null,"id":3,"name":"Test + Organization","title":"Test Organization","users":[],"smart_proxies":[{"name":"centos7-katello-devel-stable.example.com","id":1,"url":"http://centos7-katello-devel-stable.example.com:8000","inherited":false},{"name":"proxy0.example.com","id":2,"url":"https://proxy0.example.com:9090","inherited":false}],"subnets":[],"compute_resources":[],"media":[],"ptables":[{"description":null,"os_family":"Suse","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"AutoYaST entire + SCSI disk","id":112,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"AutoYaST entire + virtual disk","id":113,"inherited":false},{"description":null,"os_family":"Suse","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"AutoYaST LVM","id":114,"inherited":false},{"description":null,"os_family":"Coreos","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"CoreOS default + fake","id":115,"inherited":false},{"description":null,"os_family":"Rancheros","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Empty","id":116,"inherited":false},{"description":null,"os_family":"Freebsd","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"FreeBSD default + fake","id":117,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Jumpstart default","id":118,"inherited":false},{"description":null,"os_family":"Solaris","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Jumpstart mirrored","id":119,"inherited":false},{"description":null,"os_family":"Junos","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Junos default + fake","id":120,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Kickstart custom","id":121,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Kickstart default","id":122,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Kickstart default + thin","id":123,"inherited":false},{"description":null,"os_family":"Redhat","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Kickstart dynamic","id":124,"inherited":false},{"description":null,"os_family":"NXOS","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"NX-OS default + fake","id":125,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Preseed default","id":126,"inherited":false},{"description":null,"os_family":"Debian","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Preseed default + LVM","id":127,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Windows default + GPT EFI partition table","id":129,"inherited":false},{"description":null,"os_family":"Windows","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"Windows default + partition table","id":128,"inherited":false},{"description":null,"os_family":"Xenserver","created_at":"2021-11-04 + 11:56:44 UTC","updated_at":"2021-11-04 11:56:44 UTC","name":"XenServer default","id":130,"inherited":false}],"provisioning_templates":[{"id":44,"name":"Alterator + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":28,"name":"Alterator + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":10,"name":"Alterator + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":61,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":62,"name":"ansible_provisioning_callback","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":63,"name":"ansible_tower_callback_script","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":64,"name":"ansible_tower_callback_service","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":45,"name":"Atomic + Kickstart default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":46,"name":"AutoYaST + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":37,"name":"AutoYaST + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":11,"name":"AutoYaST + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":107,"name":"AutoYaST + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":47,"name":"AutoYaST + SLES default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":65,"name":"blacklist_kernel_modules","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":66,"name":"bmc_nic_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":67,"name":"built","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":68,"name":"chef_client","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":27,"name":"CloudInit + default","template_kind_id":12,"template_kind_name":"cloud-init","inherited":false},{"id":69,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":48,"name":"CoreOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":12,"name":"CoreOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":70,"name":"create_users","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":71,"name":"csr_attributes.yaml","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":72,"name":"efibootmgr_netboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":73,"name":"eject_cdrom","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":74,"name":"epel","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":75,"name":"fips_packages","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":76,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":29,"name":"FreeBSD + (mfsBSD) finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":49,"name":"FreeBSD + (mfsBSD) provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":13,"name":"FreeBSD + (mfsBSD) PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":77,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":58,"name":"Global + Registration","template_kind_id":13,"template_kind_name":"registration","inherited":false},{"id":59,"name":"Grubby + default","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":78,"name":"http_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":79,"name":"insights","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":38,"name":"iPXE + default local boot","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":39,"name":"iPXE + global default","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":40,"name":"iPXE + intermediate script","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":50,"name":"Jumpstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":30,"name":"Jumpstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":2,"name":"Jumpstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":31,"name":"Junos + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":51,"name":"Junos + default SLAX","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":26,"name":"Junos + default ZTP config","template_kind_id":10,"template_kind_name":"ZTP","inherited":false},{"id":52,"name":"Kickstart + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":32,"name":"Kickstart + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":41,"name":"Kickstart + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":3,"name":"Kickstart + default PXEGrub","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":6,"name":"Kickstart + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":14,"name":"Kickstart + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":108,"name":"Kickstart + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":81,"name":"kickstart_ifcfg_bonded_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":80,"name":"kickstart_ifcfg_bond_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":82,"name":"kickstart_ifcfg_generic_interface","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":83,"name":"kickstart_ifcfg_get_identifier_names","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":84,"name":"kickstart_kernel_options","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":85,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":53,"name":"Kickstart + oVirt-RHVH","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":15,"name":"Kickstart + oVirt-RHVH PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":36,"name":"Linux + host_init_config default","template_kind_id":1,"template_kind_name":"host_init_config","inherited":false},{"id":86,"name":"ntp","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":1,"name":"NX-OS + default POAP setup","template_kind_id":11,"template_kind_name":"POAP","inherited":false},{"id":87,"name":"pkg_manager","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":54,"name":"Preseed + default","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":33,"name":"Preseed + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":42,"name":"Preseed + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":7,"name":"Preseed + default PXEGrub2","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":16,"name":"Preseed + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":109,"name":"Preseed + default user data","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":88,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":89,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":91,"name":"puppetlabs_repo","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":90,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":92,"name":"pxegrub2_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":8,"name":"PXEGrub2 + default local boot","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":93,"name":"pxegrub2_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":9,"name":"PXEGrub2 + global default","template_kind_id":4,"template_kind_name":"PXEGrub2","inherited":false},{"id":94,"name":"pxegrub2_mac","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":95,"name":"pxegrub_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":4,"name":"PXEGrub + default local boot","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":96,"name":"pxegrub_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":5,"name":"PXEGrub + global default","template_kind_id":3,"template_kind_name":"PXEGrub","inherited":false},{"id":17,"name":"PXELinux + chain iPXE","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":18,"name":"PXELinux + chain iPXE UNDI","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":97,"name":"pxelinux_chainload","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":19,"name":"PXELinux + default local boot","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":20,"name":"PXELinux + default memdisk","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":98,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":21,"name":"PXELinux + global default","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":99,"name":"rancheros_cloudconfig","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":55,"name":"RancherOS + provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":22,"name":"RancherOS + PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":100,"name":"redhat_register","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":101,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":102,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":103,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":104,"name":"schedule_reboot","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":110,"name":"UserData + default","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":111,"name":"UserData + open-vm-tools","template_kind_id":9,"template_kind_name":"user_data","inherited":false},{"id":23,"name":"WAIK + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":34,"name":"Windows + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":43,"name":"Windows + default iPXE","template_kind_id":5,"template_kind_name":"iPXE","inherited":false},{"id":56,"name":"Windows + default provision","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":24,"name":"Windows + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":105,"name":"Windows + network","template_kind_id":null,"template_kind_name":null,"inherited":false},{"id":60,"name":"Windows + peSetup.cmd","template_kind_id":8,"template_kind_name":"script","inherited":false},{"id":57,"name":"XenServer + default answerfile","template_kind_id":6,"template_kind_name":"provision","inherited":false},{"id":35,"name":"XenServer + default finish","template_kind_id":7,"template_kind_name":"finish","inherited":false},{"id":25,"name":"XenServer + default PXELinux","template_kind_id":2,"template_kind_name":"PXELinux","inherited":false},{"id":106,"name":"yum_proxy","template_kind_id":null,"template_kind_name":null,"inherited":false}],"domains":[],"realms":[],"hostgroups":[{"id":1,"name":"CentOS + 7 converting","title":"CentOS 7 converting","description":null,"inherited":false},{"id":3,"name":"Oracle + 7 converting","title":"Oracle 7 converting","description":null,"inherited":false}],"locations":[{"id":2,"name":"Default + Location","title":"Default Location","description":null}],"hosts_count":0,"parameters":[],"deprecations":{"environments":"Environments + got deprecated from this endpoint."},"simple_content_access":false,"owner_details":{"id":"ff8080817d03c6cc017d03ed74eb001f","key":"Test_Organization","created":"2021-11-09T09:00:33+0000","updated":"2021-11-09T10:15:22+0000","lastRefreshed":null,"virt_who":false,"upstreamConsumer":null},"cdn_configuration":{"url":"https://cdn.redhat.com","username":null,"upstream_organization_label":null,"ssl_ca_credential_id":null},"default_content_view_id":2,"composite_content_views_count":null,"content_view_components_count":null,"library_id":2}' headers: Cache-Control: - max-age=0, private, must-revalidate @@ -322,73 +245,11 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 4; Test Organization - Foreman_version: - - 3.1.0-develop - Keep-Alive: - - timeout=15, max=95 - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - content-length: - - '955' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: http://foreman.example.org/katello/api/organizations/4/content_views?environment_id=2&search=name%3D%22Default+Organization+View%22&per_page=4294967296 - response: - body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default - Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default - Organization View","label":"Default_Organization_View","description":null,"organization_id":4,"organization":{"name":"Test - Organization","label":"Test_Organization","id":4},"created_at":"2021-11-03 - 12:39:46 UTC","updated_at":"2021-11-03 12:39:46 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-03 - 12:39:46 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":7,"name":"convert2rhel_centos7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-03 - 12:39:46 UTC"}]} - - ' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - ; ANY - Foreman_current_organization: - - 4; Test Organization Foreman_version: - 3.1.0-develop Keep-Alive: - - timeout=15, max=94 + - timeout=15, max=98 Vary: - Accept-Encoding X-Content-Type-Options: @@ -401,8 +262,28 @@ interactions: - none X-XSS-Protection: - 1; mode=block + X-bullet-console-text: + - '["user: root\nUSE eager loading detected\n ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])\nCall stack\n /home/vagrant/foreman/app/models/concerns/has_many_common.rb:96:in + `block in belongs_to_name_for''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/config/initializers/rabl_init.rb:49:in + `render''\n /home/vagrant/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:61:in + `show''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in + `set_timezone''\n /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in + `clear_thread''\n /home/vagrant/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in + `set_topbar_sweeper_controller''\n /home/vagrant/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/telemetry.rb:10:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_session.rb:22:in + `call''\n /home/vagrant/foreman/lib/foreman/middleware/logging_context_request.rb:11:in + `call''\n\n"]' + X-bullet-footer-text: + - '["user: root USE eager loading detected ProvisioningTemplate =\u003e + [:template_kind]\n Add to your query: .includes([:template_kind])"]' content-length: - - '1224' + - '17316' status: code: 200 message: OK diff --git a/tests/test_playbooks/fixtures/convert2rhel-9.yml b/tests/test_playbooks/fixtures/convert2rhel-9.yml new file mode 100644 index 00000000..e44bf66d --- /dev/null +++ b/tests/test_playbooks/fixtures/convert2rhel-9.yml @@ -0,0 +1,466 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.1.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=100 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '70' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2021-11-09 + 09:00:31 UTC\",\"updated_at\":\"2021-11-09 09:00:35 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=99 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '388' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/activation_keys?search=name%3D%22convert2rhel_centos7%22&per_page=4294967296 + response: + body: + string: '{"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"convert2rhel_centos7\"","sort":{"by":"name","order":"asc"},"results":[{"id":6,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:15 UTC","updated_at":"2021-11-09 11:05:16 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":4,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=98 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '888' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/6?organization_id=3 + response: + body: + string: ' {"service_level":null,"content_overrides":[],"id":6,"name":"convert2rhel_centos7","description":null,"unlimited_hosts":true,"auto_attach":true,"content_view_id":2,"environment_id":2,"usage_count":0,"user_id":4,"max_hosts":null,"release_version":null,"purpose_usage":null,"purpose_role":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 11:05:15 UTC","updated_at":"2021-11-09 11:05:16 UTC","content_view":{"id":2,"name":"Default + Organization View"},"environment":{"name":"Library","id":2},"products":[{"id":4,"name":"Convert2RHEL7"}],"host_collections":[],"purpose_addons":[],"permissions":{"view_activation_keys":true,"edit_activation_keys":true,"destroy_activation_keys":true}} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=97 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '760' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/environments?search=name%3D%22Library%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Library\"","sort":{"by":"name","order":"asc"},"results":[{"library":true,"registry_name_pattern":null,"registry_unauthenticated_pull":false,"id":2,"name":"Library","label":"Library","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:32 UTC","updated_at":"2021-11-09 09:00:32 UTC","prior":null,"successor":null,"counts":{"content_hosts":0,"content_views":0,"packages":1001,"module_streams":0,"errata":{"security":null,"bugfix":0,"enhancement":2,"total":2},"yum_repositories":3,"docker_repositories":0,"ostree_repositories":0,"products":3},"permissions":{"create_lifecycle_environments":true,"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=96 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '958' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/content_views?search=name%3D%22Default+Organization+View%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Default + Organization View\"","sort":{"by":"name","order":"asc"},"results":[{"composite":false,"component_ids":[],"default":true,"version_count":1,"latest_version":"1.0","latest_version_id":2,"auto_publish":false,"solve_dependencies":false,"import_only":false,"related_cv_count":0,"related_composite_cvs":[],"repository_ids":[],"id":2,"name":"Default + Organization View","label":"Default_Organization_View","description":null,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2021-11-09 + 09:00:33 UTC","updated_at":"2021-11-09 09:00:33 UTC","last_task":null,"latest_version_environments":[{"id":2,"name":"Library","label":"Library"}],"environments":[{"id":2,"name":"Library","label":"Library","permissions":{"readable":true}}],"repositories":[],"versions":[{"id":2,"version":"1.0","published":"2021-11-09 + 09:00:33 UTC","environment_ids":[2]}],"components":[],"content_view_components":[],"activation_keys":[{"id":6,"name":"convert2rhel_centos7"},{"id":7,"name":"convert2rhel_oracle7"},{"id":8,"name":"convert2rhel_rhel7"}],"hosts":[],"next_version":"1.0","last_published":"2021-11-09 + 09:00:33 UTC"}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=95 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '1263' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/organizations/3/subscriptions?search=name%3D%22Convert2RHEL7%22&per_page=4294967296 + response: + body: + string: '{"organization":{},"total":3,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Convert2RHEL7\"","sort":{"by":"name","order":"asc"},"results":[{"id":4,"cp_id":"ff8080817d03c6cc017d03ed96c30023","subscription_id":4,"name":"Convert2RHEL7","start_date":"2021-11-09 + 09:00:41 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"561915692945","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=94 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '746' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: http://foreman.example.org/katello/api/activation_keys/6/subscriptions?per_page=4294967296&organization_id=3 + response: + body: + string: '{"organization":{},"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":null,"sort":{"by":"name","order":"asc"},"results":[{"quantity_attached":1,"id":4,"cp_id":"ff8080817d03c6cc017d03ed96c30023","subscription_id":4,"name":"Convert2RHEL7","start_date":"2021-11-09 + 09:00:41 UTC","end_date":"2049-12-01 00:00:00 UTC","available":-1,"quantity":-1,"consumed":0,"account_number":null,"contract_number":null,"support_level":null,"product_id":"561915692945","sockets":null,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":null,"multi_entitlement":false,"type":"NORMAL","product_name":"Convert2RHEL7","unmapped_guest":false,"virt_only":false,"virt_who":false,"upstream":false,"upstream_pool_id":null}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.1.0-develop + Keep-Alive: + - timeout=15, max=93 + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + content-length: + - '748' + status: + code: 200 + message: OK +version: 1 From 46fdc77c7e68791e64dd75d9689a415318a0b1cb Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 11 Nov 2021 12:54:19 +0100 Subject: [PATCH 34/36] release 3.0.0 --- .mailmap | 2 ++ CHANGELOG.rst | 21 +++++++++++++++++++ changelogs/changelog.yaml | 21 +++++++++++++++++++ ...1-puppetclasses-and-description-update.yml | 2 -- changelogs/fragments/1265-repository-arch.yml | 2 -- ...1291-foreman-ansible-inventory-default.yml | 2 -- changelogs/fragments/convert2rhel.yml | 2 -- changelogs/fragments/drop-ansible28.yml | 2 -- .../fragments/validate-inventory-certs.yml | 2 -- galaxy.yml | 4 +++- 10 files changed, 47 insertions(+), 13 deletions(-) delete mode 100644 changelogs/fragments/1231-puppetclasses-and-description-update.yml delete mode 100644 changelogs/fragments/1265-repository-arch.yml delete mode 100644 changelogs/fragments/1291-foreman-ansible-inventory-default.yml delete mode 100644 changelogs/fragments/convert2rhel.yml delete mode 100644 changelogs/fragments/drop-ansible28.yml delete mode 100644 changelogs/fragments/validate-inventory-certs.yml diff --git a/.mailmap b/.mailmap index 1ecb1b7c..df888f7c 100644 --- a/.mailmap +++ b/.mailmap @@ -20,3 +20,5 @@ Yifat Makias Yifat Makias <42476762+yifatmakias@users.noreply.github.com> Quirin Pamp Quirin Pamp +Kenny Tordeurs +Lukáš Zapletal diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 21ee16ea..419d850c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,27 @@ theforeman.foreman Release Notes This changelog describes changes after version 0.8.1. +v3.0.0 +====== + +Minor Changes +------------- + +- Add a role `convert2rhel` to perform setup for converting systems to RHEL +- inventory plugin - enable certificate validation by default +- repository - add ``arch`` parameter to limit architectures of the repository (https://github.com/theforeman/foreman-ansible-modules/issues/1265) + +Breaking Changes / Porting Guide +-------------------------------- + +- Set use_reports_api default value to true for the inventory plugin +- Support for Ansible 2.8 is removed + +Bugfixes +-------- + +- host, hostgroup - fix updating puppetclasses while also updating description (or other string-like attributes) (https://github.com/theforeman/foreman-ansible-modules/issues/1231) + v2.2.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index d250eb91..3905838a 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -502,3 +502,24 @@ releases: - 1268-ak_param_duplicate.yml - repository.yml release_date: '2021-08-24' + 3.0.0: + changes: + breaking_changes: + - Set use_reports_api default value to true for the inventory plugin + - Support for Ansible 2.8 is removed + bugfixes: + - host, hostgroup - fix updating puppetclasses while also updating description + (or other string-like attributes) (https://github.com/theforeman/foreman-ansible-modules/issues/1231) + minor_changes: + - Add a role `convert2rhel` to perform setup for converting systems to RHEL + - inventory plugin - enable certificate validation by default + - repository - add ``arch`` parameter to limit architectures of the repository + (https://github.com/theforeman/foreman-ansible-modules/issues/1265) + fragments: + - 1231-puppetclasses-and-description-update.yml + - 1265-repository-arch.yml + - 1291-foreman-ansible-inventory-default.yml + - convert2rhel.yml + - drop-ansible28.yml + - validate-inventory-certs.yml + release_date: '2021-11-11' diff --git a/changelogs/fragments/1231-puppetclasses-and-description-update.yml b/changelogs/fragments/1231-puppetclasses-and-description-update.yml deleted file mode 100644 index 9c6e4a81..00000000 --- a/changelogs/fragments/1231-puppetclasses-and-description-update.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - host, hostgroup - fix updating puppetclasses while also updating description (or other string-like attributes) (https://github.com/theforeman/foreman-ansible-modules/issues/1231) diff --git a/changelogs/fragments/1265-repository-arch.yml b/changelogs/fragments/1265-repository-arch.yml deleted file mode 100644 index 6cce8ad8..00000000 --- a/changelogs/fragments/1265-repository-arch.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - repository - add ``arch`` parameter to limit architectures of the repository (https://github.com/theforeman/foreman-ansible-modules/issues/1265) diff --git a/changelogs/fragments/1291-foreman-ansible-inventory-default.yml b/changelogs/fragments/1291-foreman-ansible-inventory-default.yml deleted file mode 100644 index a3816244..00000000 --- a/changelogs/fragments/1291-foreman-ansible-inventory-default.yml +++ /dev/null @@ -1,2 +0,0 @@ -breaking_changes: - - Set use_reports_api default value to true for the inventory plugin diff --git a/changelogs/fragments/convert2rhel.yml b/changelogs/fragments/convert2rhel.yml deleted file mode 100644 index deff6516..00000000 --- a/changelogs/fragments/convert2rhel.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - Add a role `convert2rhel` to perform setup for converting systems to RHEL diff --git a/changelogs/fragments/drop-ansible28.yml b/changelogs/fragments/drop-ansible28.yml deleted file mode 100644 index de7130cd..00000000 --- a/changelogs/fragments/drop-ansible28.yml +++ /dev/null @@ -1,2 +0,0 @@ -breaking_changes: - - Support for Ansible 2.8 is removed diff --git a/changelogs/fragments/validate-inventory-certs.yml b/changelogs/fragments/validate-inventory-certs.yml deleted file mode 100644 index e8b2920f..00000000 --- a/changelogs/fragments/validate-inventory-certs.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - inventory plugin - enable certificate validation by default diff --git a/galaxy.yml b/galaxy.yml index 6628dde8..06059ba9 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -30,7 +30,9 @@ authors: - "Jeremy Albinet " - "John Berninger " - "Josh Swanson " + - "Kenny Tordeurs " - "Kirill Shirinkin " + - "Leos Stejskal " - "Lester Claudio " - "Lukáš Zapletal " - "Manisha Singhal " @@ -69,7 +71,7 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " -version: "2.3.0-dev" +version: "3.0.0" license: - "GPL-3.0-or-later" tags: From ce0ff2611f2b503b466ec548e60eec40c18ae846 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 12 Nov 2021 10:43:39 +0100 Subject: [PATCH 35/36] fix branding of convert2rhel role tests --- Makefile | 2 +- tests/test_playbooks/convert2rhel.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e27b9fba..f93f9190 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ branding: sed -i '/FOREMAN_\w/ s/FOREMAN_/SATELLITE_/g' plugins/doc_fragments/foreman.py plugins/module_utils/foreman_helper.py Makefile sed -i '/foreman_\w/ s/foreman_/satellite_/g' roles/*/README.md roles/*/*/*.yml sed -i 's#theforeman.github.io/foreman-ansible-modules#redhatsatellite.github.io/satellite-ansible-collection#g' roles/*/README.md - sed -i '/foreman_\w.*:/ s/foreman_/satellite_/g' tests/test_playbooks/*_role.yml docs/cvmanager.md + sed -i '/foreman_\w.*:/ s/foreman_/satellite_/g' tests/test_playbooks/*_role.yml tests/test_playbooks/convert2rhel.yml docs/cvmanager.md rm -rf tests/test_playbooks/scc_* tests/test_playbooks/tasks/scc_* tests/test_playbooks/fixtures/scc_* plugins/modules/scc_*.py tests/fixtures/apidoc/scc_*.json rm -rf tests/test_playbooks/snapshot* tests/test_playbooks/tasks/snapshot* tests/test_playbooks/fixtures/snapshot* plugins/modules/snapshot.py tests/fixtures/apidoc/snapshot.json diff --git a/tests/test_playbooks/convert2rhel.yml b/tests/test_playbooks/convert2rhel.yml index 2776bbc1..56905b6d 100644 --- a/tests/test_playbooks/convert2rhel.yml +++ b/tests/test_playbooks/convert2rhel.yml @@ -21,10 +21,10 @@ roles: - role: convert2rhel vars: - foreman_organization: "Test Organization" - foreman_validate_certs: false - foreman_convert2rhel_manage_subscription: false - foreman_content_rhel_wait_for_syncs: false - foreman_content_rhel_enable_rhel7: true - foreman_content_rhel_enable_rhel8: false - foreman_convert2rhel_enable_oracle7: true + satellite_organization: "Test Organization" + satellite_validate_certs: false + satellite_convert2rhel_manage_subscription: false + satellite_content_rhel_wait_for_syncs: false + satellite_content_rhel_enable_rhel7: true + satellite_content_rhel_enable_rhel8: false + satellite_convert2rhel_enable_oracle7: true From c217f370830d247b5f804309ee84b2c81d6a1759 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 12 Nov 2021 11:03:03 +0100 Subject: [PATCH 36/36] fix callback test branding --- Makefile | 2 +- tests/test_callback.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f93f9190..639af7a5 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ vendor: python vendor.py build/apypie-git/apypie/*.py > plugins/module_utils/_apypie.py branding: - sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/*.foreman.yml tests/test_module_state.py tests/test_playbooks/*.yml changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst roles/*/README.md roles/*/*/*.yml docs/cvmanager.md tests/test_playbooks/fixtures/*.yml + sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/*.foreman.yml tests/test_callback.py tests/test_module_state.py tests/test_playbooks/*.yml changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst roles/*/README.md roles/*/*/*.yml docs/cvmanager.md tests/test_playbooks/fixtures/*.yml sed -i 's/foreman.example.com/satellite.example.com/g' plugins/*/*.py docs/cvmanager.md roles/*/README.md roles/*/*/*.yml sed -i 's#theforeman/foreman-ansible-modules#RedHatSatellite/satellite-ansible-collection#g' .github/workflows/*.yml sed -i 's/theforeman-foreman/redhat-satellite/g' .github/workflows/*.yml diff --git a/tests/test_callback.py b/tests/test_callback.py index 79450c73..d91fa54b 100644 --- a/tests/test_callback.py +++ b/tests/test_callback.py @@ -14,11 +14,11 @@ def run_playbook_callback(tmpdir, report_type): if ansible_version is None: pytest.skip("Couldn't figure out Ansible version?!") if distutils.version.LooseVersion(ansible_version) < distutils.version.LooseVersion('2.11'): - extra_env['ANSIBLE_CALLBACK_WHITELIST'] = "theforeman.foreman.foreman" + extra_env['ANSIBLE_CALLBACK_WHITELIST'] = "redhat.satellite.foreman" extra_env['ANSIBLE_COMMAND_WARNINGS'] = "0" else: - extra_env['ANSIBLE_CALLBACKS_ENABLED'] = "theforeman.foreman.foreman" - extra_env['ANSIBLE_STDOUT_CALLBACK'] = "theforeman.foreman.foreman" + extra_env['ANSIBLE_CALLBACKS_ENABLED'] = "redhat.satellite.foreman" + extra_env['ANSIBLE_STDOUT_CALLBACK'] = "redhat.satellite.foreman" extra_env['ANSIBLE_LOAD_CALLBACK_PLUGINS'] = "1" # No connection is actually performed during the test extra_env['FOREMAN_REPORT_TYPE'] = report_type