diff --git a/.gitignore b/.gitignore index 9fa6d86..1f35091 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,19 @@ -SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz -SOURCES/auto-maintenance-8f069305caa0a142c2c6ac14bd4d331282a1c079.tar.gz -SOURCES/certificate-0376ceece57882ade8ffaf431b7866aae3e7fed1.tar.gz -SOURCES/crypto_policies-2e2941c5545571fc8bc494099bdf970f498b9d38.tar.gz -SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz +SOURCES/ansible-sshd-428d390668077f0baf5e88c5834ee810ae11113c.tar.gz +SOURCES/auto-maintenance-e9e30b03c0fe9387cb0ea8a5e7aac8313de2deef.tar.gz +SOURCES/certificate-23f1a414ab022a506614c5be8eadf1708dc45b2b.tar.gz +SOURCES/crypto_policies-ff335b87017954c0b47bfe818700e0f1600b04db.tar.gz +SOURCES/ha_cluster-d97f48a21002497e1ac1bd1385841f2939d7b840.tar.gz SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz -SOURCES/kernel_settings-4c81fd1380712ab0641b6837f092dd9caeeae0a6.tar.gz +SOURCES/kernel_settings-a8ab76f8076078763dacacf3384315c86b342d52.tar.gz SOURCES/logging-07e08107e7ccba5822f8a7aaec1a2ff0a221bede.tar.gz -SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz +SOURCES/metrics-c9b2ee085ccc741b5a9fa8a4b2a7a2f8c8551579.tar.gz SOURCES/nbde_client-19f06159582550c8463f7d8492669e26fbdf760b.tar.gz SOURCES/nbde_server-4dfc5e2aca74cb82f2a50eec7e975a2b78ad9678.tar.gz -SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz -SOURCES/postfix-0.1.tar.gz -SOURCES/selinux-1.1.1.tar.gz -SOURCES/ssh-21adc637511db86b5ba279a70a7301ef3a170669.tar.gz -SOURCES/storage-485de47b0dc0787aea077ba448ecb954f53e40c4.tar.gz -SOURCES/timesync-924650d0cd4117f73a7f0413ab745a8632bc5cec.tar.gz -SOURCES/tlog-1.1.0.tar.gz +SOURCES/network-0f5a882bcab58baba527015b7cde01c7c52d2254.tar.gz +SOURCES/postfix-bbf5784849d362cc3443fde8b09da26ea698a8ce.tar.gz +SOURCES/selinux-557546f922886fc1e73012f2af08ec80fec82fe2.tar.gz +SOURCES/ssh-54bec0855966cc3eed65b26a7c90962eb103d66d.tar.gz +SOURCES/storage-2c3eeb8b2dd898d8c589a0740c2ba9b707e4ed2c.tar.gz +SOURCES/timesync-8a95989e158519ce4bebe10091c47ef88b29261b.tar.gz +SOURCES/tlog-103d3996436c98dccf89e645378e76bd9add2abb.tar.gz +SOURCES/vpn-73e8f5e3b514a8e7a3637dc204d5c106adddeea7.tar.gz diff --git a/.rhel-system-roles.metadata b/.rhel-system-roles.metadata index e7beb14..9e2661b 100644 --- a/.rhel-system-roles.metadata +++ b/.rhel-system-roles.metadata @@ -1,18 +1,19 @@ -77e952b62e634c69e36115845b4f24ee3bfe76b7 SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz -31d33f92384e423baebb073d3a6e3d271cbef5a5 SOURCES/auto-maintenance-8f069305caa0a142c2c6ac14bd4d331282a1c079.tar.gz -7017c00e2ceede1f6019ba17a56e0145e6012013 SOURCES/certificate-0376ceece57882ade8ffaf431b7866aae3e7fed1.tar.gz -469a1a39a19d346c10bf07071a7af52832885047 SOURCES/crypto_policies-2e2941c5545571fc8bc494099bdf970f498b9d38.tar.gz -838ed06d8d092271fff04bd5e7c16db4661e8567 SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz +51ded42654156b1020b9f1588c8bb5d59590ad10 SOURCES/ansible-sshd-428d390668077f0baf5e88c5834ee810ae11113c.tar.gz +09617750856b081379e9f6606a333b1dad95af5f SOURCES/auto-maintenance-e9e30b03c0fe9387cb0ea8a5e7aac8313de2deef.tar.gz +5ecfd4c067f022f0829aca57016a142560a15f2b SOURCES/certificate-23f1a414ab022a506614c5be8eadf1708dc45b2b.tar.gz +94134c1202c9fe2e55cb051ea9c3b1a6ef3859bc SOURCES/crypto_policies-ff335b87017954c0b47bfe818700e0f1600b04db.tar.gz +a710a3801be822da69033e5fedb61519dbb264ad SOURCES/ha_cluster-d97f48a21002497e1ac1bd1385841f2939d7b840.tar.gz fa3d5daf6cf1ceeaa87f58c16e11153cf250e2fa SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz -471863c062a32a37a18c0ee1b7f0c50387baec99 SOURCES/kernel_settings-4c81fd1380712ab0641b6837f092dd9caeeae0a6.tar.gz +c2c48cce415e741b779cce66df37a72a9879a1e3 SOURCES/kernel_settings-a8ab76f8076078763dacacf3384315c86b342d52.tar.gz 60efc730800600f87e386e16730980ea08417d34 SOURCES/logging-07e08107e7ccba5822f8a7aaec1a2ff0a221bede.tar.gz -821d8ebef2d30a41f0fa65bdc5e550f09b375370 SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz +83b34f3749c06fc56f989f3c9e51edfd0cf5769a SOURCES/metrics-c9b2ee085ccc741b5a9fa8a4b2a7a2f8c8551579.tar.gz 66b84d088e2c3989f00b3151cc7fdc40f768f9a5 SOURCES/nbde_client-19f06159582550c8463f7d8492669e26fbdf760b.tar.gz 0e4e133b75e245d17c0c5a1097ab95f047ae6f65 SOURCES/nbde_server-4dfc5e2aca74cb82f2a50eec7e975a2b78ad9678.tar.gz -c2d1aaca43cbe787ee7b1e41e875a76b8f95831d SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz -66c82331f4ac9598c506c3999965b4d07dbfe49d SOURCES/postfix-0.1.tar.gz -f2ad38bd93487962de511b1f4bc9dc6607a5ab36 SOURCES/selinux-1.1.1.tar.gz -aef51c665e61166e091440862cfa4e6a8fe3c29d SOURCES/ssh-21adc637511db86b5ba279a70a7301ef3a170669.tar.gz -8b7d7c14e76aa1a872f22d5cd6d3c9a850868ed3 SOURCES/storage-485de47b0dc0787aea077ba448ecb954f53e40c4.tar.gz -ffd2a706e4e3007684aa9874c8457ad5c8920050 SOURCES/timesync-924650d0cd4117f73a7f0413ab745a8632bc5cec.tar.gz -486d7b845348755e7f189afd95f32bbe97c74661 SOURCES/tlog-1.1.0.tar.gz +2c232e3d50d8b9b03fb2430ba4a599d23d2fae33 SOURCES/network-0f5a882bcab58baba527015b7cde01c7c52d2254.tar.gz +efc33802c79eaa012208447d7a504d7e264a0beb SOURCES/postfix-bbf5784849d362cc3443fde8b09da26ea698a8ce.tar.gz +4331656407ea431a1837062664334931f9398cb3 SOURCES/selinux-557546f922886fc1e73012f2af08ec80fec82fe2.tar.gz +395568b266f38baa6e1f9cc38444bfc187197979 SOURCES/ssh-54bec0855966cc3eed65b26a7c90962eb103d66d.tar.gz +a745ac856b11a6dc350311786b9d52c439f1e368 SOURCES/storage-2c3eeb8b2dd898d8c589a0740c2ba9b707e4ed2c.tar.gz +2eaeea57a6250d2d3793701ed9ac13eeb668fead SOURCES/timesync-8a95989e158519ce4bebe10091c47ef88b29261b.tar.gz +1e53ade9a3e026dbd88c209dee06692be23e55ab SOURCES/tlog-103d3996436c98dccf89e645378e76bd9add2abb.tar.gz +392e23f661f158e82f912a3694607848d4490c29 SOURCES/vpn-73e8f5e3b514a8e7a3637dc204d5c106adddeea7.tar.gz diff --git a/SOURCES/metrics-mssql-x86.diff b/SOURCES/metrics-mssql-x86.diff deleted file mode 100644 index 80bb0e5..0000000 --- a/SOURCES/metrics-mssql-x86.diff +++ /dev/null @@ -1,24 +0,0 @@ -From 7ff86f2fa05998afcd8ae87d9cdd660ef5b6ee2c Mon Sep 17 00:00:00 2001 -From: Jan Kurik -Date: Thu, 18 Feb 2021 17:09:48 +1100 -Subject: [PATCH] Update mssql test to exclude non-x86_64 architectures - -pcp-pmda-mssql (and SQL Server itself) are x86_64-only. ---- - tests/tests_sanity_mssql.yml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tests/tests_sanity_mssql.yml b/tests/tests_sanity_mssql.yml -index 6f1e2cc..8602c36 100644 ---- a/tests/tests_sanity_mssql.yml -+++ b/tests/tests_sanity_mssql.yml -@@ -12,7 +12,8 @@ - - meta: end_host - when: (ansible_distribution in ['RedHat'] and - ( ansible_facts['distribution_version'] is version('8.4', '<'))) or -- ansible_distribution not in ['Fedora', 'RedHat'] -+ ansible_distribution not in ['Fedora', 'RedHat'] or -+ ansible_architecture not in ['x86_64'] - - - name: Save state of services - import_tasks: get_services_state.yml diff --git a/SOURCES/network-ansible-test.diff b/SOURCES/network-ansible-test.diff index 8f88e21..f8de3cf 100644 --- a/SOURCES/network-ansible-test.diff +++ b/SOURCES/network-ansible-test.diff @@ -1,30 +1,8 @@ -From 7ae16e9ff5291f06ba0d7224a0d6c36b780ea0a2 Mon Sep 17 00:00:00 2001 +From c0297506cee0d615f44e52b7c826cd83916eba08 Mon Sep 17 00:00:00 2001 From: Rich Megginson -Date: Wed, 3 Mar 2021 11:37:56 -0700 -Subject: [PATCH] fix most ansible-test issues, suppress the rest +Date: Thu, 25 Mar 2021 13:58:03 -0600 +Subject: [PATCH 4/4] Patch54: network-ansible-test.diff -Automation Hub, and possibly Galaxy in the future, require the -collection to be screened with `ansible-test sanity` among other -checks. The role had a number of issues: -* Use `AssertionError` instead of `assert` -* Use of `logging` module not in accordance with standards, but these - are ok and the errors were suppressed -* Several import errors which are ok because they are checked - elsewhere -* Many of the module files use `#!` shebang - not sure why, but - the usage is allowed -* __init__.py in the module_utils directories must be empty, so a - new file myerror.py was added to move the code from __init__.py -* The documentation block in the module was not properly constructed - or formatted. -* shellcheck issues, including removing unused files -* use `dummy` instead of `_` (underscore) for variables that are - unused - -add WARNING to module docs - collection users should not use directly - -Signed-off-by: Rich Megginson -(cherry picked from commit 7459a29e9104bf01987399153baf0a1c1df05929) --- .github/workflows/tox.yml | 4 +- .sanity-ansible-ignore-2.9.txt | 47 ++++++++++ @@ -130,7 +108,7 @@ index 0000000..439197e +plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc +plugins/modules/network_connections.py validate-modules:undocumented-parameter diff --git a/README.md b/README.md -index c1462b6..c257c08 100644 +index 06a8b1b..48bb5bc 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ a consequence, `state: up` always changes the system. @@ -143,7 +121,7 @@ index c1462b6..c257c08 100644 ### `persistent_state` diff --git a/library/network_connections.py b/library/network_connections.py -index 3224892..3a6e47f 100644 +index dc30ae8..32ebec9 100644 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -2,6 +2,30 @@ @@ -218,7 +196,7 @@ index 3224892..3a6e47f 100644 def connection_is_active(self, con): NM = Util.NM() -@@ -1390,7 +1398,7 @@ class RunEnvironment(object): +@@ -1399,7 +1407,7 @@ class RunEnvironment(object): def check_mode_set(self, check_mode, connections=None): c = self._check_mode self._check_mode = check_mode @@ -227,7 +205,7 @@ index 3224892..3a6e47f 100644 (c is None and check_mode in [CheckMode.PREPARE]) or ( c == CheckMode.PREPARE -@@ -1399,7 +1407,8 @@ class RunEnvironment(object): +@@ -1408,7 +1416,8 @@ class RunEnvironment(object): or (c == CheckMode.PRE_RUN and check_mode in [CheckMode.REAL_RUN]) or (c == CheckMode.REAL_RUN and check_mode in [CheckMode.DONE]) or (c == CheckMode.DRY_RUN and check_mode in [CheckMode.DONE]) @@ -237,7 +215,7 @@ index 3224892..3a6e47f 100644 self._check_mode_changed(c, check_mode, connections) -@@ -1461,7 +1470,8 @@ class RunEnvironmentAnsible(RunEnvironment): +@@ -1470,7 +1479,8 @@ class RunEnvironmentAnsible(RunEnvironment): warn_traceback=False, force_fail=False, ): @@ -247,7 +225,7 @@ index 3224892..3a6e47f 100644 self._log_idx += 1 self.run_results[idx]["log"].append((severity, msg, self._log_idx)) if severity == LogLevel.ERROR: -@@ -1598,14 +1608,15 @@ class Cmd(object): +@@ -1607,14 +1617,15 @@ class Cmd(object): def connections_data(self): c = self._connections_data if c is None: @@ -268,7 +246,7 @@ index 3224892..3a6e47f 100644 self._connections_data = c return c -@@ -1614,11 +1625,14 @@ class Cmd(object): +@@ -1623,11 +1634,14 @@ class Cmd(object): c["changed"] = False def connections_data_set_changed(self, idx, changed=True): @@ -285,7 +263,7 @@ index 3224892..3a6e47f 100644 if not changed: return self.connections_data[idx]["changed"] = changed -@@ -1688,7 +1702,10 @@ class Cmd(object): +@@ -1697,7 +1711,10 @@ class Cmd(object): # modify the connection. con = self.connections[idx] @@ -297,7 +275,7 @@ index 3224892..3a6e47f 100644 # also check, if the current profile is 'up' with a 'type' (which # possibly modifies the connection as well) -@@ -1736,7 +1753,9 @@ class Cmd(object): +@@ -1745,7 +1762,9 @@ class Cmd(object): elif self._check_mode != CheckMode.DONE: c = CheckMode.DONE else: @@ -308,7 +286,7 @@ index 3224892..3a6e47f 100644 self._check_mode = c self.run_env.check_mode_set(c) return c -@@ -1902,7 +1921,12 @@ class Cmd_nm(Cmd): +@@ -1911,7 +1930,12 @@ class Cmd_nm(Cmd): name = connection["name"] if not name: @@ -322,7 +300,7 @@ index 3224892..3a6e47f 100644 continue if name in names: exists = names[name]["nm.exists"] -@@ -1979,7 +2003,7 @@ class Cmd_nm(Cmd): +@@ -1988,7 +2012,7 @@ class Cmd_nm(Cmd): idx, "ethtool.%s specified but not supported by NM", specified ) @@ -344,7 +322,7 @@ index 22c717c..e69de29 100644 -class MyError(Exception): - pass diff --git a/module_utils/network_lsr/argument_validator.py b/module_utils/network_lsr/argument_validator.py -index 24ffdc4..f338489 100644 +index 1bfaeda..a6ed937 100644 --- a/module_utils/network_lsr/argument_validator.py +++ b/module_utils/network_lsr/argument_validator.py @@ -2,12 +2,16 @@ @@ -668,10 +646,10 @@ index 73d9528..bc258fe 100644 i = 2 b.append(n) diff --git a/tests/ensure_provider_tests.py b/tests/ensure_provider_tests.py -index 3620729..4e45e6a 100755 +index 078e99d..c22dbce 100755 --- a/tests/ensure_provider_tests.py +++ b/tests/ensure_provider_tests.py -@@ -73,8 +73,6 @@ NM_ONLY_TESTS = { +@@ -76,8 +76,6 @@ NM_ONLY_TESTS = { MINIMUM_VERSION: "'1.25.1'", "comment": "# NetworkManager 1.25.1 introduced ethtool coalesce support", }, @@ -680,7 +658,7 @@ index 3620729..4e45e6a 100755 "playbooks/tests_reapply.yml": {}, # team interface is not supported on Fedora "playbooks/tests_team.yml": { -@@ -117,9 +115,7 @@ def create_nm_playbook(test_playbook): +@@ -122,9 +120,7 @@ def create_nm_playbook(test_playbook): EXTRA_RUN_CONDITION, "" ) if extra_run_condition: @@ -691,7 +669,7 @@ index 3620729..4e45e6a 100755 nm_version_check = "" if minimum_nm_version: -@@ -212,7 +208,7 @@ def main(): +@@ -217,7 +213,7 @@ def main(): if missing: print("ERROR: No NM or initscripts tests found for:\n" + ", \n".join(missing)) diff --git a/SOURCES/network-disable-bondtests.diff b/SOURCES/network-disable-bondtests.diff index 086edd4..d399917 100644 --- a/SOURCES/network-disable-bondtests.diff +++ b/SOURCES/network-disable-bondtests.diff @@ -1,18 +1,43 @@ +From d6c8319f52f3859b28044841063adf0013df878b Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Thu, 25 Mar 2021 13:57:45 -0600 +Subject: [PATCH 3/4] Patch53: network-disable-bondtests.diff + +--- + tests/playbooks/tests_bond.yml | 2 ++ + tests/playbooks/tests_bond_deprecated.yml | 2 ++ + tests/tests_bond_deprecated_initscripts.yml | 1 + + tests/tests_bond_initscripts.yml | 1 + + 4 files changed, 6 insertions(+) + diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml -index d646a0b..8689d59 100644 +index 1e45788..d3005a6 100644 +--- a/tests/playbooks/tests_bond.yml ++++ b/tests/playbooks/tests_bond.yml +@@ -13,6 +13,8 @@ + dhcp_interface1: test1 + port2_profile: bond0.1 + dhcp_interface2: test2 ++ tags: ++ - "tests::expfail" + tasks: + - name: "INIT Prepare setup" + debug: +diff --git a/tests/playbooks/tests_bond_deprecated.yml b/tests/playbooks/tests_bond_deprecated.yml +index f37e19a..ae475c4 100644 --- a/tests/playbooks/tests_bond_deprecated.yml +++ b/tests/playbooks/tests_bond_deprecated.yml @@ -8,6 +8,8 @@ dhcp_interface1: test1 - slave2_profile: bond0.1 + port2_profile: bond0.1 dhcp_interface2: test2 + tags: + - "tests::expfail" tasks: - name: "INIT Prepare setup" debug: -diff --git a/tests/tests_bond_initscripts.yml b/tests/tests_bond_initscripts.yml -index 8fa74c5..6a231c4 100644 +diff --git a/tests/tests_bond_deprecated_initscripts.yml b/tests/tests_bond_deprecated_initscripts.yml +index 383b488..cdf3de0 100644 --- a/tests/tests_bond_deprecated_initscripts.yml +++ b/tests/tests_bond_deprecated_initscripts.yml @@ -9,5 +9,6 @@ @@ -22,19 +47,6 @@ index 8fa74c5..6a231c4 100644 + - "tests::expfail" - import_playbook: playbooks/tests_bond_deprecated.yml -diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml -index d646a0b..8689d59 100644 ---- a/tests/playbooks/tests_bond.yml -+++ b/tests/playbooks/tests_bond.yml -@@ -13,6 +13,8 @@ - dhcp_interface1: test1 - port2_profile: bond0.1 - dhcp_interface2: test2 -+ tags: -+ - "tests::expfail" - tasks: - - name: "INIT Prepare setup" - debug: diff --git a/tests/tests_bond_initscripts.yml b/tests/tests_bond_initscripts.yml index 8fa74c5..6a231c4 100644 --- a/tests/tests_bond_initscripts.yml @@ -46,3 +58,6 @@ index 8fa74c5..6a231c4 100644 + - "tests::expfail" - import_playbook: playbooks/tests_bond.yml +-- +2.30.2 + diff --git a/SOURCES/network-epel-minimal.diff b/SOURCES/network-epel-minimal.diff index af8b0ef..21e7671 100644 --- a/SOURCES/network-epel-minimal.diff +++ b/SOURCES/network-epel-minimal.diff @@ -1,3 +1,42 @@ +From 88189e32ab6ab4491430584e8c162c9c42d6ca47 Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Thu, 25 Mar 2021 13:55:01 -0600 +Subject: [PATCH 1/4] Patch51: network-epel-minimal.diff + +--- + .../playbooks/integration_pytest_python3.yml | 5 ++++ + tests/tasks/el_repo_setup.yml | 26 ------------------- + tests/tasks/setup_802_1x_server.yml | 2 ++ + tests/tasks/setup_mock_wifi.yml | 2 ++ + tests/tests_802_1x_nm.yml | 1 - + tests/tests_802_1x_updated_nm.yml | 1 - + tests/tests_bond_deprecated_initscripts.yml | 1 - + tests/tests_bond_initscripts.yml | 1 - + tests/tests_bond_nm.yml | 1 - + tests/tests_bridge_initscripts.yml | 1 - + tests/tests_bridge_nm.yml | 1 - + tests/tests_default.yml | 1 - + tests/tests_default_initscripts.yml | 1 - + tests/tests_default_nm.yml | 1 - + tests/tests_ethernet_initscripts.yml | 2 -- + tests/tests_ethernet_nm.yml | 2 -- + tests/tests_ethtool_features_initscripts.yml | 1 - + tests/tests_ethtool_features_nm.yml | 2 -- + tests/tests_helpers_and_asserts.yml | 2 -- + tests/tests_integration_pytest.yml | 5 ++-- + tests/tests_provider_nm.yml | 2 -- + tests/tests_reapply_nm.yml | 2 -- + tests/tests_regression_nm.yml | 2 -- + tests/tests_states_initscripts.yml | 2 -- + tests/tests_states_nm.yml | 2 -- + tests/tests_team_nm.yml | 2 -- + tests/tests_unit.yml | 2 +- + tests/tests_vlan_mtu_initscripts.yml | 2 -- + tests/tests_vlan_mtu_nm.yml | 2 -- + tests/tests_wireless_nm.yml | 2 -- + 30 files changed, 12 insertions(+), 67 deletions(-) + delete mode 100644 tests/tasks/el_repo_setup.yml + diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml index 075355b..5fc9dea 100644 --- a/tests/playbooks/integration_pytest_python3.yml @@ -399,3 +438,6 @@ index 03b5ad6..86baf67 100644 - name: Set network provider to 'nm' set_fact: network_provider: nm +-- +2.30.2 + diff --git a/SOURCES/network-permissions.diff b/SOURCES/network-permissions.diff deleted file mode 100644 index 05068ff..0000000 --- a/SOURCES/network-permissions.diff +++ /dev/null @@ -1,6 +0,0 @@ -diff --git a/library/network_connections.py b/library/network_connections.py -old mode 100755 -new mode 100644 -diff --git a/tests/unit/test_network_connections.py b/tests/unit/test_network_connections.py -old mode 100755 -new mode 100644 diff --git a/SOURCES/network-pr353.diff b/SOURCES/network-pr353.diff deleted file mode 100644 index e4398b7..0000000 --- a/SOURCES/network-pr353.diff +++ /dev/null @@ -1,35 +0,0 @@ -From f4fabea55429077c2a4e94fe8015c4ab57f58ff3 Mon Sep 17 00:00:00 2001 -From: Fernando Fernandez Mancera -Date: Mon, 15 Feb 2021 11:02:55 +0100 -Subject: [PATCH] README: remove "slaves" leftover from documentation - -Signed-off-by: Fernando Fernandez Mancera ---- - README.md | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/README.md b/README.md -index 6b15673..06a8b1b 100644 ---- a/README.md -+++ b/README.md -@@ -300,7 +300,7 @@ different or the profile may not be tied to an interface at all. - - The `zone` option sets the firewalld zone for the interface. - --Slaves to the bridge, bond or team devices cannot specify a zone. -+Ports to the bridge, bond or team devices cannot specify a zone. - - - ### `ip` -@@ -367,7 +367,7 @@ The IP configuration supports the following options: - - **Note:** When `route_append_only` or `rule_append_only` is not specified, the `network` role deletes the current routes or routing rules. - --**Note:** Slaves to the bridge, bond or team devices cannot specify `ip` settings. -+**Note:** Ports to the bridge, bond or team devices cannot specify `ip` settings. - - ### `ethtool` - --- -2.29.2 - diff --git a/SOURCES/network-tier1-tags.diff b/SOURCES/network-tier1-tags.diff index 1c4cb67..3fff8a1 100644 --- a/SOURCES/network-tier1-tags.diff +++ b/SOURCES/network-tier1-tags.diff @@ -1,3 +1,36 @@ +From c050984fda1e5bed1882335c30108b402b55b795 Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Thu, 25 Mar 2021 13:55:52 -0600 +Subject: [PATCH 2/4] Patch52: network-tier1-tags.diff + +--- + tests/playbooks/tests_802_1x.yml | 10 ++++++++ + tests/playbooks/tests_bond.yml | 10 ++++++++ + tests/playbooks/tests_bridge.yml | 27 +++++++++++++++++++- + tests/playbooks/tests_checkpoint_cleanup.yml | 10 ++++++++ + tests/playbooks/tests_ethernet.yml | 21 +++++++++++++++ + tests/playbooks/tests_ethtool_features.yml | 10 ++++++++ + tests/playbooks/tests_provider.yml | 10 ++++++++ + tests/playbooks/tests_reapply.yml | 10 ++++++++ + tests/playbooks/tests_states.yml | 20 +++++++++++++++ + tests/playbooks/tests_vlan_mtu.yml | 18 +++++++++++++ + tests/playbooks/tests_wireless.yml | 10 ++++++++ + tests/tasks/commonvars.yml | 2 ++ + tests/tasks/get_services_state.yml | 4 +++ + tests/tasks/restore_services_state.yml | 22 ++++++++++++++++ + tests/tasks/restore_state.yml | 24 +++++++++++++++++ + tests/tasks/save_state.yml | 11 ++++++++ + tests/tests_802_1x_nm.yml | 4 +++ + tests/tests_802_1x_updated_nm.yml | 4 +++ + tests/tests_default.yml | 8 ++++++ + tests/tests_helpers_and_asserts.yml | 8 ++++++ + 20 files changed, 242 insertions(+), 1 deletion(-) + create mode 100644 tests/tasks/commonvars.yml + create mode 100644 tests/tasks/get_services_state.yml + create mode 100644 tests/tasks/restore_services_state.yml + create mode 100644 tests/tasks/restore_state.yml + create mode 100644 tests/tasks/save_state.yml + diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml index 9cce1ae..76d99e9 100644 --- a/tests/playbooks/tests_802_1x.yml @@ -529,3 +562,6 @@ index 5514182..d9bfa11 100644 # FIXME: when: does not seem to work with include_tasks, therefore this cannot # be safely tested for now # - name: test tap interfaces +-- +2.30.2 + diff --git a/SOURCES/postfix-meta-el8.diff b/SOURCES/postfix-meta-el8.diff deleted file mode 100644 index 41cb91b..0000000 --- a/SOURCES/postfix-meta-el8.diff +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/meta/main.yml b/meta/main.yml -index a0ef6f4..da22270 100644 ---- a/meta/main.yml -+++ b/meta/main.yml -@@ -7,8 +7,8 @@ galaxy_info: - min_ansible_version: 2.2 - platforms: - - name: Fedora -- versions: [ 24, 25 ] -+ versions: [ 31, 32 ] - - name: EL -- versions: [ 6, 7 ] -+ versions: [ 6, 7, 8 ] - - - diff --git a/SOURCES/rhel-system-roles-postfix-pr5.diff b/SOURCES/rhel-system-roles-postfix-pr5.diff deleted file mode 100644 index 4da6f48..0000000 --- a/SOURCES/rhel-system-roles-postfix-pr5.diff +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/README.md b/README.md -index 5950215..df64284 100644 ---- a/README.md -+++ b/README.md -@@ -17,7 +17,7 @@ Example Playbook - - Install and enable postfix. Configure "relay_domains=$mydestination" and - --``` -+```yaml - --- - - hosts: all - vars: -@@ -31,7 +31,7 @@ Install and enable postfix. Configure "relay_domains=$mydestination" and - Install and enable postfix. Do not run 'postfix check' before restarting - postfix: - --``` -+```yaml - --- - - hosts: all - vars: -@@ -43,7 +43,7 @@ postfix: - Install and enable postfix. Do single backup of main.cf (older backup will be - rewritten) and configure "relay_host=example.com": - --``` -+```yaml - --- - - hosts: all - vars: -@@ -58,7 +58,7 @@ Install and enable postfix. Do timestamped backup of main.cf and - configure "relay_host=example.com" (if postfix_backup_multiple is - set to true postfix_backup is ignored): - --``` -+```yaml - --- - - hosts: all - vars: diff --git a/SOURCES/selinux-ansible-test-issues.diff b/SOURCES/selinux-ansible-test-issues.diff deleted file mode 100644 index ef16241..0000000 --- a/SOURCES/selinux-ansible-test-issues.diff +++ /dev/null @@ -1,164 +0,0 @@ -From 9cbbc3f63052bef0b6a697e066e092a5f9722ce8 Mon Sep 17 00:00:00 2001 -From: Noriko Hosoi -Date: Mon, 22 Feb 2021 17:11:05 -0800 -Subject: [PATCH] Patch23: selinux-ansible-test-issues.diff - ---- - .sanity-ansible-ignore-2.10.txt | 2 ++ - .sanity-ansible-ignore-2.9.txt | 2 ++ - library/selogin.py | 26 ++++++++++----------- - tests/setup_module_utils.sh | 41 --------------------------------- - 4 files changed, 16 insertions(+), 55 deletions(-) - create mode 100644 .sanity-ansible-ignore-2.10.txt - create mode 100644 .sanity-ansible-ignore-2.9.txt - delete mode 100755 tests/setup_module_utils.sh - -diff --git a/.sanity-ansible-ignore-2.10.txt b/.sanity-ansible-ignore-2.10.txt -new file mode 100644 -index 0000000..5f8ce1e ---- /dev/null -+++ b/.sanity-ansible-ignore-2.10.txt -@@ -0,0 +1,2 @@ -+plugins/modules/selogin.py no-get-exception -+plugins/modules/selogin.py validate-modules!skip -diff --git a/.sanity-ansible-ignore-2.9.txt b/.sanity-ansible-ignore-2.9.txt -new file mode 100644 -index 0000000..5f8ce1e ---- /dev/null -+++ b/.sanity-ansible-ignore-2.9.txt -@@ -0,0 +1,2 @@ -+plugins/modules/selogin.py no-get-exception -+plugins/modules/selogin.py validate-modules!skip -diff --git a/library/selogin.py b/library/selogin.py -index b785c27..6e3fd32 100644 ---- a/library/selogin.py -+++ b/library/selogin.py -@@ -15,6 +15,9 @@ - # - # 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 - - ANSIBLE_METADATA = { - "status": ["preview"], -@@ -22,13 +25,14 @@ ANSIBLE_METADATA = { - "version": "1.0", - } - --DOCUMENTATION = """ -+DOCUMENTATION = r""" - --- - module: selogin - short_description: Manages linux user to SELinux user mapping - description: -- - Manages linux user to SELinux user mapping --version_added: "1.0" -+ - "WARNING: Do not use this module directly! It is only for role internal use." -+ - Manages linux user to SELinux user mapping -+version_added: '1.0' - options: - login: - description: -@@ -41,8 +45,7 @@ options: - required: true - default: null - serange: -- description: -- - >- -+ description: > - MLS/MCS Security Range (MLS/MCS Systems only) SELinux Range for SELinux login - mapping - defaults to the SELinux user record range. - required: false -@@ -62,8 +65,9 @@ notes: - - The changes are persistent across reboots - - Not tested on any debian based system - requirements: [ 'libselinux-python', 'policycoreutils-python' ] --author: Dan Keder --author: Petr Lautrbach -+author: -+ - Dan Keder (@dkeder) -+ - Petr Lautrbach (@bachradsusi) - """ - - EXAMPLES = """ -@@ -82,7 +86,7 @@ EXAMPLES = """ - - # Assign all users in the engineering group to the staff_u user - - selogin: -- login: %engineering -+ login: "%engineering" - seuser: staff_u - state: present - """ -@@ -198,9 +202,6 @@ def semanage_login_add(module, login, seuser, do_reload, serange="s0", sestore=" - except KeyError: - e = get_exception() - module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) -- except OSError: -- e = get_exception() -- module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) - except RuntimeError: - e = get_exception() - module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) -@@ -248,9 +249,6 @@ def semanage_login_del(module, login, seuser, do_reload, sestore=""): - except KeyError: - e = get_exception() - module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) -- except OSError: -- e = get_exception() -- module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) - except RuntimeError: - e = get_exception() - module.fail_json(msg="%s: %s\n" % (e.__class__.__name__, str(e))) -diff --git a/tests/setup_module_utils.sh b/tests/setup_module_utils.sh -deleted file mode 100755 -index 94d102d..0000000 ---- a/tests/setup_module_utils.sh -+++ /dev/null -@@ -1,41 +0,0 @@ --#!/bin/bash --# SPDX-License-Identifier: MIT -- --set -euo pipefail -- --if [ -n "${DEBUG:-}" ] ; then -- set -x --fi -- --if [ ! -d "${1:-}" ] ; then -- echo Either ansible is not installed, or there is no ansible/module_utils -- echo in "$1" - Skipping -- exit 0 --fi -- --if [ ! -d "${2:-}" ] ; then -- echo Role has no module_utils - Skipping -- exit 0 --fi -- --# we need absolute path for $2 --absmoddir=$( readlink -f "$2" ) -- --# clean up old links to module_utils --for item in "$1"/* ; do -- if lnitem=$( readlink "$item" ) && test -n "$lnitem" ; then -- case "$lnitem" in -- *"${2}"*) rm -f "$item" ;; -- esac -- fi --done -- --# add new links to module_utils --for item in "$absmoddir"/* ; do -- case "$item" in -- *__pycache__) continue;; -- *.pyc) continue;; -- esac -- bnitem=$( basename "$item" ) -- ln -s "$item" "$1/$bnitem" --done --- -2.26.2 - diff --git a/SOURCES/selinux-bz-1926947-no-variable-named-present.diff b/SOURCES/selinux-bz-1926947-no-variable-named-present.diff deleted file mode 100644 index f9bdf2e..0000000 --- a/SOURCES/selinux-bz-1926947-no-variable-named-present.diff +++ /dev/null @@ -1,34 +0,0 @@ -From 035a9b2db26af071a95e02a0af08bcbb73b69abf Mon Sep 17 00:00:00 2001 -From: Florian Bachmann -Date: Fri, 5 Feb 2021 11:48:53 +0100 -Subject: [PATCH] fix incorrect default value (there is no variable named - "present") - ---- - tasks/main.yml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tasks/main.yml b/tasks/main.yml -index afbe81f..702e369 100644 ---- a/tasks/main.yml -+++ b/tasks/main.yml -@@ -118,7 +118,7 @@ - ports: "{{ item.ports }}" - proto: "{{ item.proto | default('tcp') }}" - setype: "{{ item.setype }}" -- state: "{{ item.state | default(present) }}" -+ state: "{{ item.state | default('present') }}" - with_items: "{{ selinux_ports }}" - - - name: Set linux user to SELinux user mapping -@@ -126,6 +126,6 @@ - login: "{{ item.login }}" - seuser: "{{ item.seuser }}" - serange: "{{ item.serange | default('s0') }}" -- state: "{{ item.state | default(present) }}" -+ state: "{{ item.state | default('present') }}" - reload: "{{ item.reload | default(False) }}" - with_items: "{{ selinux_logins }}" --- -2.29.2 - diff --git a/SOURCES/selinux-tier1-tags.diff b/SOURCES/selinux-tier1-tags.diff index c2c4abd..388c2b6 100644 --- a/SOURCES/selinux-tier1-tags.diff +++ b/SOURCES/selinux-tier1-tags.diff @@ -1,5 +1,21 @@ +From 4a8f0c2b240ffccde5018d2de1166e6c22daa500 Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Mon, 22 Mar 2021 17:13:26 -0600 +Subject: [PATCH] add tags; fix cleanup task + +--- + tests/set_selinux_variables.yml | 8 ++++++ + tests/tests_all_purge.yml | 6 ++++- + tests/tests_all_transitions.yml | 2 ++ + tests/tests_boolean.yml | 3 ++- + tests/tests_fcontext.yml | 2 +- + tests/tests_login.yml | 2 +- + tests/tests_port.yml | 2 +- + tests/tests_selinux_disabled.yml | 45 +++++++++++++++++++++----------- + 8 files changed, 50 insertions(+), 20 deletions(-) + diff --git a/tests/set_selinux_variables.yml b/tests/set_selinux_variables.yml -index f294101..7571066 100644 +index 05f0c88..3446647 100644 --- a/tests/set_selinux_variables.yml +++ b/tests/set_selinux_variables.yml @@ -1,4 +1,12 @@ @@ -14,9 +30,9 @@ index f294101..7571066 100644 + ( ansible_distribution == "CentOS" or ansible_distribution == "RedHat" )) - name: Get local modifications - boolean command: /usr/sbin/semanage boolean -l -n -C - register: selinux_role_boolean + changed_when: false diff --git a/tests/tests_all_purge.yml b/tests/tests_all_purge.yml -index 03dfe05..6775847 100644 +index 40e933b..4688994 100644 --- a/tests/tests_all_purge.yml +++ b/tests/tests_all_purge.yml @@ -8,13 +8,17 @@ @@ -39,7 +55,7 @@ index 03dfe05..6775847 100644 - name: Add a Linux System Roles SELinux User user: diff --git a/tests/tests_all_transitions.yml b/tests/tests_all_transitions.yml -index f608a42..d0d209b 100644 +index acd37ad..20f96c4 100644 --- a/tests/tests_all_transitions.yml +++ b/tests/tests_all_transitions.yml @@ -1,6 +1,8 @@ @@ -52,7 +68,7 @@ index f608a42..d0d209b 100644 states: - permissive diff --git a/tests/tests_boolean.yml b/tests/tests_boolean.yml -index 47eafc0..2aa0025 100644 +index 368e8dc..966abe4 100644 --- a/tests/tests_boolean.yml +++ b/tests/tests_boolean.yml @@ -1,4 +1,5 @@ @@ -61,7 +77,7 @@ index 47eafc0..2aa0025 100644 hosts: all become: true -@@ -12,7 +13,7 @@ +@@ -11,7 +12,7 @@ selinux_booleans: - { name: 'samba_enable_home_dirs', state: 'on', persistent: 'yes' } @@ -71,12 +87,12 @@ index 47eafc0..2aa0025 100644 set_fact: boolean_before: "{{ selinux_role_boolean.stdout_lines }}" diff --git a/tests/tests_fcontext.yml b/tests/tests_fcontext.yml -index 0a411fb..f6f1bf4 100644 +index b96b07a..aa1e1fa 100644 --- a/tests/tests_fcontext.yml +++ b/tests/tests_fcontext.yml @@ -13,7 +13,7 @@ - selinux_fcontexts: - - { target: '/tmp/test_dir1(/.*)?', setype: 'user_home_dir_t', ftype: 'd' } + - { target: '/tmp/test_dir1(/.*)?', setype: 'user_home_dir_t', + ftype: 'd' } - - include: set_selinux_variables.yml + - import_tasks: set_selinux_variables.yml @@ -84,11 +100,12 @@ index 0a411fb..f6f1bf4 100644 set_fact: fcontext_before: "{{ selinux_role_fcontext.stdout }}" diff --git a/tests/tests_login.yml b/tests/tests_login.yml -index efa826d..c7ce462 100644 +index 67c6a9f..4ce8a0b 100644 --- a/tests/tests_login.yml +++ b/tests/tests_login.yml -@@ -18,6 +18,6 @@ - - { login: 'sar-user', seuser: 'staff_u', serange: 's0-s0:c0.c1023', state: 'present' } +@@ -17,7 +17,7 @@ + - { login: 'sar-user', seuser: 'staff_u', + serange: 's0-s0:c0.c1023', state: 'present' } - - include: set_selinux_variables.yml + - import_tasks: set_selinux_variables.yml @@ -96,12 +113,12 @@ index efa826d..c7ce462 100644 set_fact: login_before: "{{ selinux_role_login.stdout }}" diff --git a/tests/tests_port.yml b/tests/tests_port.yml -index 446f79d..7bb112e 100644 +index 5b651b0..4172dcb 100644 --- a/tests/tests_port.yml +++ b/tests/tests_port.yml @@ -29,7 +29,7 @@ - selinux_ports: - - { ports: '22022', proto: 'tcp', setype: 'ssh_port_t', state: 'present' } + - { ports: '22022', proto: 'tcp', setype: 'ssh_port_t', + state: 'present' } - - include: set_selinux_variables.yml + - import_tasks: set_selinux_variables.yml @@ -109,10 +126,10 @@ index 446f79d..7bb112e 100644 set_fact: port_after: "{{ selinux_role_port.stdout }}" diff --git a/tests/tests_selinux_disabled.yml b/tests/tests_selinux_disabled.yml -index afd23e4..883dc6d 100644 +index a0dbaeb..4d896a0 100644 --- a/tests/tests_selinux_disabled.yml +++ b/tests/tests_selinux_disabled.yml -@@ -12,13 +12,17 @@ +@@ -11,13 +11,17 @@ fcontext -a -t user_home_dir_t /tmp/test_dir login -a -s staff_u sar-user @@ -131,15 +148,16 @@ index afd23e4..883dc6d 100644 - name: Add a Linux System Roles SELinux User user: -@@ -67,17 +69,28 @@ - assert: +@@ -80,18 +84,29 @@ that: "{{ ansible_selinux.config_mode == 'enforcing' }}" - msg: "SELinux config mode should be enforcing instead of {{ ansible_selinux.config_mode }}" + msg: "SELinux config mode should be enforcing instead of + {{ ansible_selinux.config_mode }}" - - name: Restore original /etc/selinux/config - copy: - remote_src: true - dest: /etc/selinux/config - src: /etc/selinux/config.test_selinux_disabled +- mode: preserve - - name: Remove /etc/selinux/config backup - file: - path: /etc/selinux/config.test_selinux_disabled @@ -158,6 +176,7 @@ index afd23e4..883dc6d 100644 + remote_src: true + dest: /etc/selinux/config + src: /etc/selinux/config.test_selinux_disabled ++ mode: preserve + + - name: Remove /etc/selinux/config backup + file: diff --git a/SOURCES/sshd-example.diff b/SOURCES/sshd-example.diff deleted file mode 100644 index 48243e3..0000000 --- a/SOURCES/sshd-example.diff +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/README.md b/README.md -index 676ad72..dc06d85 100644 ---- a/README.md -+++ b/README.md -@@ -190,7 +190,7 @@ defaults. This is useful if the role is used in deployment stage to make sure - the service is able to start on the first attempt. To disable this check, set - this to empty list. - --* `sshd_hostkey_owner`, `sshd_hostkey_group`, `sshd_hostkey_group` -+* `sshd_hostkey_owner`, `sshd_hostkey_group`, `sshd_hostkey_mode` - - Use these variables to set the ownership and permissions for the host keys from - the above list. -@@ -273,6 +273,8 @@ for example: - X11Forwarding: yes - ``` - -+More example playbooks can be found in [`examples/`](examples/) directory. -+ - Template Generation - ------------------- - -diff --git a/examples/example-root-login.yml b/examples/example-root-login.yml -new file mode 100644 -index 0000000..156e629 ---- /dev/null -+++ b/examples/example-root-login.yml -@@ -0,0 +1,15 @@ -+--- -+- hosts: all -+ tasks: -+ - name: Configure sshd to prevent root and password login except from particular subnet -+ include_role: -+ name: ansible-sshd -+ vars: -+ sshd: -+ # root login and password login is enabled only from a particular subnet -+ PermitRootLogin: no -+ PasswordAuthentication: no -+ Match: -+ - Condition: "Address 192.0.2.0/24" -+ PermitRootLogin: yes -+ PasswordAuthentication: yes diff --git a/SOURCES/sshd-work-on-ansible28-jinja27.diff b/SOURCES/sshd-work-on-ansible28-jinja27.diff deleted file mode 100644 index 268d31f..0000000 --- a/SOURCES/sshd-work-on-ansible28-jinja27.diff +++ /dev/null @@ -1,25 +0,0 @@ -From bb612fb6c5f76a40fce368acb43d2847e699213d Mon Sep 17 00:00:00 2001 -From: Rich Megginson -Date: Thu, 28 Jan 2021 15:56:14 -0700 -Subject: [PATCH] use state: absent instead of state: missing - ---- - tests/tests_hostkeys_missing.yml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/tests_hostkeys_missing.yml b/tests/tests_hostkeys_missing.yml -index 9dfe77b..5790684 100644 ---- a/tests/tests_hostkeys_missing.yml -+++ b/tests/tests_hostkeys_missing.yml -@@ -40,7 +40,7 @@ - - name: Make sure the key was not created - file: - path: /tmp/missing_ssh_host_rsa_key -- state: missing -+ state: absent - register: key - failed_when: key.changed - tags: tests::verify --- -2.29.2 - diff --git a/SOURCES/storage-ansible-test.diff b/SOURCES/storage-ansible-test.diff index 3cb42d8..0e6d45e 100644 --- a/SOURCES/storage-ansible-test.diff +++ b/SOURCES/storage-ansible-test.diff @@ -1,12 +1,10 @@ -From 1d7f9d53c5be6588a7a6c34e4c623b2a8f6fff19 Mon Sep 17 00:00:00 2001 +From 0a69c057b41890d3d426ac10dfc198e7a3dbab4e Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 3 Mar 2021 07:55:20 -0700 Subject: [PATCH] resolve ansible-test issues This fixes many formatting issues as well to make black, flake8, pylint, yamllint, and ansible-lint happier. - -(cherry picked from commit bb2a1af5f63d00c3ff178f3b44696189d9adf542) --- .github/workflows/tox.yml | 4 +- .sanity-ansible-ignore-2.9.txt | 13 + @@ -2912,10 +2910,10 @@ index 854ac0d..2490914 100644 - include_tasks: verify-role-results.yml diff --git a/tests/tests_lvm_auto_size_cap.yml b/tests/tests_lvm_auto_size_cap.yml -index fb17c23..8c754a6 100644 +index 30aa6a7..eae7ff3 100644 --- a/tests/tests_lvm_auto_size_cap.yml +++ b/tests/tests_lvm_auto_size_cap.yml -@@ -33,12 +33,12 @@ +@@ -35,12 +35,12 @@ name: linux-system-roles.storage vars: storage_pools: @@ -2934,7 +2932,7 @@ index fb17c23..8c754a6 100644 - name: unreachable task fail: msg: UNREACH -@@ -56,11 +56,11 @@ +@@ -58,11 +58,11 @@ name: linux-system-roles.storage vars: storage_pools: @@ -2951,7 +2949,7 @@ index fb17c23..8c754a6 100644 - include_tasks: verify-role-results.yml -@@ -69,12 +69,12 @@ +@@ -71,12 +71,12 @@ name: linux-system-roles.storage vars: storage_pools: @@ -2970,7 +2968,7 @@ index fb17c23..8c754a6 100644 - include_tasks: verify-role-results.yml -@@ -83,7 +83,7 @@ +@@ -85,7 +85,7 @@ name: linux-system-roles.storage vars: storage_pools: diff --git a/SOURCES/storage-no-disks-existing.diff b/SOURCES/storage-no-disks-existing.diff deleted file mode 100644 index 68b1e8d..0000000 --- a/SOURCES/storage-no-disks-existing.diff +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/library/blivet.py b/library/blivet.py -index eb8bb11..e927121 100644 ---- a/library/blivet.py -+++ b/library/blivet.py -@@ -104,6 +104,7 @@ try: - from blivet3.formats import get_format - from blivet3.partitioning import do_partitioning - from blivet3.size import Size -+ from blivet3.udev import trigger - from blivet3.util import set_up_logging - BLIVET_PACKAGE = 'blivet3' - except ImportError: -@@ -116,6 +117,7 @@ except ImportError: - from blivet.formats import get_format - from blivet.partitioning import do_partitioning - from blivet.size import Size -+ from blivet.udev import trigger - from blivet.util import set_up_logging - BLIVET_PACKAGE = 'blivet' - except ImportError: -@@ -821,7 +823,10 @@ class BlivetPool(BlivetBase): - - def _look_up_disks(self): - """ Look up the pool's disks in blivet's device tree. """ -- if not self._pool['disks']: -+ if self._disks: -+ return -+ -+ if not self._device and not self._pool['disks']: - raise BlivetAnsibleError("no disks specified for pool '%s'" % self._pool['name']) - elif not isinstance(self._pool['disks'], list): - raise BlivetAnsibleError("pool disks must be specified as a list") -@@ -832,7 +837,7 @@ class BlivetPool(BlivetBase): - if device is not None: # XXX fail if any disk isn't resolved? - disks.append(device) - -- if self._pool['disks'] and not disks: -+ if self._pool['disks'] and not self._device and not disks: - raise BlivetAnsibleError("unable to resolve any disks specified for pool '%s' (%s)" % (self._pool['name'], self._pool['disks'])) - - self._disks = disks -@@ -974,9 +979,9 @@ class BlivetPool(BlivetBase): - """ Schedule actions to configure this pool according to the yaml input. """ - global safe_mode - # look up the device -- self._look_up_disks() - self._look_up_device() - self._apply_defaults() -+ self._look_up_disks() - - # schedule destroy if appropriate, including member type change - if not self.ultimately_present: -@@ -999,6 +1004,7 @@ class BlivetPartitionPool(BlivetPool): - return self._device.partitionable - - def _look_up_device(self): -+ self._look_up_disks() - self._device = self._disks[0] - - def _create(self): -@@ -1354,6 +1360,13 @@ def run_module(): - - actions.append(action) - -+ def ensure_udev_update(action): -+ if action.is_create: -+ sys_path = action.device.path -+ if os.path.islink(sys_path): -+ sys_path = os.readlink(action.device.path) -+ trigger(action='change', subsystem='block', name=os.path.basename(sys_path)) -+ - def action_dict(action): - return dict(action=action.type_desc_str, - fs_type=action.format.type if action.is_format else None, -@@ -1395,6 +1408,7 @@ def run_module(): - if scheduled: - # execute the scheduled actions, committing changes to disk - callbacks.action_executed.add(record_action) -+ callbacks.action_executed.add(ensure_udev_update) - try: - b.devicetree.actions.process(devices=b.devicetree.devices, dry_run=module.check_mode) - except Exception as e: -diff --git a/tests/tests_existing_lvm_pool.yml b/tests/tests_existing_lvm_pool.yml -new file mode 100644 -index 0000000..854ac0d ---- /dev/null -+++ b/tests/tests_existing_lvm_pool.yml -@@ -0,0 +1,54 @@ -+--- -+- hosts: all -+ become: true -+ vars: -+ mount_location: '/opt/test1' -+ volume_group_size: '5g' -+ volume_size: '4g' -+ pool_name: foo -+ -+ tasks: -+ - include_role: -+ name: linux-system-roles.storage -+ -+ - include_tasks: get_unused_disk.yml -+ vars: -+ min_size: "{{ volume_group_size }}" -+ max_return: 1 -+ -+ - name: Create one LVM logical volume under one volume group -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: "{{ pool_name }}" -+ disks: "{{ unused_disks }}" -+ volumes: -+ - name: test1 -+ size: "{{ volume_size }}" -+ -+ - include_tasks: verify-role-results.yml -+ -+ - name: Create another volume in the existing pool, identified only by name. -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: "{{ pool_name }}" -+ volumes: -+ - name: newvol -+ size: '2 GiB' -+ fs_type: ext4 -+ fs_label: newvol -+ -+ - include_tasks: verify-role-results.yml -+ -+ - name: Clean up. -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: "{{ pool_name }}" -+ state: absent -+ -+ - include_tasks: verify-role-results.yml diff --git a/SOURCES/storage-partition-name.diff b/SOURCES/storage-partition-name.diff deleted file mode 100644 index c206dc0..0000000 --- a/SOURCES/storage-partition-name.diff +++ /dev/null @@ -1,30 +0,0 @@ -commit effb7faf20301ddcee8ee36a1b156a0b9f006bb0 -Author: David Lehman -Date: Tue Aug 4 16:00:33 2020 -0400 - - Be smarter in choosing expected partition name. - - BlivetVolume._get_device_id is only used to look up pre-existing - volumes, so we don't have to try too hard to guess it by name. - We can just see if the disk has a single partition and, if so, - return the name of that partition. - - Fixes: #141 - -diff --git a/library/blivet.py b/library/blivet.py -index eb8bb11..0f7ce98 100644 ---- a/library/blivet.py -+++ b/library/blivet.py -@@ -554,7 +554,11 @@ class BlivetPartitionVolume(BlivetVolume): - return self._device.raw_device.type == 'partition' - - def _get_device_id(self): -- return self._blivet_pool._disks[0].name + '1' -+ device_id = None -+ if self._blivet_pool._disks[0].partitioned and len(self._blivet_pool._disks[0].children) == 1: -+ device_id = self._blivet_pool._disks[0].children[0].name -+ -+ return device_id - - def _resize(self): - pass diff --git a/SOURCES/storage-trim-volume-size.diff b/SOURCES/storage-trim-volume-size.diff deleted file mode 100644 index ef947c7..0000000 --- a/SOURCES/storage-trim-volume-size.diff +++ /dev/null @@ -1,326 +0,0 @@ -diff --git a/library/blivet.py b/library/blivet.py -index e927121..f59f821 100644 ---- a/library/blivet.py -+++ b/library/blivet.py -@@ -130,6 +130,9 @@ if BLIVET_PACKAGE: - set_up_logging() - log = logging.getLogger(BLIVET_PACKAGE + ".ansible") - -+ -+MAX_TRIM_PERCENT = 2 -+ - use_partitions = None # create partitions on pool backing device disks? - disklabel_type = None # user-specified disklabel type - safe_mode = None # do not remove any existing devices or formatting -@@ -445,8 +448,16 @@ class BlivetVolume(BlivetBase): - if not self._device.resizable: - return - -- if self._device.format.resizable: -- self._device.format.update_size_info() -+ trim_percent = (1.0 - float(self._device.max_size / size))*100 -+ log.debug("resize: size=%s->%s ; trim=%s", self._device.size, size, trim_percent) -+ if size > self._device.max_size and trim_percent <= MAX_TRIM_PERCENT: -+ log.info("adjusting %s resize target from %s to %s to fit in free space", -+ self._volume['name'], -+ size, -+ self._device.max_size) -+ size = self._device.max_size -+ if size == self._device.size: -+ return - - if not self._device.min_size <= size <= self._device.max_size: - raise BlivetAnsibleError("volume '%s' cannot be resized to '%s'" % (self._volume['name'], size)) -@@ -610,10 +621,18 @@ class BlivetLVMVolume(BlivetVolume): - raise BlivetAnsibleError("invalid size '%s' specified for volume '%s'" % (self._volume['size'], self._volume['name'])) - - fmt = self._get_format() -+ trim_percent = (1.0 - float(parent.free_space / size))*100 -+ log.debug("size: %s ; %s", size, trim_percent) - if size > parent.free_space: -- raise BlivetAnsibleError("specified size for volume '%s' exceeds available space in pool '%s' (%s)" % (size, -- parent.name, -- parent.free_space)) -+ if trim_percent > MAX_TRIM_PERCENT: -+ raise BlivetAnsibleError("specified size for volume '%s' exceeds available space in pool '%s' (%s)" -+ % (size, parent.name, parent.free_space)) -+ else: -+ log.info("adjusting %s size from %s to %s to fit in %s free space", self._volume['name'], -+ size, -+ parent.free_space, -+ parent.name) -+ size = parent.free_space - - try: - device = self._blivet.new_lv(name=self._volume['name'], -diff --git a/tests/tests_create_lv_size_equal_to_vg.yml b/tests/tests_create_lv_size_equal_to_vg.yml -new file mode 100644 -index 0000000..21a5788 ---- /dev/null -+++ b/tests/tests_create_lv_size_equal_to_vg.yml -@@ -0,0 +1,48 @@ -+--- -+- hosts: all -+ become: true -+ vars: -+ storage_safe_mode: false -+ mount_location: '/opt/test1' -+ volume_group_size: '10g' -+ lv_size: '10g' -+ unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}' -+ disk_size: '{{ unused_disk_subfact.sectors|int * -+ unused_disk_subfact.sectorsize|int }}' -+ -+ tasks: -+ - include_role: -+ name: linux-system-roles.storage -+ -+ - include_tasks: get_unused_disk.yml -+ vars: -+ min_size: "{{ volume_group_size }}" -+ max_return: 1 -+ -+ - name: Create one lv which size is equal to vg size -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ disks: "{{ unused_disks }}" -+ volumes: -+ - name: test1 -+ size: "{{ lv_size }}" -+ mount_point: "{{ mount_location }}" -+ -+ - include_tasks: verify-role-results.yml -+ -+ - name: Clean up -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ disks: "{{ unused_disks }}" -+ state: "absent" -+ volumes: -+ - name: test1 -+ mount_point: "{{ mount_location }}" -+ -+ - include_tasks: verify-role-results.yml -diff --git a/tests/tests_lvm_auto_size_cap.yml b/tests/tests_lvm_auto_size_cap.yml -new file mode 100644 -index 0000000..fb17c23 ---- /dev/null -+++ b/tests/tests_lvm_auto_size_cap.yml -@@ -0,0 +1,89 @@ -+--- -+- hosts: all -+ become: true -+ -+ tasks: -+ - include_role: -+ name: linux-system-roles.storage -+ -+ - include_tasks: get_unused_disk.yml -+ vars: -+ min_size: 10g -+ max_return: 1 -+ -+ - command: lsblk -b -l --noheadings -o NAME,SIZE -+ register: storage_test_lsblk -+ -+ - set_fact: -+ test_disk_size: "{{ storage_test_lsblk.stdout_lines|map('regex_search', '^' + unused_disks[0] + '\\s+\\d+$')|select('string')|first|regex_replace('^\\w+\\s+', '') }}" -+ -+ - package: -+ name: bc -+ state: installed -+ -+ - command: -+ cmd: bc -+ stdin: "{{ test_disk_size }} *2" -+ register: doubled_size -+ -+ - name: Test handling of too-large LVM volume size -+ block: -+ - name: Try to create a pool containing one volume twice the size of the backing disk -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ type: lvm -+ disks: "{{ unused_disks }}" -+ volumes: -+ - name: test1 -+ size: "{{ doubled_size.stdout|trim }}" -+ - name: unreachable task -+ fail: -+ msg: UNREACH -+ rescue: -+ - name: Check that we failed in the role -+ assert: -+ that: -+ - ansible_failed_result.msg != 'UNREACH' -+ - blivet_output.failed and -+ blivet_output.msg|regex_search('specified size for volume.+exceeds available') -+ msg: "Role has not failed when it should have" -+ -+ - name: Create a pool containing one volume the same size as the backing disk -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ disks: "{{ unused_disks }}" -+ volumes: -+ - name: test1 -+ size: "{{ test_disk_size }}" -+ -+ - include_tasks: verify-role-results.yml -+ -+ - name: Repeat the previous invocation to verify idempotence -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ type: lvm -+ disks: "{{ unused_disks }}" -+ volumes: -+ - name: test1 -+ size: "{{ test_disk_size }}" -+ -+ - include_tasks: verify-role-results.yml -+ -+ - name: Clean up -+ include_role: -+ name: linux-system-roles.storage -+ vars: -+ storage_pools: -+ - name: foo -+ disks: "{{ unused_disks }}" -+ state: absent -+ volumes: [] -diff --git a/tests/tests_lvm_errors.yml b/tests/tests_lvm_errors.yml -index 37d41dc..e8dc4f4 100644 ---- a/tests/tests_lvm_errors.yml -+++ b/tests/tests_lvm_errors.yml -@@ -11,8 +11,6 @@ - - '/non/existent/disk' - invalid_size: 'xyz GiB' - unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}' -- too_large_size: '{{ (unused_disk_subfact.sectors|int + 1) * -- unused_disk_subfact.sectorsize|int }}' - - tasks: - - include_role: -@@ -86,39 +84,6 @@ - - ansible_failed_result.msg != 'UNREACH' - msg: "Role has not failed when it should have" - -- # the following does not work properly -- # - name: Verify the output -- # assert: -- # that: "{{ blivet_output.failed and -- # blivet_output.msg|regex_search('invalid size.+for volume') and -- # not blivet_output.changed }}" -- # msg: "Unexpected behavior w/ invalid volume size" -- -- - name: Test for correct handling of too-large volume size. -- block: -- - name: Try to create LVM with a too-large volume size. -- include_role: -- name: linux-system-roles.storage -- vars: -- storage_pools: -- - name: foo -- disks: "{{ unused_disks }}" -- volumes: -- - name: test1 -- size: "{{ too_large_size }}" -- mount_point: "{{ mount_location1 }}" -- -- - name: unreachable task -- fail: -- msg: UNREACH -- -- rescue: -- - name: Check that we failed in the role -- assert: -- that: -- - ansible_failed_result.msg != 'UNREACH' -- msg: "Role has not failed when it should have" -- - # the following does not work properly - # - name: Verify the output - # assert: -@@ -138,7 +103,7 @@ - disks: "{{ unused_disks[0] }}" - volumes: - - name: test1 -- size: "{{ too_large_size }}" -+ size: "{{ volume_size }}" - mount_point: "{{ mount_location1 }}" - - - name: unreachable task -@@ -171,7 +136,7 @@ - disks: [] - volumes: - - name: test1 -- size: "{{ too_large_size }}" -+ size: "{{ volume1_size }}" - mount_point: "{{ mount_location1 }}" - - - name: unreachable task -diff --git a/tests/tests_misc.yml b/tests/tests_misc.yml -index a69ee98..3139bc7 100644 ---- a/tests/tests_misc.yml -+++ b/tests/tests_misc.yml -@@ -7,7 +7,7 @@ - volume_group_size: '5g' - volume1_size: '4g' - unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}' -- too_large_size: '{{ (unused_disk_subfact.sectors|int + 1) * -+ too_large_size: '{{ (unused_disk_subfact.sectors|int * 1.2) * - unused_disk_subfact.sectorsize|int }}' - - tasks: -diff --git a/tests/tests_resize.yml b/tests/tests_resize.yml -index 9eeb2b9..209d129 100644 ---- a/tests/tests_resize.yml -+++ b/tests/tests_resize.yml -@@ -9,7 +9,7 @@ - invalid_size1: 'xyz GiB' - invalid_size2: 'none' - unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}' -- too_large_size: '{{ (unused_disk_subfact.sectors|int + 1) * -+ too_large_size: '{{ unused_disk_subfact.sectors|int * 1.2 * - unused_disk_subfact.sectorsize|int }}' - disk_size: '{{ unused_disk_subfact.sectors|int * - unused_disk_subfact.sectorsize|int }}' -@@ -122,23 +122,7 @@ - size: "{{ disk_size }}" - mount_point: "{{ mount_location }}" - -- - name: Unreachable task -- fail: -- msg: UNREACH -- -- rescue: -- - name: Check that we failed in the role -- assert: -- that: -- - ansible_failed_result.msg != 'UNREACH' -- msg: "Role has not failed when it should have" -- -- - name: Verify the output -- assert: -- that: "blivet_output.failed and -- blivet_output.msg|regex_search('volume.+cannot be resized to.+') and -- not blivet_output.changed" -- msg: "Unexpected behavior w/ invalid volume size" -+ - include_tasks: verify-role-results.yml - - - name: Test for correct handling of invalid size specification - block: diff --git a/SOURCES/timesync-ansible-test-issues.diff b/SOURCES/timesync-ansible-test-issues.diff deleted file mode 100644 index 2ec733a..0000000 --- a/SOURCES/timesync-ansible-test-issues.diff +++ /dev/null @@ -1,22 +0,0 @@ -From b55af45842482768f29704d90a1e019ffe0f7770 Mon Sep 17 00:00:00 2001 -From: Noriko Hosoi -Date: Tue, 2 Mar 2021 13:39:19 -0800 -Subject: [PATCH] Patch32: timesync-ansible-test-issues.diff - -RHELPLAN-68118 - Collections - Timesync - fixing ansible-test errors -RHELPLAN-68789 - Collections - ignore file for each role ---- - .sanity-ansible-ignore-2.9.txt | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 .sanity-ansible-ignore-2.9.txt - -diff --git a/.sanity-ansible-ignore-2.9.txt b/.sanity-ansible-ignore-2.9.txt -new file mode 100644 -index 0000000..e6d5e4d ---- /dev/null -+++ b/.sanity-ansible-ignore-2.9.txt -@@ -0,0 +1 @@ -+plugins/modules/timesync_provider.sh shebang --- -2.26.2 - diff --git a/SOURCES/timesync-tier1-tags.diff b/SOURCES/timesync-tier1-tags.diff index 3abd22d..7d4d8eb 100644 --- a/SOURCES/timesync-tier1-tags.diff +++ b/SOURCES/timesync-tier1-tags.diff @@ -1,3 +1,27 @@ +From e658f6f0e7906d220027c9a36bf16398fdca1564 Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Mon, 22 Mar 2021 13:45:01 -0600 +Subject: [PATCH] add service cleanup for downstream testing + +--- + tests/get_services_state.yml | 4 ++++ + tests/restore_services_state.yml | 23 +++++++++++++++++++++++ + tests/tests_default.yml | 10 ++++++++++ + tests/tests_default_wrapper.yml | 9 +++++++++ + tests/tests_ntp.yml | 10 ++++++++++ + tests/tests_ntp_provider1.yml | 8 ++++++++ + tests/tests_ntp_provider2.yml | 8 ++++++++ + tests/tests_ntp_provider3.yml | 8 ++++++++ + tests/tests_ntp_provider4.yml | 8 ++++++++ + tests/tests_ntp_provider5.yml | 8 ++++++++ + tests/tests_ntp_provider6.yml | 8 ++++++++ + tests/tests_ntp_ptp.yml | 10 ++++++++++ + tests/tests_ptp_multi.yml | 11 +++++++++++ + tests/tests_ptp_single.yml | 11 +++++++++++ + 14 files changed, 136 insertions(+) + create mode 100644 tests/get_services_state.yml + create mode 100644 tests/restore_services_state.yml + diff --git a/tests/get_services_state.yml b/tests/get_services_state.yml new file mode 100644 index 0000000..4fe5d36 @@ -10,10 +34,10 @@ index 0000000..4fe5d36 + register: initial_state diff --git a/tests/restore_services_state.yml b/tests/restore_services_state.yml new file mode 100644 -index 0000000..3d48975 +index 0000000..9cc9768 --- /dev/null +++ b/tests/restore_services_state.yml -@@ -0,0 +1,19 @@ +@@ -0,0 +1,23 @@ +- name: Get final state of services + tags: tests::cleanup + service_facts: @@ -23,10 +47,14 @@ index 0000000..3d48975 + tags: tests::cleanup + service: + name: "{{ item }}" -+ state: "{{ 'started' if initial_state.ansible_facts.services[item + '.service']['state'] == 'running' else 'stopped' }}" ++ state: "{{ ++ 'started' ++ if initial_state.ansible_facts.services[item + '.service']['state'] == 'running' ++ else 'stopped' ++ }}" + when: -+ - item + '.service' in final_state.ansible_facts.services -+ - item + '.service' in initial_state.ansible_facts.services ++ - item + '.service' in final_state.ansible_facts.services ++ - item + '.service' in initial_state.ansible_facts.services + with_items: + - chronyd + - ntpd @@ -34,11 +62,10 @@ index 0000000..3d48975 + - phc2sys + - timemaster diff --git a/tests/tests_default.yml b/tests/tests_default.yml -index 856ebe5..fb298c9 100644 +index 9dc0e4c..61c1ea8 100644 --- a/tests/tests_default.yml +++ b/tests/tests_default.yml -@@ -3,4 +4,14 @@ - hosts: all +@@ -3,3 +3,13 @@ roles: - linux-system-roles.timesync @@ -53,11 +80,10 @@ index 856ebe5..fb298c9 100644 +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_default_wrapper.yml b/tests/tests_default_wrapper.yml -index a768f4c..b0c0ab3 100644 +index 3090259..98be26f 100644 --- a/tests/tests_default_wrapper.yml +++ b/tests/tests_default_wrapper.yml -@@ -1,5 +1,8 @@ - --- +@@ -1,4 +1,7 @@ - name: Create static inventory from hostvars + tags: +# - 'tests::tier1' @@ -65,8 +91,8 @@ index a768f4c..b0c0ab3 100644 hosts: all tasks: - name: create temporary file -@@ -17,9 +20,15 @@ - +@@ -15,9 +18,15 @@ + delegate_to: localhost - name: Run tests_default.yml normally + tags: @@ -82,10 +108,10 @@ index a768f4c..b0c0ab3 100644 tasks: - name: Run ansible-playbook with tests_default.yml in check mode diff --git a/tests/tests_ntp.yml b/tests/tests_ntp.yml -index e4b1b5e..446f1dc 100644 +index 9f39d24..c5768f4 100644 --- a/tests/tests_ntp.yml +++ b/tests/tests_ntp.yml -@@ -18,6 +19,11 @@ +@@ -20,6 +20,11 @@ roles: - linux-system-roles.timesync @@ -95,22 +121,22 @@ index e4b1b5e..446f1dc 100644 + import_tasks: get_services_state.yml + tasks: - - meta: flush_handlers - -@@ -35,3 +41,8 @@ - - "'172.16.123.1' in sources.stdout" - - "'172.16.123.2' in sources.stdout" - - "'172.16.123.3' in sources.stdout" + - block: + - meta: flush_handlers +@@ -67,3 +72,8 @@ + __timesync_chrony_version is version('3.1', '>=') + when: chrony_conf is defined + tags: tests::verify + + post_tasks: + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider1.yml b/tests/tests_ntp_provider1.yml -index 08ecab9..9fe0db3 100644 +index 988330a..e231b18 100644 --- a/tests/tests_ntp_provider1.yml +++ b/tests/tests_ntp_provider1.yml -@@ -8,6 +9,10 @@ +@@ -7,6 +7,10 @@ - linux-system-roles.timesync pre_tasks: @@ -118,22 +144,22 @@ index 08ecab9..9fe0db3 100644 +# tags: tests::tier1::cleanup + import_tasks: get_services_state.yml + - - name: Remove NTP providers - package: name={{ item }} state=absent - with_items: -@@ -27,3 +32,7 @@ - assert: - that: - - "'172.16.123.1' in sources.stdout" + - block: + - name: Remove NTP providers + package: name={{ item }} state=absent +@@ -31,3 +35,7 @@ + that: + - "'172.16.123.1' in sources.stdout" + tags: tests::verify + + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider2.yml b/tests/tests_ntp_provider2.yml -index 5476ae4..e0d5c96 100644 +index 5a6284f..cf3e2a7 100644 --- a/tests/tests_ntp_provider2.yml +++ b/tests/tests_ntp_provider2.yml -@@ -8,6 +9,10 @@ +@@ -7,6 +7,10 @@ - linux-system-roles.timesync pre_tasks: @@ -141,22 +167,22 @@ index 5476ae4..e0d5c96 100644 +# tags: tests::tier1::cleanup + import_tasks: get_services_state.yml + - - name: Remove ntp - package: name=ntp state=absent - -@@ -29,3 +34,7 @@ - - - name: Check chronyd service - shell: chronyc -n tracking + - block: + - name: Remove ntp + package: name=ntp state=absent +@@ -33,3 +37,7 @@ + - name: Check chronyd service + shell: chronyc -n tracking + tags: tests::verify + + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider3.yml b/tests/tests_ntp_provider3.yml -index 44ca101..d440a64 100644 +index d5117de..4b88991 100644 --- a/tests/tests_ntp_provider3.yml +++ b/tests/tests_ntp_provider3.yml -@@ -8,6 +9,10 @@ +@@ -7,6 +7,10 @@ - linux-system-roles.timesync pre_tasks: @@ -164,22 +190,22 @@ index 44ca101..d440a64 100644 +# tags: tests::tier1::cleanup + import_tasks: get_services_state.yml + - - name: Remove chrony - package: name=chrony state=absent - -@@ -29,3 +34,7 @@ - - - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + - block: + - name: Remove chrony + package: name=chrony state=absent +@@ -33,3 +37,7 @@ + - name: Check ntpd service + shell: ntpq -c rv | grep 'associd=0' + tags: tests::verify + + - name: Import tasks + tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider4.yml b/tests/tests_ntp_provider4.yml -index 8b452b8..8bccba0 100644 +index c4e33c7..2e030c3 100644 --- a/tests/tests_ntp_provider4.yml +++ b/tests/tests_ntp_provider4.yml -@@ -9,6 +10,10 @@ +@@ -8,6 +8,10 @@ - linux-system-roles.timesync pre_tasks: @@ -187,22 +213,22 @@ index 8b452b8..8bccba0 100644 +# tags: tests::tier1::cleanup + import_tasks: get_services_state.yml + - - name: Install chrony - package: name=chrony state=present - register: package_install -@@ -27,3 +32,7 @@ - - - name: Check chronyd service - shell: chronyc -n tracking + - block: + - name: Install chrony + package: name=chrony state=present +@@ -31,3 +35,7 @@ + - name: Check chronyd service + shell: chronyc -n tracking + tags: tests::verify + + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider5.yml b/tests/tests_ntp_provider5.yml -index 1740164..98a054f 100644 +index 09a855a..a4fbc2d 100644 --- a/tests/tests_ntp_provider5.yml +++ b/tests/tests_ntp_provider5.yml -@@ -9,6 +10,10 @@ +@@ -8,6 +8,10 @@ - linux-system-roles.timesync pre_tasks: @@ -210,45 +236,45 @@ index 1740164..98a054f 100644 +# tags: tests::tier1::cleanup + import_tasks: get_services_state.yml + - - name: Install ntp - package: name=ntp state=present - register: package_install -@@ -27,3 +32,7 @@ - - - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + - block: + - name: Install ntp + package: name=ntp state=present +@@ -31,3 +35,7 @@ + - name: Check ntpd service + shell: ntpq -c rv | grep 'associd=0' + tags: tests::verify + + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_provider6.yml b/tests/tests_ntp_provider6.yml -index 21a2039..fb41824 100644 +index 346b96a..31b55a1 100644 --- a/tests/tests_ntp_provider6.yml +++ b/tests/tests_ntp_provider6.yml -@@ -6,6 +7,10 @@ +@@ -7,6 +7,10 @@ both_avail: true tasks: -+ - name: Import tasks -+# tags: tests::tier1::cleanup -+ import_tasks: get_services_state.yml ++ - name: Import tasks ++# tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml + - - name: Check for availability of both NTP providers - package: name={{ item }} state=present - register: package_install -@@ -71,3 +76,7 @@ - shell: chronyc -n tracking - when: - - not is_ntp_default + - block: + - name: Check for availability of both NTP providers + package: name={{ item }} state=present +@@ -81,3 +85,7 @@ + when: + - not is_ntp_default + tags: tests::verify + -+ - name: Import tasks -+# tags: tests::tier1::cleanup -+ import_tasks: restore_services_state.yml ++ - name: Import tasks ++# tags: tests::tier1::cleanup ++ import_tasks: restore_services_state.yml diff --git a/tests/tests_ntp_ptp.yml b/tests/tests_ntp_ptp.yml -index cab706f..7f4cdfc 100644 +index 56079a3..fba330d 100644 --- a/tests/tests_ntp_ptp.yml +++ b/tests/tests_ntp_ptp.yml -@@ -22,6 +23,11 @@ +@@ -21,6 +21,11 @@ roles: - linux-system-roles.timesync @@ -258,29 +284,28 @@ index cab706f..7f4cdfc 100644 + import_tasks: get_services_state.yml + tasks: - - meta: flush_handlers + - block: + - meta: flush_handlers +@@ -49,3 +54,8 @@ -@@ -48,3 +54,8 @@ - - "'PTP1' in sources.stdout" - - when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + tags: tests::verify + + post_tasks: + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ptp_multi.yml b/tests/tests_ptp_multi.yml -index d52d439..936e467 100644 +index 1d1cd8e..02b44cb 100644 --- a/tests/tests_ptp_multi.yml +++ b/tests/tests_ptp_multi.yml -@@ -1,5 +1,6 @@ - +@@ -1,4 +1,5 @@ - name: Configure time synchronization with multiple PTP domains + tags: tests::expfail hosts: all vars: timesync_ptp_domains: -@@ -16,6 +17,11 @@ +@@ -15,6 +16,11 @@ roles: - linux-system-roles.timesync @@ -290,29 +315,28 @@ index d52d439..936e467 100644 + import_tasks: get_services_state.yml + tasks: - - meta: flush_handlers - -@@ -58,3 +64,8 @@ - - "'domainNumber 1' in pmc.stdout" + - block: + - meta: flush_handlers +@@ -61,3 +67,8 @@ - when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + tags: tests::verify + + post_tasks: + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml diff --git a/tests/tests_ptp_single.yml b/tests/tests_ptp_single.yml -index 74da310..36d141e 100644 +index c7ba401..b96c34c 100644 --- a/tests/tests_ptp_single.yml +++ b/tests/tests_ptp_single.yml -@@ -1,5 +1,6 @@ - +@@ -1,4 +1,5 @@ - name: Configure time synchronization with single PTP domain + tags: tests::expfail hosts: all vars: timesync_ptp_domains: -@@ -8,6 +9,11 @@ +@@ -7,6 +8,11 @@ roles: - linux-system-roles.timesync @@ -322,14 +346,17 @@ index 74da310..36d141e 100644 + import_tasks: get_services_state.yml + tasks: - - meta: flush_handlers - -@@ -31,3 +37,8 @@ - - "'domainNumber 3' in pmc.stdout" + - block: + - meta: flush_handlers +@@ -32,3 +38,8 @@ - when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" + tags: tests::verify + + post_tasks: + - name: Import tasks +# tags: tests::tier1::cleanup + import_tasks: restore_services_state.yml +-- +2.30.2 + diff --git a/SPECS/rhel-system-roles.spec b/SPECS/rhel-system-roles.spec index 27257f3..54b8eb9 100644 --- a/SPECS/rhel-system-roles.spec +++ b/SPECS/rhel-system-roles.spec @@ -4,6 +4,8 @@ %bcond_without ansible %endif +%bcond_with collection_artifact + %if 0%{?rhel} Name: rhel-system-roles %else @@ -11,7 +13,7 @@ Name: linux-system-roles %endif Url: https://github.com/linux-system-roles/ Summary: Set of interfaces for unified system management -Version: 1.0.1 +Version: 1.1.0 Release: 1%{?dist} #Group: Development/Libraries @@ -45,29 +47,25 @@ License: GPLv3+ and MIT and BSD # Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream? #%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}} -%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/} +%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}} %if %{with ansible} BuildRequires: ansible >= 2.9.10 %endif -%if %{undefined ansible_collection_build} %if %{without ansible} # Empty command. We don't have ansible-galaxy. -%define ansible_collection_build() : +%define ansible_collection_build() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz . %else %define ansible_collection_build() ansible-galaxy collection build %endif -%endif -%if %{undefined ansible_collection_install} %if %{without ansible} # Simply copy everything instead of galaxy-installing the built artifact. -%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}; cp -a . %{buildroot}%{ansible_collection_files}/%{collection_name}/ +%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}/%{collection_name}; (cd %{buildroot}%{ansible_collection_files}/%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz) %else %define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz %endif -%endif # For each role, call either defcommit() or deftag(). The other macros # (%%id and %%shortid) can be then used in the same way in both cases. @@ -99,15 +97,15 @@ BuildRequires: ansible >= 2.9.10 %%global rolestodir %%{?rolestodir} %%{roletodir%{1}} } -#%%defcommit 1 43eec5668425d295dce3801216c19b1916df1f9b +%defcommit 1 bbf5784849d362cc3443fde8b09da26ea698a8ce %global rolename1 postfix -%deftag 1 0.1 +#%%deftag 1 0.1 -#%%defcommit 2 6cd1ec8fdebdb92a789b14e5a44fe77f0a3d8ecd +%defcommit 2 557546f922886fc1e73012f2af08ec80fec82fe2 %global rolename2 selinux -%deftag 2 1.1.1 +#%%deftag 2 1.1.1 -%defcommit 3 924650d0cd4117f73a7f0413ab745a8632bc5cec +%defcommit 3 8a95989e158519ce4bebe10091c47ef88b29261b %global rolename3 timesync #%%deftag 3 1.0.0 @@ -115,23 +113,23 @@ BuildRequires: ansible >= 2.9.10 %global rolename4 kdump #%%deftag 4 1.0.0 -%defcommit 5 bda206d45c87ee8c1a5284de84f5acf5e629de97 +%defcommit 5 0f5a882bcab58baba527015b7cde01c7c52d2254 %global rolename5 network #%%deftag 5 1.0.0 -%defcommit 6 485de47b0dc0787aea077ba448ecb954f53e40c4 +%defcommit 6 2c3eeb8b2dd898d8c589a0740c2ba9b707e4ed2c %global rolename6 storage #%%deftag 6 1.2.2 -%defcommit 7 e81b2650108727f38b1c856699aad26af0f44a46 +%defcommit 7 c9b2ee085ccc741b5a9fa8a4b2a7a2f8c8551579 %global rolename7 metrics #%%deftag 7 0.1.0 -#%%defcommit 8 cfa70b6b5910b3198aba2679f8fc36aad45ca45a +%defcommit 8 103d3996436c98dccf89e645378e76bd9add2abb %global rolename8 tlog -%deftag 8 1.1.0 +#%%deftag 8 1.1.0 -%defcommit 9 4c81fd1380712ab0641b6837f092dd9caeeae0a6 +%defcommit 9 a8ab76f8076078763dacacf3384315c86b342d52 %global rolename9 kernel_settings #%%deftag 9 1.0.1 @@ -147,25 +145,28 @@ BuildRequires: ansible >= 2.9.10 %global rolename12 nbde_client #%%deftag 12 1.0.1 -%defcommit 13 0376ceece57882ade8ffaf431b7866aae3e7fed1 +%defcommit 13 23f1a414ab022a506614c5be8eadf1708dc45b2b %global rolename13 certificate #%%deftag 13 1.0.1 -%defcommit 14 2e2941c5545571fc8bc494099bdf970f498b9d38 +%defcommit 14 ff335b87017954c0b47bfe818700e0f1600b04db %global rolename14 crypto_policies %global forgeorg15 https://github.com/willshersystems/ %global repo15 ansible-sshd %global rolename15 sshd -%defcommit 15 e1de59b3c54e9d48a010eeca73755df339c7e628 +%defcommit 15 428d390668077f0baf5e88c5834ee810ae11113c -%defcommit 16 21adc637511db86b5ba279a70a7301ef3a170669 +%defcommit 16 54bec0855966cc3eed65b26a7c90962eb103d66d %global rolename16 ssh -%defcommit 17 779bb78559de58bb5a1f25a4b92039c373ef59a4 +%defcommit 17 d97f48a21002497e1ac1bd1385841f2939d7b840 %global rolename17 ha_cluster -%global mainid 8f069305caa0a142c2c6ac14bd4d331282a1c079 +%defcommit 18 73e8f5e3b514a8e7a3637dc204d5c106adddeea7 +%global rolename18 vpn + +%global mainid e9e30b03c0fe9387cb0ea8a5e7aac8313de2deef Source: %{url}auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz Source1: %{archiveurl1} Source2: %{archiveurl2} @@ -184,20 +185,15 @@ Source14: %{archiveurl14} Source15: %{archiveurl15} Source16: %{archiveurl16} Source17: %{archiveurl17} +Source18: %{archiveurl18} # Script to convert the collection README to Automation Hub. # Not used on Fedora. Source998: collection_readme.sh -Patch11: rhel-system-roles-postfix-pr5.diff -Patch12: postfix-meta-el8.diff - Patch21: selinux-tier1-tags.diff -Patch22: selinux-bz-1926947-no-variable-named-present.diff -Patch23: selinux-ansible-test-issues.diff Patch31: timesync-tier1-tags.diff -Patch32: timesync-ansible-test-issues.diff Patch41: rhel-system-roles-kdump-pr22.diff Patch42: kdump-tier1-tags.diff @@ -206,21 +202,11 @@ Patch44: kdump-fix-newline.diff Patch51: network-epel-minimal.diff # Not suitable for upstream, since the files need to be executable there -Patch52: network-permissions.diff -Patch53: network-tier1-tags.diff -Patch55: network-disable-bondtests.diff -Patch56: network-pr353.diff -Patch57: network-ansible-test.diff - -Patch62: storage-partition-name.diff -Patch63: storage-no-disks-existing.diff -Patch64: storage-trim-volume-size.diff -Patch65: storage-ansible-test.diff +Patch52: network-tier1-tags.diff +Patch53: network-disable-bondtests.diff +Patch54: network-ansible-test.diff -Patch71: metrics-mssql-x86.diff - -Patch151: sshd-example.diff -Patch152: sshd-work-on-ansible28-jinja27.diff +Patch61: storage-ansible-test.diff BuildArch: noarch @@ -233,6 +219,7 @@ BuildRequires: python3-six BuildRequires: python3dist(ruamel.yaml) Requires: python3-jmespath +Requires: python3-netaddr Obsoletes: rhel-system-roles-techpreview < 1.0-3 @@ -256,26 +243,27 @@ consistent configuration interface for managing multiple versions of Fedora, Red Hat Enterprise Linux & CentOS. %endif +%if %{with collection_artifact} +%package collection-artifact +Summary: Collection artifact to import to Automation Hub / Ansible Galaxy + +%description collection-artifact +Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{version}.tar.gz +%endif + %prep -%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -a16 -a17 -n %{getarchivedir 0} +%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -a16 -a17 -a18 -n %{getarchivedir 0} declare -A ROLESTODIR=(%{rolestodir}) for rolename in %{rolenames}; do mv "${ROLESTODIR[${rolename}]}" ${rolename} done -cd %{rolename1} -%patch11 -p1 -%patch12 -p1 -cd .. cd %{rolename2} %patch21 -p1 -%patch22 -p1 -%patch23 -p1 cd .. cd %{rolename3} %patch31 -p1 -%patch32 -p1 cd .. cd %{rolename4} %patch41 -p1 @@ -287,23 +275,14 @@ cd %{rolename5} %patch51 -p1 %patch52 -p1 %patch53 -p1 -%patch55 -p1 -%patch56 -p1 -%patch57 -p1 +%patch54 -p1 cd .. cd %{rolename6} -%patch62 -p1 -%patch63 -p1 -%patch64 -p1 -%patch65 -p1 -cd .. -cd %{rolename7} -%patch71 -p1 +%patch61 -p1 cd .. cd %{rolename15} -%patch151 -p1 -%patch152 -p1 -sed -r -i -e "s/ansible-sshd/linux-system-roles.sshd/" tests/*.yml examples/*.yml README.md +sed -r -i -e "s/ansible-sshd/linux-system-roles.sshd/" tests/*.yml examples/*.yml +sed -r -i -e "s/ willshersystems.sshd/ linux-system-roles.sshd/" tests/*.yml examples/*.yml README.md cd .. # Replacing "linux-system-roles.rolename" with "rhel-system-roles.rolename" in each role @@ -332,24 +311,11 @@ find -type f -executable -name '*.py' -exec \ sed -i -r -e '1s@^(#! */usr/bin/env python)(\s|$)@#\13\2@' '{}' + %build -sh md2html.sh \ -%{rolename1}/README.md \ -%{rolename2}/README.md \ -%{rolename3}/README.md \ -%{rolename4}/README.md \ -%{rolename5}/README.md \ -%{rolename6}/README.md \ -%{rolename7}/README.md \ -%{rolename8}/README.md \ -%{rolename9}/README.md \ -%{rolename10}/README.md \ -%{rolename11}/README.md \ -%{rolename12}/README.md \ -%{rolename13}/README.md \ -%{rolename14}/README.md \ -%{rolename15}/README.md \ -%{rolename16}/README.md \ -%{rolename17}/README.md +readmes="" +for role in %{rolenames}; do + readmes="${readmes} $role/README.md" +done +sh md2html.sh $readmes mkdir .collections %if 0%{?rhel} @@ -384,172 +350,69 @@ rm -r .collections/ansible_collections/%{collection_namespace}/%{collection_name cp -p galaxy.yml lsr_role2collection/.ansible-lint \ .collections/ansible_collections/%{collection_namespace}/%{collection_name} -# converting README.md to README.html -sh md2html.sh -l \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename1}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename2}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename3}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename4}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename5}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename6}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename7}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename8}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename9}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename10}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename11}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename12}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename13}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename14}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename15}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename16}/README.md \ - .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{rolename17}/README.md - -cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ +# converting README.md to README.html for collection +readmes=".collections/ansible_collections/%{collection_namespace}/%{collection_name}/README.md" +for role in %{rolenames}; do + readmes="${readmes} .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/$role/README.md" +done +sh md2html.sh $readmes + +pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ %ansible_collection_build +popd %install mkdir -p $RPM_BUILD_ROOT%{installbase} mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles -cp -pR %{rolename1} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename1} -cp -pR %{rolename2} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename2} -cp -pR %{rolename3} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename3} -cp -pR %{rolename4} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename4} -cp -pR %{rolename5} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename5} -cp -pR %{rolename6} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename6} -cp -pR %{rolename7} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename7} -cp -pR %{rolename8} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename8} -cp -pR %{rolename9} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename9} -cp -pR %{rolename10} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename10} -cp -pR %{rolename11} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename11} -cp -pR %{rolename12} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename12} -cp -pR %{rolename13} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename13} -cp -pR %{rolename14} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename14} -cp -pR %{rolename15} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename15} -cp -pR %{rolename16} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename16} -cp -pR %{rolename17} $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}%{rolename17} +for role in %{rolenames}; do + cp -pR "$role" "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role" +done %if 0%{?rolealtprefix:1} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename1} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename1} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename2} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename2} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename3} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename3} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename4} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename4} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename5} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename5} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename6} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename6} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename7} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename7} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename8} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename8} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename9} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename9} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename10} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename10} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename11} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename11} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename12} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename12} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename13} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename13} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename14} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename14} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename15} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename15} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename16} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename16} -ln -s %{rolealtrelpath}%{roleinstprefix}%{rolename17} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename17} +for role in %{rolenames}; do + ln -s "%{rolealtrelpath}%{roleinstprefix}$role" "$RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}$role" +done %endif -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/kdump -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/postfix -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/selinux -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/timesync -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/network -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/storage -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/metrics -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/tlog -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/kernel_settings -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/logging -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/nbde_server -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/nbde_client -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/certificate -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/crypto_policies -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/sshd -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/ssh -mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/ha_cluster mkdir -p $RPM_BUILD_ROOT%{_pkglicensedir} - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kdump/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kdump/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/kdump -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kdump/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/kdump.COPYING - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}postfix/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}postfix/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/postfix -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}postfix/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/postfix.COPYING - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/selinux -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/selinux.COPYING -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/selinux-playbook.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/selinux/example-selinux-playbook.yml - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/timesync -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/timesync.COPYING -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/examples/multiple-ntp-servers.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/timesync/example-timesync-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/examples/single-pool.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/timesync/example-timesync-pool-playbook.yml - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/network.LICENSE -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/bond_with_vlan.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-bond_with_vlan-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/bridge_with_vlan.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-bridge_with_vlan-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/eth_simple_auto.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_simple_auto-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/eth_with_vlan.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_with_vlan-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/infiniband.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-infiniband-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/macvlan.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-macvlan-playbook.yml -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/remove_profile.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-remove_profile-playbook.yml -rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/remove_profile.yml -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/down_profile.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-down_profile-playbook.yml -rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/down_profile.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/inventory \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-inventory -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/ethtool_features.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-ethtool_features-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/ethtool_features_default.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-ethtool_features_default-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/bond_simple.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-bond_simple-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/eth_with_802_1x.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_with_802_1x-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/wireless_wpa_psk.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-wireless_wpa_psk-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/remove+down_profile.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-remove+down_profile-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/dummy_simple.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-dummy_simple-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/ethtool_coalesce.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-ethtool_coalesce-playbook.yml -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/team_simple.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-team_simple-playbook.yml -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth_dns_support.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_dns_support-playbook.yml - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}storage/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}storage/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/storage -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}storage/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/storage.LICENSE +rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/roles +for role in %{rolenames}; do + mkdir -p "$RPM_BUILD_ROOT%{_pkgdocdir}/$role" + cp -p "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/README.md" \ + "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/README.html" \ + "$RPM_BUILD_ROOT%{_pkgdocdir}/$role" + if [ -f "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/COPYING" ]; then + cp -p "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/COPYING" \ + "$RPM_BUILD_ROOT%{_pkglicensedir}/$role.COPYING" + fi + if [ -f "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/LICENSE" ]; then + cp -p "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/LICENSE" \ + "$RPM_BUILD_ROOT%{_pkglicensedir}/$role.LICENSE" + fi + if [ -d "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples" ]; then + for file in "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples/"*.yml ; do + basename=$(basename "$file" .yml) + newname="$basename" + if [[ "$newname" != example-* ]]; then + newname="example-$newname" + fi + if [[ "$newname" != *-playbook ]]; then + newname="${newname}-playbook" + fi + cp "$file" "$RPM_BUILD_ROOT%{_pkgdocdir}/$role/${newname}.yml" + rm "$file" + done + if [ -f "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples/inventory" ]; then + cp "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples/inventory" \ + "$RPM_BUILD_ROOT%{_pkgdocdir}/$role/example-inventory" + rm "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples/inventory" + fi + # special case for network + # this will error if the directory is unexpectedly empty + rmdir "$RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}$role/examples" + fi +done rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/semaphore rm -r $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/molecule @@ -557,206 +420,191 @@ rm -r $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/molecule rm -r $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/.[A-Za-z]* rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/tests/.git* -rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/roles -rmdir $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}metrics/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}metrics/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/metrics -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}metrics/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/metrics.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}tlog/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}tlog/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/tlog -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}tlog/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/tlog.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kernel_settings/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kernel_settings/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/kernel_settings -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kernel_settings/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/kernel_settings.LICENSE -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}kernel_settings/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/kernel_settings.COPYING - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}logging/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}logging/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/logging -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}logging/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/logging.LICENSE -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}logging/COPYING \ - $RPM_BUILD_ROOT%{_pkglicensedir}/logging.COPYING - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_server/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_server/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/nbde_server -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_server/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/nbde_server.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_client/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_client/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/nbde_client -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}nbde_client/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/nbde_client.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}certificate/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}certificate/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/certificate -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}certificate/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/certificate.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}crypto_policies/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}crypto_policies/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/crypto_policies -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}crypto_policies/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/crypto_policies.LICENSE - -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}sshd/README.md \ - $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}sshd/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/sshd -cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}sshd/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/sshd.LICENSE +# NOTE: sshd/examples/example-root-login.yml is # referenced in the configuring-openssh-servers-using-the-sshd-system-role documentation module # must be updated if changing the file path -mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}sshd/examples/example-root-login.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/sshd/example-root-login-playbook.yml -rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}sshd/examples - -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ssh/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ssh/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/ssh -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ssh/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/ssh.LICENSE - -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ha_cluster/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ha_cluster/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/ha_cluster -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ha_cluster/LICENSE \ - $RPM_BUILD_ROOT%{_pkglicensedir}/ha_cluster.LICENSE -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ha_cluster/examples/simple.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/ha_cluster/example-simple-playbook.yml -rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}ha_cluster/examples - -cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ + +pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ %ansible_collection_install +popd mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles -cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/README.md \ - %{buildroot}%{ansible_collection_files}%{collection_name}/README.html \ - $RPM_BUILD_ROOT%{_pkgdocdir}/collection +cp -p %{buildroot}%{ansible_collection_files}/%{collection_name}/README.md \ + %{buildroot}%{ansible_collection_files}/%{collection_name}/README.html \ + $RPM_BUILD_ROOT%{_pkgdocdir}/collection +# no html files in collection directory +rm -f %{buildroot}%{ansible_collection_files}/%{collection_name}/README.html for rolename in %{rolenames}; do - if [ -f %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.md ]; then + if [ -f %{buildroot}%{ansible_collection_files}/%{collection_name}/roles/${rolename}/README.md ]; then mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${rolename} - cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.md \ - %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.html \ + cp -p %{buildroot}%{ansible_collection_files}/%{collection_name}/roles/${rolename}/README.md \ + %{buildroot}%{ansible_collection_files}/%{collection_name}/roles/${rolename}/README.html \ $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${rolename} + # no html files in collection directory + rm -f %{buildroot}%{ansible_collection_files}/%{collection_name}/roles/${rolename}/README.html fi done +%if %{with collection_artifact} +# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact +pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ +if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then + mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \ + $RPM_BUILD_ROOT%{_datadir}/ansible/collections/ +fi +popd +%endif + +# generate the %files section in the file files_section.txt +format_item_for_files() { + # $1 is directory or file name in buildroot + # $2 - if true, and item is a directory, use %dir + local item + local files_item + item="$1" + files_item=${item##"%{buildroot}"} + if [ -L "$item" ]; then + echo "$files_item" + elif [ -d "$item" ]; then + if [[ "$item" == */doc* ]]; then + echo "%doc $files_item" + elif [ "${2:-false}" = true ]; then + echo "%dir $files_item" + else + echo "$files_item" + fi + elif [[ "$item" == */README.md ]] || [[ "$item" == */README.html ]]; then + if [[ "$item" == */private_* ]]; then + # mark as regular file, not %doc + echo "$files_item" + else + echo "%doc $files_item" + fi + elif [[ "$item" == */COPYING* ]] || [[ "$item" == */LICENSE* ]]; then + echo "%%license $files_item" + else + echo "$files_item" + fi +} -%files +files_section=files_section.txt +rm -f $files_section +touch $files_section %if %{without ansible} -%dir %{_datadir}/ansible -%dir %{_datadir}/ansible/roles +echo '%dir %{_datadir}/ansible' >> $files_section +echo '%dir %{_datadir}/ansible/roles' >> $files_section %endif %if "%{installbase}" != "%{_datadir}/ansible/roles" -%dir %{installbase} +echo '%dir %{installbase}' >> $files_section %endif -%if 0%{?rolealtprefix:1} -%{_datadir}/ansible/roles/%{rolealtprefix}kdump -%{_datadir}/ansible/roles/%{rolealtprefix}postfix -%{_datadir}/ansible/roles/%{rolealtprefix}selinux -%{_datadir}/ansible/roles/%{rolealtprefix}timesync -%{_datadir}/ansible/roles/%{rolealtprefix}network -%{_datadir}/ansible/roles/%{rolealtprefix}storage -%{_datadir}/ansible/roles/%{rolealtprefix}metrics -%{_datadir}/ansible/roles/%{rolealtprefix}tlog -%{_datadir}/ansible/roles/%{rolealtprefix}kernel_settings -%{_datadir}/ansible/roles/%{rolealtprefix}logging -%{_datadir}/ansible/roles/%{rolealtprefix}nbde_server -%{_datadir}/ansible/roles/%{rolealtprefix}nbde_client -%{_datadir}/ansible/roles/%{rolealtprefix}certificate -%{_datadir}/ansible/roles/%{rolealtprefix}crypto_policies -%{_datadir}/ansible/roles/%{rolealtprefix}sshd -%{_datadir}/ansible/roles/%{rolealtprefix}ssh -%{_datadir}/ansible/roles/%{rolealtprefix}ha_cluster -%endif -%{installbase}/%{roleinstprefix}kdump -%{installbase}/%{roleinstprefix}postfix -%{installbase}/%{roleinstprefix}selinux -%{installbase}/%{roleinstprefix}timesync -%{installbase}/%{roleinstprefix}network -%{installbase}/%{roleinstprefix}storage -%{installbase}/%{roleinstprefix}metrics -%{installbase}/%{roleinstprefix}tlog -%{installbase}/%{roleinstprefix}kernel_settings -%{installbase}/%{roleinstprefix}logging -%{installbase}/%{roleinstprefix}nbde_server -%{installbase}/%{roleinstprefix}nbde_client -%{installbase}/%{roleinstprefix}certificate -%{installbase}/%{roleinstprefix}crypto_policies -%{installbase}/%{roleinstprefix}sshd -%{installbase}/%{roleinstprefix}ssh -%{installbase}/%{roleinstprefix}ha_cluster -%{_pkgdocdir}/*/example-*-playbook.yml -%{_pkgdocdir}/network/example-inventory +echo '%dir %{ansible_collection_files}' >> $files_section +echo '%dir %{ansible_collection_files}/%{collection_name}' >> $files_section +find %{buildroot}%{ansible_collection_files}/%{collection_name} -mindepth 1 -maxdepth 1 | \ + while read item; do + if [[ "$item" == */roles ]]; then + format_item_for_files "$item" true >> $files_section + find "$item" -mindepth 1 -maxdepth 1 | while read roles_dir; do + format_item_for_files "$roles_dir" true >> $files_section + find "$roles_dir" -mindepth 1 -maxdepth 1 | while read roles_item; do + format_item_for_files "$roles_item" >> $files_section + done + done + else + format_item_for_files "$item" >> $files_section + fi + done + +find %{buildroot}%{installbase} -mindepth 1 -maxdepth 1 | \ + while read item; do + if [ -d "$item" ]; then + format_item_for_files "$item" true >> $files_section + find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do + format_item_for_files "$roles_item" >> $files_section + done + else + format_item_for_files "$item" >> $files_section + fi + done +if [ "%{installbase}" != "%{_datadir}/ansible/roles" ]; then + find %{buildroot}%{_datadir}/ansible/roles -mindepth 1 -maxdepth 1 | \ + while read item; do + if [ -d "$item" ]; then + format_item_for_files "$item" true >> $files_section + find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do + format_item_for_files "$roles_item" >> $files_section + done + else + format_item_for_files "$item" >> $files_section + fi + done +fi +# cat files_section.txt +# done with files_section.txt generation + + +%files -f files_section.txt %{_pkgdocdir}/*/README.md %{_pkgdocdir}/*/README.html +%{_pkgdocdir}/*/example-* %{_pkgdocdir}/collection/roles/*/README.md %{_pkgdocdir}/collection/roles/*/README.html -%doc %{installbase}/%{roleinstprefix}*/README.md -%doc %{installbase}/%{roleinstprefix}*/README.html -%doc %{ansible_collection_files}/%{collection_name}/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/kdump/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/postfix/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/selinux/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/timesync/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/network/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/storage/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/metrics/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/tlog/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/kernel_settings/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/logging/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/nbde_server/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/nbde_client/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/certificate/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/crypto_policies/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/sshd/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/ssh/README.md -%doc %{ansible_collection_files}/%{collection_name}/roles/ha_cluster/README.md -# can't use a glob for .md files, only for .html. .md files include READMEs -# for private subroles, and we don;t want to tag those as docs. -%doc %{ansible_collection_files}/%{collection_name}/README.html -%doc %{ansible_collection_files}/%{collection_name}/roles/*/README.html - %license %{_pkglicensedir}/* -%license %{installbase}/%{roleinstprefix}kdump/COPYING -%license %{installbase}/%{roleinstprefix}postfix/COPYING -%license %{installbase}/%{roleinstprefix}selinux/COPYING -%license %{installbase}/%{roleinstprefix}timesync/COPYING -%license %{installbase}/%{roleinstprefix}network/LICENSE -%license %{installbase}/%{roleinstprefix}storage/LICENSE -%license %{installbase}/%{roleinstprefix}metrics/LICENSE -%license %{installbase}/%{roleinstprefix}tlog/LICENSE -%license %{installbase}/%{roleinstprefix}kernel_settings/LICENSE -%license %{installbase}/%{roleinstprefix}kernel_settings/COPYING -%license %{installbase}/%{roleinstprefix}logging/LICENSE -%license %{installbase}/%{roleinstprefix}logging/COPYING -%license %{installbase}/%{roleinstprefix}nbde_server/LICENSE -%license %{installbase}/%{roleinstprefix}nbde_client/LICENSE -%license %{installbase}/%{roleinstprefix}certificate/LICENSE -%license %{installbase}/%{roleinstprefix}crypto_policies/LICENSE -%license %{installbase}/%{roleinstprefix}sshd/LICENSE -%license %{installbase}/%{roleinstprefix}ssh/LICENSE -%license %{installbase}/%{roleinstprefix}ha_cluster/LICENSE - -%{ansible_collection_files} + +%if %{with collection_artifact} +%files collection-artifact +%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz +%endif %changelog +* Wed Apr 14 2021 Rich Megginson - 1.1.0-1 +- rebase timesync role to latest upstream + Resolves rhbz#1937938 +- timesync - add timesync_chrony_custom_settings variable for free-form + local configs + Resolves rhbz#1938023 +- do not use ignore_errors in timesync role + Resolves rhbz#1938014 +- support for timesync_max_distance to configure maxdistance/maxdist parameter + Resolves rhbz#1938016 +- support for ntp xleave, filter, and hw timestamping + Resolves rhbz#1938020 +- rebase selinux role to latest upstream + Resolves rhbz#1937938 +- should not reload the SELinux policy if its not changed + Resolves rhbz#1757869 +- Ability to install custom SELinux module via Ansible + Resolves rhbz#1848683 +- rebase storage role to latest upstream + Resolves rhbz#1937938 +- rebase network role to latest upstream + Resolves rhbz#1937938 +- support for ipv6_disabled to disable ipv6 for address + Resolves rhbz#1939711 +- rebase postfix role to latest upstream + Resolves rhbz#1937938 +- rebase metrics role to latest upstream + Resolves rhbz#1937938 +- rebase sshd role to latest upstream + Resolves rhbz#1937938 +- rebase remaining roles to latest upstream + Resolves rhbz#1937938 +- Generate %%files dynamically +- add vpn role + Resolves rhbz#1943679 + +* Tue Apr 13 2021 Noriko Hosoi - 1.0.1-2 +- Adding the -collection-artifact subpackage, enabled using + "--with collection_artifact". It is used for importing to + ansible galaxy/automation hub. +- README.html files (main README for the collection and README + for each role) are not located in /usr/share/ansible/collections, + but just put in /usr/share/doc/linux-system-roles/collection in rpm. +- The README.html files are not included in the collection artifact. +- Fixing "sshd role README.md examples use incorrect role name". + * Wed Mar 17 2021 Noriko Hosoi - 1.0.1-1 - Fix description field in galaxy.yml - Remove "Technology Preview" from Collection README