diff --git a/.gitignore b/.gitignore index 1f47e02..aa4e327 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,18 @@ SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz -SOURCES/auto-maintenance-20d31bf5d8e7eb67ce48af39e36c9f79d87490e3.tar.gz -SOURCES/certificate-19115b5f824141330861359a137d08ac32082502.tar.gz +SOURCES/auto-maintenance-e5ed203b2d7224c0bf0c3fd55452456c8f468cad.tar.gz +SOURCES/certificate-daecdc51cedaf67bf821f1f9f8f6c3cc0ca0d03f.tar.gz SOURCES/crypto_policies-76b2d5b0460dba22c5d290c1af96e4fdb3434cb9.tar.gz +SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz -SOURCES/kernel_settings-1.0.1.tar.gz -SOURCES/logging-822c669ad659ef491b83efdcd78a417917c4055d.tar.gz +SOURCES/kernel_settings-e5e5abb35fb695e22ccffa855c98ab882650480e.tar.gz +SOURCES/logging-193e9034f9f74bbd8a0e9cd5b30e782a7e77dc6a.tar.gz SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz -SOURCES/nbde_client-1.0.1.tar.gz +SOURCES/nbde_client-3af7452e4861ee2363b29b23bf78bf11e06be142.tar.gz SOURCES/nbde_server-1.0.1.tar.gz -SOURCES/network-675c7e8073f33ead5143cd5fc11e332f18524317.tar.gz +SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz SOURCES/postfix-0.1.tar.gz SOURCES/selinux-1.1.1.tar.gz -SOURCES/storage-1.2.2.tar.gz +SOURCES/ssh-effa0a0d993832dee726290f263a2182cf3eacda.tar.gz +SOURCES/storage-485de47b0dc0787aea077ba448ecb954f53e40c4.tar.gz SOURCES/timesync-924650d0cd4117f73a7f0413ab745a8632bc5cec.tar.gz SOURCES/tlog-1.1.0.tar.gz diff --git a/.rhel-system-roles.metadata b/.rhel-system-roles.metadata index f68186b..2703529 100644 --- a/.rhel-system-roles.metadata +++ b/.rhel-system-roles.metadata @@ -1,16 +1,18 @@ 77e952b62e634c69e36115845b4f24ee3bfe76b7 SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz -20b6439c37c243528f201fedffecc50b677304cb SOURCES/auto-maintenance-20d31bf5d8e7eb67ce48af39e36c9f79d87490e3.tar.gz -83eab43fb47021fc2fcd062d77ad7555bf78b3ab SOURCES/certificate-19115b5f824141330861359a137d08ac32082502.tar.gz +c354a1d24b522a356ef487cf8a3f357ab6213b41 SOURCES/auto-maintenance-e5ed203b2d7224c0bf0c3fd55452456c8f468cad.tar.gz +7ce3047f661184ba1df8f61b434998ea707b2237 SOURCES/certificate-daecdc51cedaf67bf821f1f9f8f6c3cc0ca0d03f.tar.gz 513057251590e81b629a69a4ed704b0976b1bc44 SOURCES/crypto_policies-76b2d5b0460dba22c5d290c1af96e4fdb3434cb9.tar.gz +838ed06d8d092271fff04bd5e7c16db4661e8567 SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz fa3d5daf6cf1ceeaa87f58c16e11153cf250e2fa SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz -61be37db19fe593f418e5b69798152f4c5e84cc7 SOURCES/kernel_settings-1.0.1.tar.gz -19890ed24ca1fbb17dc3f11d8499ee2b05302587 SOURCES/logging-822c669ad659ef491b83efdcd78a417917c4055d.tar.gz +c81700b81d7acf48b9eadb1ed7a9bf04b994cdb1 SOURCES/kernel_settings-e5e5abb35fb695e22ccffa855c98ab882650480e.tar.gz +0b1f9c82ca9272d8a82acd3c322635a26bd931b0 SOURCES/logging-193e9034f9f74bbd8a0e9cd5b30e782a7e77dc6a.tar.gz 821d8ebef2d30a41f0fa65bdc5e550f09b375370 SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz -2acad85c458a08a36ca2f2e6b6c12b9b63c42dae SOURCES/nbde_client-1.0.1.tar.gz +a59b3d28bf5da0abbb3e2e188b0b65b2a78cd500 SOURCES/nbde_client-3af7452e4861ee2363b29b23bf78bf11e06be142.tar.gz c55d45d134042b00ece17f2a21bb945c571310b3 SOURCES/nbde_server-1.0.1.tar.gz -7b3fe217917edd822513e5894f4467885334c8a5 SOURCES/network-675c7e8073f33ead5143cd5fc11e332f18524317.tar.gz +c2d1aaca43cbe787ee7b1e41e875a76b8f95831d SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz 66c82331f4ac9598c506c3999965b4d07dbfe49d SOURCES/postfix-0.1.tar.gz f2ad38bd93487962de511b1f4bc9dc6607a5ab36 SOURCES/selinux-1.1.1.tar.gz -b2c6c16da768d379c72f6ed313440bd7fa20c469 SOURCES/storage-1.2.2.tar.gz +b160fd539c99429a33c0d65c818ad0c98c5ca7a4 SOURCES/ssh-effa0a0d993832dee726290f263a2182cf3eacda.tar.gz +8b7d7c14e76aa1a872f22d5cd6d3c9a850868ed3 SOURCES/storage-485de47b0dc0787aea077ba448ecb954f53e40c4.tar.gz ffd2a706e4e3007684aa9874c8457ad5c8920050 SOURCES/timesync-924650d0cd4117f73a7f0413ab745a8632bc5cec.tar.gz 486d7b845348755e7f189afd95f32bbe97c74661 SOURCES/tlog-1.1.0.tar.gz diff --git a/SOURCES/0001-fix-collection-lookup-problem.patch b/SOURCES/0001-fix-collection-lookup-problem.patch deleted file mode 100644 index af4ead5..0000000 --- a/SOURCES/0001-fix-collection-lookup-problem.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 209fa56d14439e049a951995846db9a0f8551222 Mon Sep 17 00:00:00 2001 -From: Rich Megginson -Date: Tue, 9 Feb 2021 09:48:10 -0700 -Subject: [PATCH] fix collection lookup problem - -This fixes the following error: -``` -/bin/sh: line 9: cd: /root/.ansible/collections: No such file or directory -``` -The fix is to ensure the directory exists before attempting -to `cd` to the directory. - -Signed-off-by: Rich Megginson ---- - tests/tasks/get_modules_and_utils_paths.yml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tests/tasks/get_modules_and_utils_paths.yml b/tests/tasks/get_modules_and_utils_paths.yml -index 2090b7e..c71f169 100644 ---- a/tests/tasks/get_modules_and_utils_paths.yml -+++ b/tests/tasks/get_modules_and_utils_paths.yml -@@ -50,6 +50,7 @@ - fi - done - for dir in {{ collection_paths | join(" ") }}; do -+ if [ ! -d "$dir" ]; then continue; fi - cd "$dir" - for subdir in ansible_collections/*/*/plugins/modules; do - if [ -f "$subdir/network_connections.py" ]; then -@@ -75,6 +76,7 @@ - fi - done - for dir in {{ collection_paths | join(" ") }}; do -+ if [ ! -d "$dir" ]; then continue; fi - cd "$dir" - for subdir in ansible_collections/*/*/plugins/module_utils; do - if [ -d "$subdir/network_lsr" ]; then --- -2.29.2 - diff --git a/SOURCES/metrics-mssql-x86.diff b/SOURCES/metrics-mssql-x86.diff new file mode 100644 index 0000000..80bb0e5 --- /dev/null +++ b/SOURCES/metrics-mssql-x86.diff @@ -0,0 +1,24 @@ +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-disable-bondtests.diff b/SOURCES/network-disable-bondtests.diff index f16a980..086edd4 100644 --- a/SOURCES/network-disable-bondtests.diff +++ b/SOURCES/network-disable-bondtests.diff @@ -1,10 +1,34 @@ diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml index d646a0b..8689d59 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 + 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_deprecated_initscripts.yml ++++ b/tests/tests_bond_deprecated_initscripts.yml +@@ -9,5 +9,6 @@ + network_provider: initscripts + tags: + - always ++ - "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 - slave2_profile: bond0.1 + port2_profile: bond0.1 dhcp_interface2: test2 + tags: + - "tests::expfail" diff --git a/SOURCES/network-epel-minimal.diff b/SOURCES/network-epel-minimal.diff index 05e05fc..af8b0ef 100644 --- a/SOURCES/network-epel-minimal.diff +++ b/SOURCES/network-epel-minimal.diff @@ -1,5 +1,5 @@ diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml -index 3c7d3fb..ad8418c 100644 +index 075355b..5fc9dea 100644 --- a/tests/playbooks/integration_pytest_python3.yml +++ b/tests/playbooks/integration_pytest_python3.yml @@ -9,6 +9,11 @@ @@ -94,6 +94,18 @@ index 5a25f5b..bd335e4 100644 - name: Set network provider to 'nm' set_fact: network_provider: nm +diff --git a/tests/tests_bond_deprecated_initscripts.yml b/tests/tests_bond_deprecated_initscripts.yml +index 1e74bcc..383b488 100644 +--- a/tests/tests_bond_deprecated_initscripts.yml ++++ b/tests/tests_bond_deprecated_initscripts.yml +@@ -4,7 +4,6 @@ + - hosts: all + name: Run playbook 'playbooks/tests_bond_deprecated.yml' with initscripts + tasks: +- - include_tasks: tasks/el_repo_setup.yml + - name: Set network provider to 'initscripts' + set_fact: + network_provider: initscripts diff --git a/tests/tests_bond_initscripts.yml b/tests/tests_bond_initscripts.yml index 32fcc32..8fa74c5 100644 --- a/tests/tests_bond_initscripts.yml @@ -336,7 +348,7 @@ index 8048029..0516765 100644 set_fact: network_provider: nm diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml -index a410fbd..b8d4096 100644 +index 44dfaec..8c5388b 100644 --- a/tests/tests_unit.yml +++ b/tests/tests_unit.yml @@ -3,7 +3,7 @@ diff --git a/SOURCES/network-tier1-tags.diff b/SOURCES/network-tier1-tags.diff index 76b813f..1c4cb67 100644 --- a/SOURCES/network-tier1-tags.diff +++ b/SOURCES/network-tier1-tags.diff @@ -23,7 +23,7 @@ index 9cce1ae..76d99e9 100644 + tasks: + - import_tasks: tasks/restore_state.yml diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml -index ab3ee43..d646a0b 100644 +index 69f07f8..1e45788 100644 --- a/tests/playbooks/tests_bond.yml +++ b/tests/playbooks/tests_bond.yml @@ -1,5 +1,10 @@ @@ -36,8 +36,8 @@ index ab3ee43..d646a0b 100644 + - hosts: all vars: - master_profile: bond0 -@@ -94,3 +99,8 @@ + controller_profile: bond0 +@@ -95,3 +100,8 @@ - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml tags: - "tests::cleanup" diff --git a/SOURCES/selinux-bz-1926947-no-variable-named-present.diff b/SOURCES/selinux-bz-1926947-no-variable-named-present.diff new file mode 100644 index 0000000..f9bdf2e --- /dev/null +++ b/SOURCES/selinux-bz-1926947-no-variable-named-present.diff @@ -0,0 +1,34 @@ +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/sshd-work-on-ansible28-jinja27.diff b/SOURCES/sshd-work-on-ansible28-jinja27.diff new file mode 100644 index 0000000..268d31f --- /dev/null +++ b/SOURCES/sshd-work-on-ansible28-jinja27.diff @@ -0,0 +1,25 @@ +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-no-disks-existing.diff b/SOURCES/storage-no-disks-existing.diff new file mode 100644 index 0000000..68b1e8d --- /dev/null +++ b/SOURCES/storage-no-disks-existing.diff @@ -0,0 +1,142 @@ +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 index 9a183e2..c206dc0 100644 --- a/SOURCES/storage-partition-name.diff +++ b/SOURCES/storage-partition-name.diff @@ -1,21 +1,21 @@ +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 1f0473a..a03d88c 100644 +index eb8bb11..0f7ce98 100644 --- a/library/blivet.py +++ b/library/blivet.py -@@ -316,7 +316,11 @@ - if self._device: - return - -- device = self._blivet.devicetree.resolve_device(self._get_device_id()) -+ device_id = self._get_device_id() -+ if device_id is None: -+ return -+ -+ device = self._blivet.devicetree.resolve_device(device_id) - if device is None: - return - -@@ -501,7 +501,11 @@ class BlivetPartitionVolume(BlivetVolume): +@@ -554,7 +554,11 @@ class BlivetPartitionVolume(BlivetVolume): return self._device.raw_device.type == 'partition' def _get_device_id(self): diff --git a/SOURCES/storage-trim-volume-size.diff b/SOURCES/storage-trim-volume-size.diff new file mode 100644 index 0000000..ef947c7 --- /dev/null +++ b/SOURCES/storage-trim-volume-size.diff @@ -0,0 +1,326 @@ +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/SPECS/rhel-system-roles.spec b/SPECS/rhel-system-roles.spec index b1fd790..9e6cda6 100644 --- a/SPECS/rhel-system-roles.spec +++ b/SPECS/rhel-system-roles.spec @@ -12,19 +12,30 @@ Name: linux-system-roles Url: https://github.com/linux-system-roles/ Summary: Set of interfaces for unified system management Version: 1.0.0 -Release: 27%{?dist} +Release: 29%{?dist} #Group: Development/Libraries License: GPLv3+ and MIT and BSD -%if 0%{?rhel} +%global installbase %{_datadir}/linux-system-roles +%global _pkglicensedir %{_licensedir}/%{name} %global rolealtprefix linux-system-roles. +%global roleprefix %{name}. +%global roleinstprefix %{nil} +%global rolealtrelpath ../../linux-system-roles/ +%if 0%{?rhel} +%global roleinstprefix %{roleprefix} +%global installbase %{_datadir}/ansible/roles +%global rolealtrelpath %{nil} +%endif + +%if 0%{?rhel} %global collection_namespace redhat %global collection_name rhel_system_roles %else %global collection_namespace fedora %global collection_name linux_system_roles %endif -%global roleprefix %{name}. +%global subrole_prefix "private_${role}_subrole_" %global collection_version %{version} @@ -38,7 +49,6 @@ License: GPLv3+ and MIT and BSD %if %{with ansible} BuildRequires: ansible >= 2.9.10 -Requires: ansible >= 2.9.10 %endif %if %{undefined ansible_collection_build} @@ -64,19 +74,29 @@ Requires: ansible >= 2.9.10 # This way the rest of the spec file des not need to know whether we are # dealing with a tag or a commit. %global archiveext tar.gz +# list of role names +%global rolenames %nil +# list of assignments that can be used to populate a bash associative array variable +%global rolestodir %nil %define getarchivedir() %(p=%{basename:%{S:%{1}}}; echo ${p%%.%{archiveext}}) %define defcommit() %{expand:%%global ref%{1} %{2} %%global shortcommit%{1} %%(c=%%{ref%{1}}; echo ${c:0:7}) -%%global extractdir%{1} %%{expand: %%getarchivedir %{1}} +%%global extractdir%{1} %%{expand:%%getarchivedir %{1}} %%{!?repo%{1}:%%global repo%{1} %%{rolename%{1}}} %%global archiveurl%{1} %%{?forgeorg%{1}}%%{!?forgeorg%{1}:%%{url}}%%{repo%{1}}/archive/%%{ref%{1}}/%%{repo%{1}}-%%{ref%{1}}.tar.gz +%%global rolenames %%{?rolenames} %%{rolename%{1}} +%%global roletodir%{1} [%{rolename%{1}}]="%{extractdir%{1}}" +%%global rolestodir %%{?rolestodir} %{roletodir%{1}} } %define deftag() %{expand:%%global ref%{1} %{2} -%%global extractdir%{1} %%{expand: %%getarchivedir %{1}} +%%global extractdir%{1} %%{expand:%%getarchivedir %{1}} %%{!?repo%{1}:%%global repo%{1} %%{rolename%{1}}} %%global archiveurl%{1} %%{?forgeorg%{1}}%%{!?forgeorg%{1}:%%{url}}%%{repo%{1}}/archive/%%{ref%{1}}/%%{repo%{1}}-%%{ref%{1}}.tar.gz +%%global rolenames %%{?rolenames} %%{rolename%{1}} +%%global roletodir%{1} [%{rolename%{1}}]="%{extractdir%{1}}" +%%global rolestodir %%{?rolestodir} %%{roletodir%{1}} } #%%defcommit 1 43eec5668425d295dce3801216c19b1916df1f9b @@ -95,13 +115,13 @@ Requires: ansible >= 2.9.10 %global rolename4 kdump #%%deftag 4 1.0.0 -%defcommit 5 675c7e8073f33ead5143cd5fc11e332f18524317 +%defcommit 5 bda206d45c87ee8c1a5284de84f5acf5e629de97 %global rolename5 network #%%deftag 5 1.0.0 -#%%defcommit 6 81f30ab336f4ecc61b4a30ffcb080e17fd35de2e +%defcommit 6 485de47b0dc0787aea077ba448ecb954f53e40c4 %global rolename6 storage -%deftag 6 1.2.2 +#%%deftag 6 1.2.2 %defcommit 7 e81b2650108727f38b1c856699aad26af0f44a46 %global rolename7 metrics @@ -111,11 +131,11 @@ Requires: ansible >= 2.9.10 %global rolename8 tlog %deftag 8 1.1.0 -#%%defcommit 9 901a73a4285469ef50a6cc37135ae55ce9d2e41b +%defcommit 9 e5e5abb35fb695e22ccffa855c98ab882650480e %global rolename9 kernel_settings -%deftag 9 1.0.1 +#%%deftag 9 1.0.1 -%defcommit 10 822c669ad659ef491b83efdcd78a417917c4055d +%defcommit 10 193e9034f9f74bbd8a0e9cd5b30e782a7e77dc6a %global rolename10 logging #%%deftag 10 0.2.0 @@ -123,11 +143,11 @@ Requires: ansible >= 2.9.10 %global rolename11 nbde_server %deftag 11 1.0.1 -#%%defcommit 12 6306defad146d8274b04f438a04e17e44672f1a6 +%defcommit 12 3af7452e4861ee2363b29b23bf78bf11e06be142 %global rolename12 nbde_client -%deftag 12 1.0.1 +#%%deftag 12 1.0.1 -%defcommit 13 19115b5f824141330861359a137d08ac32082502 +%defcommit 13 daecdc51cedaf67bf821f1f9f8f6c3cc0ca0d03f %global rolename13 certificate #%%deftag 13 1.0.1 @@ -139,7 +159,13 @@ Requires: ansible >= 2.9.10 %global rolename15 sshd %defcommit 15 e1de59b3c54e9d48a010eeca73755df339c7e628 -%global mainid 20d31bf5d8e7eb67ce48af39e36c9f79d87490e3 +%defcommit 16 effa0a0d993832dee726290f263a2182cf3eacda +%global rolename16 ssh + +%defcommit 17 779bb78559de58bb5a1f25a4b92039c373ef59a4 +%global rolename17 ha_cluster + +%global mainid e5ed203b2d7224c0bf0c3fd55452456c8f468cad Source: %{url}auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz Source1: %{archiveurl1} Source2: %{archiveurl2} @@ -156,13 +182,18 @@ Source12: %{archiveurl12} Source13: %{archiveurl13} Source14: %{archiveurl14} Source15: %{archiveurl15} +Source16: %{archiveurl16} +Source17: %{archiveurl17} +# 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 Patch31: timesync-tier1-tags.diff @@ -172,17 +203,23 @@ Patch43: kdump-meta-el8.diff 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: 0001-fix-collection-lookup-problem.patch Patch62: storage-partition-name.diff +Patch63: storage-no-disks-existing.diff +Patch64: storage-trim-volume-size.diff + +Patch71: metrics-mssql-x86.diff Patch151: sshd-example.diff +Patch152: sshd-work-on-ansible28-jinja27.diff BuildArch: noarch +# These are needed for md2html.sh to build the documentation BuildRequires: asciidoc BuildRequires: pandoc BuildRequires: highlight @@ -215,20 +252,12 @@ of Fedora, Red Hat Enterprise Linux & CentOS. %endif %prep -%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -n %{getarchivedir 0} -for rolename_id in %{extractdir1} %{extractdir2} %{extractdir3} \ - %{extractdir4} %{extractdir5} %{extractdir6} \ - %{extractdir7} %{extractdir8} %{extractdir9} \ - %{extractdir10} %{extractdir11} %{extractdir12} \ - %{extractdir13} %{extractdir14}; do - # assumes rolename has no dash in it - # note that we have to use double %% - # in order for a single % to be passed to bash - rolename=${rolename_id%%-*} - mv ${rolename_id} ${rolename} +%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -a16 -a17 -n %{getarchivedir 0} + +declare -A ROLESTODIR=(%{rolestodir}) +for rolename in %{rolenames}; do + mv "${ROLESTODIR[${rolename}]}" ${rolename} done -# how to do this inside the loop for all the roles? -mv %{extractdir15} %{rolename15} cd %{rolename1} %patch11 -p1 @@ -236,6 +265,7 @@ cd %{rolename1} cd .. cd %{rolename2} %patch21 -p1 +%patch22 -p1 cd .. cd %{rolename3} %patch31 -p1 @@ -251,27 +281,31 @@ cd %{rolename5} %patch52 -p1 %patch53 -p1 %patch55 -p1 -%patch56 -p1 cd .. cd %{rolename6} %patch62 -p1 +%patch63 -p1 +%patch64 -p1 +cd .. +cd %{rolename7} +%patch71 -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 cd .. # Replacing "linux-system-roles.rolename" with "rhel-system-roles.rolename" in each role -# Removing symlinkx in tests/roles -for rolename in %{rolename1} %{rolename2} %{rolename3} \ - %{rolename4} %{rolename5} %{rolename6} \ - %{rolename7} %{rolename8} %{rolename9} \ - %{rolename10} %{rolename11} %{rolename12} \ - %{rolename13} %{rolename14} %{rolename15}; do %if "%{roleprefix}" != "linux-system-roles." +for rolename in %{rolenames}; do find $rolename -type f -exec \ sed "s/linux-system-roles[.]${rolename}\\>/%{roleprefix}${rolename}/g" -i {} \; +done %endif + +# Removing symlinks in tests/roles +for rolename in %{rolenames}; do if [ -d ${rolename}/tests/roles ]; then find ${rolename}/tests/roles -type l -exec rm {} \; if [ -d ${rolename}/tests/roles/linux-system-roles.${rolename} ]; then @@ -303,7 +337,9 @@ sh md2html.sh \ %{rolename12}/README.md \ %{rolename13}/README.md \ %{rolename14}/README.md \ -%{rolename15}/README.md +%{rolename15}/README.md \ +%{rolename16}/README.md \ +%{rolename17}/README.md mkdir .collections %if 0%{?rhel} @@ -316,9 +352,10 @@ for role in %{rolename1} %{rolename2} %{rolename3} \ %{rolename4} %{rolename5} %{rolename6} \ %{rolename7} %{rolename8} %{rolename9} \ %{rolename10} %{rolename11} %{rolename12} \ - %{rolename13} %{rolename14} %{rolename15}; do + %{rolename13} %{rolename14} %{rolename15} \ + %{rolename16} %{rolename17}; do python3 lsr_role2collection.py --role "$role" --src-path "$role" \ - --src-owner %{name} --dest-path .collections \ + --src-owner %{name} --subrole-prefix %{subrole_prefix} --dest-path .collections \ --readme lsr_role2collection/collection_readme.md \ --namespace %{collection_namespace} --collection %{collection_name} done @@ -333,40 +370,45 @@ cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ %ansible_collection_build %install +mkdir -p $RPM_BUILD_ROOT%{installbase} mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles -cp -pR %{rolename1} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename1} -cp -pR %{rolename2} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename2} -cp -pR %{rolename3} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename3} -cp -pR %{rolename4} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename4} -cp -pR %{rolename5} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename5} -cp -pR %{rolename6} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename6} -cp -pR %{rolename7} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename7} -cp -pR %{rolename8} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename8} -cp -pR %{rolename9} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename9} -cp -pR %{rolename10} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename10} -cp -pR %{rolename11} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename11} -cp -pR %{rolename12} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename12} -cp -pR %{rolename13} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename13} -cp -pR %{rolename14} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename14} -cp -pR %{rolename15} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename15} +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} %if 0%{?rolealtprefix:1} -ln -s %{roleprefix}%{rolename1} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename1} -ln -s %{roleprefix}%{rolename2} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename2} -ln -s %{roleprefix}%{rolename3} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename3} -ln -s %{roleprefix}%{rolename4} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename4} -ln -s %{roleprefix}%{rolename5} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename5} -ln -s %{roleprefix}%{rolename6} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename6} -ln -s %{roleprefix}%{rolename7} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename7} -ln -s %{roleprefix}%{rolename8} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename8} -ln -s %{roleprefix}%{rolename9} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename9} -ln -s %{roleprefix}%{rolename10} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename10} -ln -s %{roleprefix}%{rolename11} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename11} -ln -s %{roleprefix}%{rolename12} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename12} -ln -s %{roleprefix}%{rolename13} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename13} -ln -s %{roleprefix}%{rolename14} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename14} -ln -s %{roleprefix}%{rolename15} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename15} +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} %endif mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/kdump @@ -384,149 +426,191 @@ 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%{_datadir}/ansible/roles/%{roleprefix}kdump/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/COPYING \ +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%{_datadir}/ansible/roles/%{roleprefix}postfix/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}postfix/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}postfix/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%{_datadir}/ansible/roles/%{roleprefix}selinux/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/COPYING \ +cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/README.md \ + $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}selinux/README.html \ $RPM_BUILD_ROOT%{_pkgdocdir}/selinux -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}selinux/selinux-playbook.yml \ +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%{_datadir}/ansible/roles/%{roleprefix}timesync/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/COPYING \ +cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/README.md \ + $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}timesync/README.html \ $RPM_BUILD_ROOT%{_pkgdocdir}/timesync -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/examples/multiple-ntp-servers.yml \ +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%{_datadir}/ansible/roles/%{roleprefix}timesync/examples/single-pool.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%{_datadir}/ansible/roles/%{roleprefix}network/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/LICENSE \ +cp -p $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/README.md \ + $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/README.html \ $RPM_BUILD_ROOT%{_pkgdocdir}/network -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/bond_with_vlan.yml \ +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%{_datadir}/ansible/roles/%{roleprefix}network/examples/bridge_with_vlan.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth_simple_auto.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth_with_vlan.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/infiniband.yml \ +mv $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/infiniband.yml \ $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-infiniband-playbook.yml -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/macvlan.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/remove_profile.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/remove_profile.yml -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/down_profile.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/down_profile.yml -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/inventory \ +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%{_datadir}/ansible/roles/%{roleprefix}network/examples/ethtool_features.yml \ +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%{_datadir}/ansible/roles/%{roleprefix}network/examples/ethtool_features_default.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/bond_simple.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/eth_with_802_1x.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/wireless_wpa_psk.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/remove+down_profile.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/dummy_simple.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/ethtool_coalesce.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%{_datadir}/ansible/roles/%{roleprefix}network/examples/team_simple.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 -# 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%{_datadir}/ansible/roles/%{roleprefix}sshd/examples/example-root-login.yml \ - $RPM_BUILD_ROOT%{_pkgdocdir}/sshd/example-root-login-playbook.yml - -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}storage/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}storage/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}storage/LICENSE \ +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%{_datadir}/ansible/roles/%{roleprefix}*/semaphore -rm -r $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}*/molecule +rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/semaphore +rm -r $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/molecule -rm -r $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}*/.[A-Za-z]* -rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}*/tests/.git* +rm -r $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/.[A-Za-z]* +rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}*/tests/.git* -rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/roles -rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples +rm $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples/roles +rmdir $RPM_BUILD_ROOT%{installbase}/%{roleinstprefix}network/examples -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}metrics/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}metrics/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}metrics/LICENSE \ +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%{_datadir}/ansible/roles/%{roleprefix}tlog/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}tlog/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}tlog/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%{_datadir}/ansible/roles/%{roleprefix}kernel_settings/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kernel_settings/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kernel_settings/LICENSE \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kernel_settings/COPYING \ +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%{_datadir}/ansible/roles/%{roleprefix}logging/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}logging/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}logging/LICENSE \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}logging/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%{_datadir}/ansible/roles/%{roleprefix}nbde_server/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}nbde_server/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}nbde_server/LICENSE \ +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%{_datadir}/ansible/roles/%{roleprefix}nbde_client/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}nbde_client/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}nbde_client/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%{_datadir}/ansible/roles/%{roleprefix}certificate/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}certificate/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}certificate/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%{_datadir}/ansible/roles/%{roleprefix}crypto_policies/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}crypto_policies/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}crypto_policies/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%{_datadir}/ansible/roles/%{roleprefix}sshd/README.md \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}sshd/README.html \ - $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}sshd/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 +# 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}/ %ansible_collection_install %files +%if %{without ansible} %dir %{_datadir}/ansible %dir %{_datadir}/ansible/roles +%endif +%if "%{installbase}" != "%{_datadir}/ansible/roles" +%dir %{installbase} +%endif %if 0%{?rolealtprefix:1} %{_datadir}/ansible/roles/%{rolealtprefix}kdump %{_datadir}/ansible/roles/%{rolealtprefix}postfix @@ -543,81 +627,112 @@ cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ %{_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 -%{_datadir}/ansible/roles/%{roleprefix}kdump -%{_datadir}/ansible/roles/%{roleprefix}postfix -%{_datadir}/ansible/roles/%{roleprefix}selinux -%{_datadir}/ansible/roles/%{roleprefix}timesync -%{_datadir}/ansible/roles/%{roleprefix}network -%{_datadir}/ansible/roles/%{roleprefix}storage -%{_datadir}/ansible/roles/%{roleprefix}metrics -%{_datadir}/ansible/roles/%{roleprefix}tlog -%{_datadir}/ansible/roles/%{roleprefix}kernel_settings -%{_datadir}/ansible/roles/%{roleprefix}logging -%{_datadir}/ansible/roles/%{roleprefix}nbde_server -%{_datadir}/ansible/roles/%{roleprefix}nbde_client -%{_datadir}/ansible/roles/%{roleprefix}certificate -%{_datadir}/ansible/roles/%{roleprefix}crypto_policies -%{_datadir}/ansible/roles/%{roleprefix}sshd -%doc %{_pkgdocdir}/*/example-*-playbook.yml -%doc %{_pkgdocdir}/network/example-inventory -%doc %{_pkgdocdir}/*/README.md -%doc %{_pkgdocdir}/*/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}kdump/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}postfix/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}selinux/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}timesync/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}network/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}storage/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}metrics/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}tlog/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}kernel_settings/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}logging/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}nbde_server/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}nbde_client/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}certificate/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}crypto_policies/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}sshd/README.md -%doc %{_datadir}/ansible/roles/%{roleprefix}kdump/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}postfix/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}selinux/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}timesync/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}network/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}storage/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}metrics/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}tlog/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}kernel_settings/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}logging/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}nbde_server/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}nbde_client/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}certificate/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}crypto_policies/README.html -%doc %{_datadir}/ansible/roles/%{roleprefix}sshd/README.html - - -%license %{_pkgdocdir}/*/COPYING -%license %{_pkgdocdir}/*/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}kdump/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}postfix/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}selinux/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}timesync/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}network/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}storage/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}metrics/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}tlog/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}kernel_settings/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}kernel_settings/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}logging/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}logging/COPYING -%license %{_datadir}/ansible/roles/%{roleprefix}nbde_server/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}nbde_client/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}certificate/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}crypto_policies/LICENSE -%license %{_datadir}/ansible/roles/%{roleprefix}sshd/LICENSE +%{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 +%{_pkgdocdir}/*/README.md +%{_pkgdocdir}/*/README.html +%doc %{installbase}/%{roleinstprefix}kdump/README.md +%doc %{installbase}/%{roleinstprefix}postfix/README.md +%doc %{installbase}/%{roleinstprefix}selinux/README.md +%doc %{installbase}/%{roleinstprefix}timesync/README.md +%doc %{installbase}/%{roleinstprefix}network/README.md +%doc %{installbase}/%{roleinstprefix}storage/README.md +%doc %{installbase}/%{roleinstprefix}metrics/README.md +%doc %{installbase}/%{roleinstprefix}tlog/README.md +%doc %{installbase}/%{roleinstprefix}kernel_settings/README.md +%doc %{installbase}/%{roleinstprefix}logging/README.md +%doc %{installbase}/%{roleinstprefix}nbde_server/README.md +%doc %{installbase}/%{roleinstprefix}nbde_client/README.md +%doc %{installbase}/%{roleinstprefix}certificate/README.md +%doc %{installbase}/%{roleinstprefix}crypto_policies/README.md +%doc %{installbase}/%{roleinstprefix}sshd/README.md +%doc %{installbase}/%{roleinstprefix}kdump/README.html +%doc %{installbase}/%{roleinstprefix}postfix/README.html +%doc %{installbase}/%{roleinstprefix}selinux/README.html +%doc %{installbase}/%{roleinstprefix}timesync/README.html +%doc %{installbase}/%{roleinstprefix}network/README.html +%doc %{installbase}/%{roleinstprefix}storage/README.html +%doc %{installbase}/%{roleinstprefix}metrics/README.html +%doc %{installbase}/%{roleinstprefix}tlog/README.html +%doc %{installbase}/%{roleinstprefix}kernel_settings/README.html +%doc %{installbase}/%{roleinstprefix}logging/README.html +%doc %{installbase}/%{roleinstprefix}nbde_server/README.html +%doc %{installbase}/%{roleinstprefix}nbde_client/README.html +%doc %{installbase}/%{roleinstprefix}certificate/README.html +%doc %{installbase}/%{roleinstprefix}crypto_policies/README.html +%doc %{installbase}/%{roleinstprefix}sshd/README.html +%doc %{installbase}/%{roleinstprefix}ssh/README.html +%doc %{installbase}/%{roleinstprefix}ha_cluster/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} %changelog +* Thu Feb 18 2021 Pavel Cahyna - 1.0.0-29 +- Change internal role prefix to more descriptive private_${role}_subrole_ +- Sync spec improvements from Fedora and introduce helper macros + No functional change except for license files location +- Disable mssql metrics test on non-x86_64 where the packages + are not available. Upstream PR #73 + +* Wed Feb 17 2021 Rich Megginson - 1.0.0-28 +- Add patch for sshd https://github.com/willshersystems/ansible-sshd/pull/155 + for ansible 2.8/jinja 2.7 support for sshd role +- Rebase certificate, kernel_settings, nbde_client for jinja27 +- Rebase the logging role, Resolves rhbz#1927943 +- Rebase storage role, Resolves rhbz#1894651 - interpreatation of + omitted parameters +- Apply storage PR #201 to dispense with the need of listing all disks + in existing pools, Resolves rhbz1894676 +- Apply storage PR #199 to allow reducing the requested volume sizes + if needed to fit, Resolves rhbz1894647 +- Rebase the network role, Resolves rhbz1893959, rhbz1893957 +- Add the ssh client role, Resolves rhbz1893712 +- Minor issue in selinux - no variable named present + Resolves rhbz1926947 +- Prefix internal roles with private_, resolves rhbz#1927417 +- Add the ha_cluster role, Resolves rhbz#1893743 + * Thu Feb 11 2021 Pavel Cahyna - 1.0.0-27 - Rebase the logging role, Resolves rhbz#1889484 - Fixes to collection docs and galaxy metadata from nhosoi @@ -794,7 +909,7 @@ cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ - Fix merge botch * Mon Mar 19 2018 Troy Dawson - 0.6-3.1 -- Use -a (after cd) instead of -b (before cd) in %setup +- Use -a (after cd) instead of -b (before cd) in %%setup * Wed Mar 14 2018 Pavel Cahyna - 0.6-3 - Minor corrections of the previous change by Till Maas.