diff --git a/.gitignore b/.gitignore index 3e1ea12..f7e3c78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ SOURCES/kdump-0c2bb28.tar.gz -SOURCES/network-8ec0196.tar.gz +SOURCES/network-3fc15de.tar.gz SOURCES/postfix-0.1.tar.gz SOURCES/selinux-6cd1ec8.tar.gz -SOURCES/timesync-85b90fe.tar.gz +SOURCES/storage-1.1.0.tar.gz +SOURCES/timesync-1.0.2.tar.gz diff --git a/.rhel-system-roles.metadata b/.rhel-system-roles.metadata index 9c246b1..36d9271 100644 --- a/.rhel-system-roles.metadata +++ b/.rhel-system-roles.metadata @@ -1,5 +1,6 @@ 36b200d1c6a8d1cb1ea87e3e9aa8c4f6bbd8155d SOURCES/kdump-0c2bb28.tar.gz -d4d67376d419286b62dbdcd80c1afccbab5e75af SOURCES/network-8ec0196.tar.gz +c6192d6b13aa644944fef28d9f90e81ff0e2f6dc SOURCES/network-3fc15de.tar.gz 66c82331f4ac9598c506c3999965b4d07dbfe49d SOURCES/postfix-0.1.tar.gz 246383bd6823533ed3a51a0501b75e38ba852908 SOURCES/selinux-6cd1ec8.tar.gz -f660bba90dcd41a33c5aaa5286533ba6365660eb SOURCES/timesync-85b90fe.tar.gz +5cc010861c00ac6c3222dc0e93a216b4fea331da SOURCES/storage-1.1.0.tar.gz +2dc22970e0e660921acfbbdfab5282ca32d70947 SOURCES/timesync-1.0.2.tar.gz diff --git a/SOURCES/kdump-tier1-tags.diff b/SOURCES/kdump-tier1-tags.diff new file mode 100644 index 0000000..e3c9fde --- /dev/null +++ b/SOURCES/kdump-tier1-tags.diff @@ -0,0 +1,100 @@ +diff --git a/tests/commonvars.yml b/tests/commonvars.yml +new file mode 100644 +index 0000000..2cd3566 +--- /dev/null ++++ b/tests/commonvars.yml +@@ -0,0 +1,2 @@ ++restore_services: ++ - kdump +diff --git a/tests/get_services_state.yml b/tests/get_services_state.yml +new file mode 100644 +index 0000000..4fe5d36 +--- /dev/null ++++ b/tests/get_services_state.yml +@@ -0,0 +1,4 @@ ++- name: Get initial state of services ++ tags: tests::cleanup ++ service_facts: ++ register: initial_state +diff --git a/tests/restore_services_state.yml b/tests/restore_services_state.yml +new file mode 100644 +index 0000000..2035dfc +--- /dev/null ++++ b/tests/restore_services_state.yml +@@ -0,0 +1,22 @@ ++- block: ++ - name: load common vars ++ include_vars: ++ file: commonvars.yml ++ ++ - name: Get final state of services ++ service_facts: ++ register: final_state ++ ++ - name: Restore state of services ++ service: ++ name: "{{ item }}" ++ state: "{{ 'started' if ++ initial_state.ansible_facts.services[sname]['state'] ++ == 'running' else 'stopped' }}" ++ when: ++ - sname in final_state.ansible_facts.services ++ - sname in initial_state.ansible_facts.services ++ vars: ++ sname: "{{ item + '.service' }}" ++ with_items: "{{ restore_services }}" ++ tags: tests::cleanup +diff --git a/tests/tests_default.yml b/tests/tests_default.yml +index 4c93830..60d7967 100644 +--- a/tests/tests_default.yml ++++ b/tests/tests_default.yml +@@ -1,6 +1,18 @@ + + - name: Ensure that the rule runs with default parameters ++ tags: ++ - 'tests::tier1' + hosts: all + + roles: + - kdump ++ ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml ++ ++ post_tasks: ++ - name: Import tasks ++ 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 2763fbd..617acb3 100644 +--- a/tests/tests_default_wrapper.yml ++++ b/tests/tests_default_wrapper.yml +@@ -1,6 +1,9 @@ + --- + - name: Create static inventory from hostvars + hosts: all ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + tasks: + - name: create temporary file + tempfile: +@@ -17,10 +20,16 @@ + + + - name: Run tests_default.yml normally ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + import_playbook: tests_default.yml + + - name: Run tests_default.yml in check_mode + hosts: all ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + tasks: + - name: Run ansible-playbook with tests_default.yml in check mode + command: ansible-playbook -vvv -i {{ tempinventory.path }} --check tests_default.yml diff --git a/SOURCES/network-nm-reload-profile.diff b/SOURCES/network-nm-reload-profile.diff new file mode 100644 index 0000000..cd243a3 --- /dev/null +++ b/SOURCES/network-nm-reload-profile.diff @@ -0,0 +1,13 @@ +diff --git a/tests/playbooks/tests_ethtool_features.yml b/tests/playbooks/tests_ethtool_features.yml +index bdaddb0..c4b35b9 100644 +--- a/tests/playbooks/tests_ethtool_features.yml ++++ b/tests/playbooks/tests_ethtool_features.yml +@@ -115,5 +115,8 @@ + - include_tasks: tasks/manage_test_interface.yml + vars: + state: absent ++ - name: Reload NetworkManager config ++ command: nmcli connection reload ++ ignore_errors: true + tags: + - "tests::cleanup" diff --git a/SOURCES/network-tier1-tags.diff b/SOURCES/network-tier1-tags.diff new file mode 100644 index 0000000..95efa90 --- /dev/null +++ b/SOURCES/network-tier1-tags.diff @@ -0,0 +1,401 @@ +diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml +index 8151294..0c6c965 100644 +--- a/tests/playbooks/tests_802_1x.yml ++++ b/tests/playbooks/tests_802_1x.yml +@@ -1,5 +1,10 @@ + # SPDX-License-Identifier: BSD-3-Clause + --- ++- name: Save host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/save_state.yml ++ + - hosts: all + vars: + interface: 802-1x-test +@@ -105,3 +110,8 @@ + - include_tasks: tasks/cleanup_802_1x_server.yml + tags: + - "tests::cleanup" ++ ++- name: Restore host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_bridge.yml b/tests/playbooks/tests_bridge.yml +index d79d6ad..c8cf3cd 100644 +--- a/tests/playbooks/tests_bridge.yml ++++ b/tests/playbooks/tests_bridge.yml +@@ -1,5 +1,10 @@ + # SPDX-License-Identifier: BSD-3-Clause + --- ++- name: Save host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/save_state.yml ++ + - name: Test configuring bridges + hosts: all + vars: +@@ -14,6 +19,8 @@ + + - name: Add test bridge + hosts: all ++ tags: ++ - 'tests::net::bridge' + vars: + network_connections: + - name: "{{ interface }}" +@@ -36,11 +43,15 @@ + task: tasks/assert_profile_present.yml + + - import_playbook: down_profile.yml ++ tags: ++ - 'tests::net::bridge' + vars: + profile: "{{ interface }}" + # FIXME: assert profile/device down + + - import_playbook: remove_profile.yml ++ tags: ++ - 'tests::net::bridge' + vars: + profile: "{{ interface }}" + +@@ -51,5 +62,19 @@ + + # FIXME: Devices might still be left when profile is absent + # - import_playbook: run_tasks.yml +-# vars: ++# vars: + # task: tasks/assert_device_absent.yml ++ ++- name: Remove test bridge ++ hosts: all ++ tags: ++ - 'tests::cleanup' ++ - 'tests::net::bridge::cleanup' ++ tasks: ++ - command: 'ip link delete "{{ interface }}"' ++ ignore_errors: yes ++ ++- name: Restore host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_checkpoint_cleanup.yml b/tests/playbooks/tests_checkpoint_cleanup.yml +index 18e3fd7..3b5a41a 100644 +--- a/tests/playbooks/tests_checkpoint_cleanup.yml ++++ b/tests/playbooks/tests_checkpoint_cleanup.yml +@@ -4,6 +4,11 @@ + # mark a device as unmanaged for NM and then tries to activiate it using NM. + # This failed without removing the checkpoint. + --- ++- name: Save host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/save_state.yml ++ + - hosts: all + vars: + interface: cptstbr +@@ -80,3 +85,8 @@ + ignore_errors: true + tags: + - "tests::cleanup" ++ ++- name: Restore host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_ethernet.yml b/tests/playbooks/tests_ethernet.yml +index cd02579..adcffee 100644 +--- a/tests/playbooks/tests_ethernet.yml ++++ b/tests/playbooks/tests_ethernet.yml +@@ -1,5 +1,10 @@ + # SPDX-License-Identifier: BSD-3-Clause + --- ++- name: Save host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/save_state.yml ++ + - hosts: all + tasks: + - debug: +@@ -9,6 +14,8 @@ + + - name: Test configuring ethernet devices + hosts: all ++ tags: ++ - 'tests::net::veth' + vars: + type: veth + interface: lsr27 +@@ -26,6 +33,8 @@ + + - name: Test static interface up + hosts: all ++ tags: ++ - 'tests::net::reconf' + vars: + network_connections: + - name: "{{ interface }}" +@@ -48,17 +57,29 @@ + # FIXME: assert profile present + # FIXME: assert profile/device up + IP address + - import_playbook: down_profile.yml ++ tags: ++ - 'tests::cleanup' + vars: + profile: "{{ interface }}" + # FIXME: assert profile/device down + - import_playbook: remove_profile.yml ++ tags: ++ - 'tests::cleanup' + vars: + profile: "{{ interface }}" + # FIXME: assert profile away + - name: Remove interfaces + hosts: all ++ tags: ++ - 'tests::cleanup' ++ - 'tests::net::veth::cleanup' + tasks: + - include_tasks: tasks/manage_test_interface.yml + vars: + state: absent + - include_tasks: tasks/assert_device_absent.yml ++ ++- name: Restore host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_reapply.yml b/tests/playbooks/tests_reapply.yml +index 4b1cb09..6995607 100644 +--- a/tests/playbooks/tests_reapply.yml ++++ b/tests/playbooks/tests_reapply.yml +@@ -4,6 +4,11 @@ + # of via Ansible. Until there is better test support for this, just check the + # log output for the respective log message. + --- ++- name: Save host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/save_state.yml ++ + - hosts: all + vars: + interface: rpltstbr +@@ -64,3 +69,8 @@ + ignore_errors: true + tags: + - "tests::cleanup" ++ ++- name: Restore host state ++ hosts: all ++ tasks: ++ - import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_states.yml b/tests/playbooks/tests_states.yml +index 8edbf8f..ef59063 100644 +--- a/tests/playbooks/tests_states.yml ++++ b/tests/playbooks/tests_states.yml +@@ -22,6 +22,8 @@ + ip: + dhcp4: false + auto6: false ++ tags: ++ - 'tests::net::bridge' + - include_tasks: tasks/assert_device_present.yml + - include_tasks: tasks/assert_profile_present.yml + +@@ -75,3 +77,18 @@ + - assert: + that: __network_test_failed + fail_msg: "The role did not fail when it should have" ++ ++ pre_tasks: ++ - name: Save host state ++ import_tasks: tasks/save_state.yml ++ ++ post_tasks: ++ - name: Remove test bridge in case it is still lingering ++ command: 'ip link delete "{{ interface }}"' ++ tags: ++ - 'tests::cleanup' ++ - 'tests::net::bridge::cleanup' ++ ignore_errors: yes ++ ++ - name: Restore host state ++ import_tasks: tasks/restore_state.yml +diff --git a/tests/playbooks/tests_vlan_mtu.yml b/tests/playbooks/tests_vlan_mtu.yml +index 029b599..378d5fe 100644 +--- a/tests/playbooks/tests_vlan_mtu.yml ++++ b/tests/playbooks/tests_vlan_mtu.yml +@@ -10,6 +10,8 @@ + - include_tasks: tasks/manage_test_interface.yml + vars: + state: present ++ tags: ++ - 'tests::net::veth' + - include_tasks: tasks/assert_device_present.yml + - name: >- + TEST: I can configure the MTU for a vlan interface without autoconnect. +@@ -38,6 +40,8 @@ + ip: + dhcp4: false + auto6: false ++ tags: ++ - 'tests::net::reconf' + - include_tasks: tasks/assert_device_present.yml + vars: + interface: "{{ vlan_interface }}" +@@ -62,6 +66,20 @@ + persistent_state: absent + state: down + ignore_errors: true ++ tags: ++ - 'tests::cleanup' ++ - 'tests::net::veth::cleanup' + - include_tasks: tasks/manage_test_interface.yml + vars: + state: absent ++ tags: ++ - 'tests::cleanup' ++ - 'tests::net::veth::cleanup' ++ ++ pre_tasks: ++ - name: Save host state ++ import_tasks: tasks/save_state.yml ++ ++ post_tasks: ++ - name: Restore host state ++ import_tasks: tasks/restore_state.yml +diff --git a/tests/tasks/commonvars.yml b/tests/tasks/commonvars.yml +new file mode 100644 +index 0000000..50452f7 +--- /dev/null ++++ b/tests/tasks/commonvars.yml +@@ -0,0 +1,2 @@ ++restore_services: ++ - NetworkManager +diff --git a/tests/tasks/get_services_state.yml b/tests/tasks/get_services_state.yml +new file mode 100644 +index 0000000..4fe5d36 +--- /dev/null ++++ b/tests/tasks/get_services_state.yml +@@ -0,0 +1,4 @@ ++- name: Get initial state of services ++ tags: tests::cleanup ++ service_facts: ++ register: initial_state +diff --git a/tests/tasks/restore_services_state.yml b/tests/tasks/restore_services_state.yml +new file mode 100644 +index 0000000..2035dfc +--- /dev/null ++++ b/tests/tasks/restore_services_state.yml +@@ -0,0 +1,22 @@ ++- block: ++ - name: load common vars ++ include_vars: ++ file: commonvars.yml ++ ++ - name: Get final state of services ++ service_facts: ++ register: final_state ++ ++ - name: Restore state of services ++ service: ++ name: "{{ item }}" ++ state: "{{ 'started' if ++ initial_state.ansible_facts.services[sname]['state'] ++ == 'running' else 'stopped' }}" ++ when: ++ - sname in final_state.ansible_facts.services ++ - sname in initial_state.ansible_facts.services ++ vars: ++ sname: "{{ item + '.service' }}" ++ with_items: "{{ restore_services }}" ++ tags: tests::cleanup +diff --git a/tests/tasks/restore_state.yml b/tests/tasks/restore_state.yml +new file mode 100644 +index 0000000..f4e3d5f +--- /dev/null ++++ b/tests/tasks/restore_state.yml +@@ -0,0 +1,24 @@ ++--- ++- name: Remove /etc/sysconfig/network if there was no one ++ tags: ++ - 'tests::cleanup' ++ file: ++ path: /etc/sysconfig/network ++ state: absent ++ when: ++ - etc_sysconfig_network_stat is defined ++ - not etc_sysconfig_network_stat.stat.exists ++ ++- name: Restore services ++ import_tasks: restore_services_state.yml ++ ++- name: reload NetworkManager ++ tags: ++ - 'tests::cleanup' ++ command: nmcli connection reload ++ when: ++ - sname in final_state.ansible_facts.services ++ - sname in initial_state.ansible_facts.services ++ - final_state.ansible_facts.services[sname]['state'] == 'running' ++ vars: ++ sname: NetworkManager.service +diff --git a/tests/tasks/save_state.yml b/tests/tasks/save_state.yml +new file mode 100644 +index 0000000..5690aed +--- /dev/null ++++ b/tests/tasks/save_state.yml +@@ -0,0 +1,11 @@ ++--- ++- name: Get services state ++ import_tasks: get_services_state.yml ++ ++- name: Investigate /etc/sysconfig/network presence ++ tags: ++ - 'tests::cleanup' ++ stat: ++ path: /etc/sysconfig/network ++ register: etc_sysconfig_network_stat ++ ignore_errors: yes +diff --git a/tests/tests_default.yml b/tests/tests_default.yml +index f6f7550..98e3c7e 100644 +--- a/tests/tests_default.yml ++++ b/tests/tests_default.yml +@@ -10,3 +10,11 @@ + that: + - "'warnings' not in __network_connections_result" + msg: "There are warnings" ++ ++ pre_tasks: ++ - name: Save host state ++ import_tasks: tasks/save_state.yml ++ ++ post_tasks: ++ - name: Restore host state ++ import_tasks: tasks/restore_state.yml +diff --git a/tests/tests_helpers_and_asserts.yml b/tests/tests_helpers_and_asserts.yml +index 5514182..d9bfa11 100644 +--- a/tests/tests_helpers_and_asserts.yml ++++ b/tests/tests_helpers_and_asserts.yml +@@ -15,6 +15,14 @@ + type: dummy + interface: dummy1298 + ++ pre_tasks: ++ - name: Save host state ++ import_tasks: tasks/save_state.yml ++ ++ post_tasks: ++ - name: Restore host state ++ import_tasks: tasks/restore_state.yml ++ + # FIXME: when: does not seem to work with include_tasks, therefore this cannot + # be safely tested for now + # - name: test tap interfaces diff --git a/SOURCES/rhel-system-roles-network-prefix.diff b/SOURCES/rhel-system-roles-network-prefix.diff index d60a8ea..a79e7ba 100644 --- a/SOURCES/rhel-system-roles-network-prefix.diff +++ b/SOURCES/rhel-system-roles-network-prefix.diff @@ -1,45 +1,94 @@ -diff --git a/examples/bond-with-vlan.yml b/examples/bond-with-vlan.yml +diff --git a/examples/bond_simple.yml b/examples/bond_simple.yml +index cd88676..6155634 100644 +--- a/examples/bond_simple.yml ++++ b/examples/bond_simple.yml +@@ -29,5 +29,5 @@ + master: bond0 + + roles: +- - linux-system-roles.network ++ - rhel-system-roles.network + ... +diff --git a/examples/bond_with_vlan.yml b/examples/bond_with_vlan.yml index 2e6be23..3b7a6dc 100644 ---- a/examples/bond-with-vlan.yml -+++ b/examples/bond-with-vlan.yml +--- a/examples/bond_with_vlan.yml ++++ b/examples/bond_with_vlan.yml @@ -35,4 +35,4 @@ - "192.0.2.{{ network_iphost }}/24" roles: - - linux-system-roles.network + - rhel-system-roles.network -diff --git a/examples/bridge-with-vlan.yml b/examples/bridge-with-vlan.yml +diff --git a/examples/bridge_with_vlan.yml b/examples/bridge_with_vlan.yml index 037ff8e..83c586d 100644 ---- a/examples/bridge-with-vlan.yml -+++ b/examples/bridge-with-vlan.yml +--- a/examples/bridge_with_vlan.yml ++++ b/examples/bridge_with_vlan.yml @@ -33,4 +33,4 @@ - "192.0.2.{{ network_iphost }}/24" roles: - - linux-system-roles.network + - rhel-system-roles.network -diff --git a/examples/eth-simple-auto.yml b/examples/eth-simple-auto.yml +diff --git a/examples/eth_simple_auto.yml b/examples/eth_simple_auto.yml index 0ba168a..e4c4a54 100644 ---- a/examples/eth-simple-auto.yml -+++ b/examples/eth-simple-auto.yml +--- a/examples/eth_simple_auto.yml ++++ b/examples/eth_simple_auto.yml @@ -15,4 +15,4 @@ mtu: 1450 roles: - - linux-system-roles.network + - rhel-system-roles.network -diff --git a/examples/eth-with-vlan.yml b/examples/eth-with-vlan.yml ---- a/examples/eth-with-vlan.yml 2018-08-21 20:47:38.000000000 +0200 -+++ b/examples/eth-with-vlan.yml 2018-11-06 22:29:14.591770335 +0100 +diff --git a/examples/eth_with_802_1x.yml b/examples/eth_with_802_1x.yml +index 92a93a9..7731b7d 100644 +--- a/examples/eth_with_802_1x.yml ++++ b/examples/eth_with_802_1x.yml +@@ -27,4 +27,4 @@ + - client.pem + - cacert.pem + roles: +- - linux-system-roles.network ++ - rhel-system-roles.network +diff --git a/examples/eth_with_vlan.yml b/examples/eth_with_vlan.yml +index 69da673..e0c2f11 100644 +--- a/examples/eth_with_vlan.yml ++++ b/examples/eth_with_vlan.yml @@ -26,4 +26,4 @@ - "192.0.2.{{ network_iphost }}/24" roles: - - linux-system-roles.network + - rhel-system-roles.network +diff --git a/examples/ethtool_features.yml b/examples/ethtool_features.yml +index d8842c2..b32ad0b 100644 +--- a/examples/ethtool_features.yml ++++ b/examples/ethtool_features.yml +@@ -3,7 +3,7 @@ + - hosts: all + tasks: + - include_role: +- name: linux-system-roles.network ++ name: rhel-system-roles.network + vars: + network_connections: + - name: "{{ network_interface_name1 }}" +diff --git a/examples/ethtool_features_default.yml b/examples/ethtool_features_default.yml +index 78965e6..3cdd731 100644 +--- a/examples/ethtool_features_default.yml ++++ b/examples/ethtool_features_default.yml +@@ -3,7 +3,7 @@ + - hosts: all + tasks: + - include_role: +- name: linux-system-roles.network ++ name: rhel-system-roles.network + vars: + network_connections: + - name: "{{ network_interface_name1 }}" diff --git a/examples/infiniband.yml b/examples/infiniband.yml ---- a/examples/infiniband.yml 2018-08-21 20:47:38.000000000 +0200 -+++ b/examples/infiniband.yml 2018-11-06 22:29:14.591770335 +0100 +index 22603d9..9e7e267 100644 +--- a/examples/infiniband.yml ++++ b/examples/infiniband.yml @@ -23,4 +23,4 @@ - 198.51.100.133/30 @@ -47,6 +96,7 @@ diff --git a/examples/infiniband.yml b/examples/infiniband.yml - - linux-system-roles.network + - rhel-system-roles.network diff --git a/examples/macvlan.yml b/examples/macvlan.yml +index 90cd09d..0064ad4 100644 --- a/examples/macvlan.yml +++ b/examples/macvlan.yml @@ -26,4 +26,4 @@ diff --git a/SOURCES/rhel-system-roles-storage-prefix.diff b/SOURCES/rhel-system-roles-storage-prefix.diff new file mode 100644 index 0000000..c618f26 --- /dev/null +++ b/SOURCES/rhel-system-roles-storage-prefix.diff @@ -0,0 +1,13 @@ +diff --git a/README.md b/README.md +index c2debc9..d9e40b3 100644 +--- a/README.md ++++ b/README.md +@@ -84,7 +84,7 @@ Example Playbook + - hosts: all + + roles: +- - name: linux-system-roles.storage ++ - name: rhel-system-roles.storage + storage_pools: + - name: app + disks: diff --git a/SOURCES/selinux-tier1-tags.diff b/SOURCES/selinux-tier1-tags.diff new file mode 100644 index 0000000..a5bdf86 --- /dev/null +++ b/SOURCES/selinux-tier1-tags.diff @@ -0,0 +1,176 @@ +diff --git a/tests/set_selinux_variables.yml b/tests/set_selinux_variables.yml +index f294101..7571066 100644 +--- a/tests/set_selinux_variables.yml ++++ b/tests/set_selinux_variables.yml +@@ -1,4 +1,12 @@ + --- ++- name: Install SELinux tool semanage on Fedora ++ package: ++ name: ++ - policycoreutils-python-utils ++ state: present ++ when: ansible_distribution == "Fedora" or ++ ( ansible_distribution_major_version > "7" and ++ ( ansible_distribution == "CentOS" or ansible_distribution == "RedHat" )) + - name: Get local modifications - boolean + command: /usr/sbin/semanage boolean -l -n -C + register: selinux_role_boolean +diff --git a/tests/tests_boolean.yml b/tests/tests_boolean.yml +index 47eafc0..ca85922 100644 +--- a/tests/tests_boolean.yml ++++ b/tests/tests_boolean.yml +@@ -1,5 +1,6 @@ + + - name: Check if selinux role sets SELinux booleans ++ tags: [ 'tests::tier1', 'tests::expfail' ] + hosts: all + become: true + +@@ -12,7 +13,7 @@ + selinux_booleans: + - { name: 'samba_enable_home_dirs', state: 'on', persistent: 'yes' } + +- - include: set_selinux_variables.yml ++ - import_tasks: set_selinux_variables.yml + - name: save state after initial changes and before other changes + set_fact: + boolean_before: "{{ selinux_role_boolean.stdout_lines }}" +diff --git a/tests/tests_default.yml b/tests/tests_default.yml +index a837c73..25bf39d 100644 +--- a/tests/tests_default.yml ++++ b/tests/tests_default.yml +@@ -1,5 +1,6 @@ + + - name: Ensure that the role runs with default parameters ++ tags: tests::tier1 + hosts: all + + roles: +diff --git a/tests/tests_default_vars.yml b/tests/tests_default_vars.yml +index b6a6b5a..7cd321d 100644 +--- a/tests/tests_default_vars.yml ++++ b/tests/tests_default_vars.yml +@@ -1,4 +1,5 @@ + - name: Ensure that the role declares all paremeters in defaults ++ tags: tests::tier1 + hosts: all + + roles: +diff --git a/tests/tests_fcontext.yml b/tests/tests_fcontext.yml +index 0a411fb..f4a3923 100644 +--- a/tests/tests_fcontext.yml ++++ b/tests/tests_fcontext.yml +@@ -1,5 +1,6 @@ + + - name: Check if selinux role sets SELinux fcontext mappings ++ tags: tests::tier1 + hosts: all + become: true + +@@ -13,7 +14,7 @@ + selinux_fcontexts: + - { target: '/tmp/test_dir1(/.*)?', setype: 'user_home_dir_t', ftype: 'd' } + +- - include: set_selinux_variables.yml ++ - import_tasks: set_selinux_variables.yml + - name: save state after initial changes and before other changes + set_fact: + fcontext_before: "{{ selinux_role_fcontext.stdout }}" +diff --git a/tests/tests_login.yml b/tests/tests_login.yml +index efa826d..e4f55ca 100644 +--- a/tests/tests_login.yml ++++ b/tests/tests_login.yml +@@ -1,5 +1,6 @@ + + - name: Check if selinux role sets SELinux login mappings ++ tags: tests::tier1 + hosts: all + become: true + +@@ -18,7 +19,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 + - name: save state after initial changes and before other changes + set_fact: + login_before: "{{ selinux_role_login.stdout }}" +diff --git a/tests/tests_port.yml b/tests/tests_port.yml +index 446f79d..03276b5 100644 +--- a/tests/tests_port.yml ++++ b/tests/tests_port.yml +@@ -1,5 +1,6 @@ + + - name: Check if selinux role sets SELinux port mapping ++ tags: tests::tier1 + hosts: all + become: true + +@@ -29,7 +30,7 @@ + selinux_ports: + - { ports: '22022', proto: 'tcp', setype: 'ssh_port_t', state: 'present' } + +- - include: set_selinux_variables.yml ++ - import_tasks: set_selinux_variables.yml + - name: save state after other changes + set_fact: + port_after: "{{ selinux_role_port.stdout }}" +diff --git a/tests/tests_selinux_disabled.yml b/tests/tests_selinux_disabled.yml +index afd23e4..d30de2b 100644 +--- a/tests/tests_selinux_disabled.yml ++++ b/tests/tests_selinux_disabled.yml +@@ -18,7 +19,9 @@ + name: + - policycoreutils-python-utils + state: present +- when: ansible_distribution == "Fedora" ++ when: ansible_distribution == "Fedora" or ++ ( ansible_distribution_major_version > "7" and ++ ( ansible_distribution == "CentOS" or ansible_distribution == "RedHat" )) + + - name: Add a Linux System Roles SELinux User + user: +@@ -67,17 +71,28 @@ + assert: + that: "{{ ansible_selinux.config_mode == 'enforcing' }}" + 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 +- - name: Remove /etc/selinux/config backup +- file: +- path: /etc/selinux/config.test_selinux_disabled +- state: absent +- - name: Remove Linux System Roles SELinux User +- user: +- name: sar-user +- remove: yes +- state: absent ++ ++ - name: Cleanup ++ tags: [ 'tests::cleanup' ] ++ block: ++ - name: Restore original /etc/selinux/config ++ copy: ++ remote_src: true ++ dest: /etc/selinux/config ++ src: /etc/selinux/config.test_selinux_disabled ++ ++ - name: Remove /etc/selinux/config backup ++ file: ++ path: /etc/selinux/config.test_selinux_disabled ++ state: absent ++ ++ - name: Remove Linux System Roles SELinux User ++ user: ++ name: sar-user ++ remove: yes ++ state: absent ++ ++ - import_role: ++ name: selinux ++ vars: ++ selinux_all_purge: true diff --git a/SOURCES/storage-common-fixes.diff b/SOURCES/storage-common-fixes.diff new file mode 100644 index 0000000..3b6a642 --- /dev/null +++ b/SOURCES/storage-common-fixes.diff @@ -0,0 +1,53 @@ +diff --git a/defaults/main.yml b/defaults/main.yml +index 476616b..743bbbb 100644 +--- a/defaults/main.yml ++++ b/defaults/main.yml +@@ -8,6 +8,7 @@ storage_safe_mode: true # fail instead of implicitly/automatically removing dev + storage_pool_defaults: + state: "present" + type: lvm ++ volumes: [] + + storage_volume_defaults: + state: "present" +diff --git a/library/blivet.py b/library/blivet.py +index 858ca2f..d288f8e 100644 +--- a/library/blivet.py ++++ b/library/blivet.py +@@ -167,7 +167,7 @@ class BlivetVolume(object): + fmt = get_format(self._volume['fs_type'], + mountpoint=self._volume.get('mount_point'), + label=self._volume['fs_label'], +- options=self._volume['fs_create_options']) ++ create_options=self._volume['fs_create_options']) + if not fmt.supported or not fmt.formattable: + raise BlivetAnsibleError("required tools for file system '%s' are missing" % self._volume['fs_type']) + +@@ -209,6 +209,8 @@ class BlivetVolume(object): + raise BlivetAnsibleError("volume '%s' cannot be resized from %s to %s: %s" % (self._device.name, + self._device.size, + size, str(e))) ++ elif size and self._device.size != size and not self._device.resizable: ++ raise BlivetAnsibleError("volume '%s' cannot be resized from %s to %s" % (self._device.name, self._device.size, size)) + + def _reformat(self): + """ Schedule actions as needed to ensure the volume is formatted as specified. """ +@@ -224,6 +226,8 @@ class BlivetVolume(object): + + if self._device.format.status and not packages_only: + self._device.format.teardown() ++ if not self._device.isleaf: ++ self._blivet.devicetree.recursive_remove(self._device, remove_device=False) + self._blivet.format_device(self._device, fmt) + + def manage(self): +@@ -247,6 +251,9 @@ class BlivetVolume(object): + if self._device.exists: + self._reformat() + ++ if self.ultimately_present and self._volume['mount_point'] and not self._device.format.mountable: ++ raise BlivetAnsibleError("volume '%s' has a mount point but no mountable file system" % self._volume['name']) ++ + # schedule resize if appropriate + if self._device.exists and self._volume['size']: + self._resize() diff --git a/SOURCES/timesync-tier1-tags.diff b/SOURCES/timesync-tier1-tags.diff new file mode 100644 index 0000000..4d7c80c --- /dev/null +++ b/SOURCES/timesync-tier1-tags.diff @@ -0,0 +1,404 @@ +diff --git a/tests/get_services_state.yml b/tests/get_services_state.yml +new file mode 100644 +index 0000000..4fe5d36 +--- /dev/null ++++ b/tests/get_services_state.yml +@@ -0,0 +1,4 @@ ++- name: Get initial state of services ++ tags: tests::cleanup ++ service_facts: ++ register: initial_state +diff --git a/tests/restore_services_state.yml b/tests/restore_services_state.yml +new file mode 100644 +index 0000000..3d48975 +--- /dev/null ++++ b/tests/restore_services_state.yml +@@ -0,0 +1,19 @@ ++- name: Get final state of services ++ tags: tests::cleanup ++ service_facts: ++ register: final_state ++ ++- name: Restore state of services ++ tags: tests::cleanup ++ service: ++ name: "{{ item }}" ++ 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 ++ with_items: ++ - chronyd ++ - ntpd ++ - ptp4l ++ - phc2sys ++ - timemaster +diff --git a/tests/tests_default.yml b/tests/tests_default.yml +index 856ebe5..fb298c9 100644 +--- a/tests/tests_default.yml ++++ b/tests/tests_default.yml +@@ -1,6 +1,17 @@ + + - name: Ensure that the role runs with default parameters ++ tags: tests::tier1 + hosts: all + + roles: + - linux-system-roles.timesync ++ ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml ++ ++ post_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: restore_services_state.yml +diff --git a/tests/tests_default_vars.yml b/tests/tests_default_vars.yml +index 366a9f5..df989a5 100644 +--- a/tests/tests_default_vars.yml ++++ b/tests/tests_default_vars.yml +@@ -1,5 +1,6 @@ + --- + - name: Ensure that the role declares all parameters in defaults ++ tags: tests::tier1 + hosts: all + + tasks: +diff --git a/tests/tests_default_wrapper.yml b/tests/tests_default_wrapper.yml +index a768f4c..b0c0ab3 100644 +--- a/tests/tests_default_wrapper.yml ++++ b/tests/tests_default_wrapper.yml +@@ -1,5 +1,8 @@ + --- + - name: Create static inventory from hostvars ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + hosts: all + tasks: + - name: create temporary file +@@ -17,9 +20,15 @@ + + + - name: Run tests_default.yml normally ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + import_playbook: tests_default.yml + + - name: Run tests_default.yml in check_mode ++ tags: ++ - 'tests::tier1' ++ - 'tests::slow' + hosts: all + 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 +--- a/tests/tests_ntp.yml ++++ b/tests/tests_ntp.yml +@@ -1,5 +1,6 @@ + + - name: Configure time synchronization with NTP servers ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -18,6 +19,11 @@ + roles: + - linux-system-roles.timesync + ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ 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" ++ ++ 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 +--- a/tests/tests_ntp_provider1.yml ++++ b/tests/tests_ntp_provider1.yml +@@ -1,5 +1,6 @@ + + - name: Configure NTP with default provider ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -8,6 +9,10 @@ + - linux-system-roles.timesync + + pre_tasks: ++ - name: Import tasks ++ 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" ++ ++ - 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 +--- a/tests/tests_ntp_provider2.yml ++++ b/tests/tests_ntp_provider2.yml +@@ -1,5 +1,6 @@ + + - name: Configure NTP with chrony as current provider ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -8,6 +9,10 @@ + - linux-system-roles.timesync + + pre_tasks: ++ - name: Import tasks ++ 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 ++ ++ - 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 +--- a/tests/tests_ntp_provider3.yml ++++ b/tests/tests_ntp_provider3.yml +@@ -1,5 +1,6 @@ + + - name: Configure NTP with ntp as current provider ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -8,6 +9,10 @@ + - linux-system-roles.timesync + + pre_tasks: ++ - name: Import tasks ++ 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' ++ ++ - 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 +--- a/tests/tests_ntp_provider4.yml ++++ b/tests/tests_ntp_provider4.yml +@@ -1,5 +1,6 @@ + + - name: Configure NTP with chrony as specified provider ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -9,6 +10,10 @@ + - linux-system-roles.timesync + + pre_tasks: ++ - name: Import tasks ++ 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 ++ ++ - 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 +--- a/tests/tests_ntp_provider5.yml ++++ b/tests/tests_ntp_provider5.yml +@@ -1,5 +1,6 @@ + + - name: Configure NTP with ntp as specified provider ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -9,6 +10,10 @@ + - linux-system-roles.timesync + + pre_tasks: ++ - name: Import tasks ++ 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' ++ ++ - 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 +--- a/tests/tests_ntp_provider6.yml ++++ b/tests/tests_ntp_provider6.yml +@@ -1,11 +1,16 @@ + + - name: Configure NTP with OS release non-default provider and then change it to the default provider ++ tags: tests::tier1 + hosts: all + vars: + is_ntp_default: "ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_version is version('7.0', '<')" + both_avail: true + + tasks: ++ - 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 ++ ++ - 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 +--- a/tests/tests_ntp_ptp.yml ++++ b/tests/tests_ntp_ptp.yml +@@ -1,5 +1,6 @@ + + - name: Configure time synchronization with NTP servers and PTP domains ++ tags: tests::tier1 + hosts: all + vars: + timesync_ntp_servers: +@@ -22,6 +23,11 @@ + roles: + - linux-system-roles.timesync + ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml ++ + tasks: + - meta: flush_handlers + +@@ -48,3 +54,8 @@ + - "'PTP1' in sources.stdout" + + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" ++ ++ 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 +--- a/tests/tests_ptp_multi.yml ++++ b/tests/tests_ptp_multi.yml +@@ -1,5 +1,6 @@ + + - name: Configure time synchronization with multiple PTP domains ++ tags: [ 'tests::tier1', 'tests::expfail' ] + hosts: all + vars: + timesync_ptp_domains: +@@ -16,6 +17,11 @@ + roles: + - linux-system-roles.timesync + ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml ++ + tasks: + - meta: flush_handlers + +@@ -58,3 +64,8 @@ + - "'domainNumber 1' in pmc.stdout" + + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" ++ ++ 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 +--- a/tests/tests_ptp_single.yml ++++ b/tests/tests_ptp_single.yml +@@ -1,5 +1,6 @@ + + - name: Configure time synchronization with single PTP domain ++ tags: [ 'tests::tier1', 'tests::expfail' ] + hosts: all + vars: + timesync_ptp_domains: +@@ -8,6 +9,11 @@ + roles: + - linux-system-roles.timesync + ++ pre_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: get_services_state.yml ++ + tasks: + - meta: flush_handlers + +@@ -31,3 +37,8 @@ + - "'domainNumber 3' in pmc.stdout" + + when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout" ++ ++ post_tasks: ++ - name: Import tasks ++ tags: tests::tier1::cleanup ++ import_tasks: restore_services_state.yml diff --git a/SPECS/rhel-system-roles.spec b/SPECS/rhel-system-roles.spec index 577bd78..511811b 100644 --- a/SPECS/rhel-system-roles.spec +++ b/SPECS/rhel-system-roles.spec @@ -5,7 +5,7 @@ Name: linux-system-roles %endif Summary: Set of interfaces for unified system management Version: 1.0 -Release: 8%{?dist} +Release: 12%{?dist} #Group: Development/Libraries License: GPLv3+ and MIT and BSD @@ -13,6 +13,7 @@ License: GPLv3+ and MIT and BSD %global rolealtprefix linux-system-roles. %endif %global roleprefix %{name}. +%global _python_bytecompile_errors_terminate_build 0 # 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. @@ -38,33 +39,52 @@ License: GPLv3+ and MIT and BSD %global rolename2 selinux #%%deftag 2 1.0.0 -%defcommit 3 85b90feedee2a5b3148fd3f72b229b44ec597682 +#%%defcommit 3 924650d0cd4117f73a7f0413ab745a8632bc5cec %global rolename3 timesync -#%%deftag 3 1.0.0 +%deftag 3 1.0.2 -%defcommit 5 8ec01967813a3db0dc446c63cde7ba26c5ab53db +%defcommit 5 3fc15de068f0ba3586f899f2592476aec9f5dc18 %global rolename5 network -#%%deftag 5 1.0.0 +#%%deftag 5 1.1.0 + +%global rolename6 storage +%deftag 6 1.1.0 Source: https://github.com/linux-system-roles/%{rolename0}/archive/%{id0}.tar.gz#/%{rolename0}-%{shortid0}.tar.gz Source1: https://github.com/linux-system-roles/%{rolename1}/archive/%{id1}.tar.gz#/%{rolename1}-%{shortid1}.tar.gz Source2: https://github.com/linux-system-roles/%{rolename2}/archive/%{id2}.tar.gz#/%{rolename2}-%{shortid2}.tar.gz Source3: https://github.com/linux-system-roles/%{rolename3}/archive/%{id3}.tar.gz#/%{rolename3}-%{shortid3}.tar.gz Source5: https://github.com/linux-system-roles/%{rolename5}/archive/%{id5}.tar.gz#/%{rolename5}-%{shortid5}.tar.gz +Source6: https://github.com/linux-system-roles/%{rolename6}/archive/%{id6}.tar.gz#/%{rolename6}-%{shortid6}.tar.gz %if "%{roleprefix}" != "linux-system-roles." Patch1: rhel-system-roles-%{rolename1}-prefix.diff Patch2: rhel-system-roles-%{rolename2}-prefix.diff Patch3: rhel-system-roles-%{rolename3}-prefix.diff Patch5: rhel-system-roles-%{rolename5}-prefix.diff +Patch6: rhel-system-roles-%{rolename6}-prefix.diff %endif Patch11: rhel-system-roles-postfix-pr5.diff Patch101: rhel-system-roles-kdump-pr22.diff +Patch102: kdump-tier1-tags.diff + +Patch21: selinux-tier1-tags.diff + +Patch31: timesync-tier1-tags.diff + +Patch53: network-tier1-tags.diff +Patch54: network-nm-reload-profile.diff + +# PR#64 +Patch62: storage-common-fixes.diff + Url: https://github.com/linux-system-roles/ BuildArch: noarch +Requires: python2-jmespath + Obsoletes: rhel-system-roles-techpreview < 1.0-3 # We need to put %%description within the if block to avoid empty @@ -82,9 +102,10 @@ of Fedora, Red Hat Enterprise Linux & CentOS. %endif %prep -%setup -qc -a1 -a2 -a3 -a5 +%setup -qc -a1 -a2 -a3 -a5 -a6 cd %{rolename0}-%{id0} %patch101 -p1 +%patch102 -p1 cd .. cd %{rolename1}-%{id1} %if "%{roleprefix}" != "linux-system-roles." @@ -96,16 +117,26 @@ cd %{rolename2}-%{id2} %if "%{roleprefix}" != "linux-system-roles." %patch2 -p1 %endif +%patch21 -p1 cd .. cd %{rolename3}-%{id3} %if "%{roleprefix}" != "linux-system-roles." %patch3 -p1 %endif +%patch31 -p1 cd .. cd %{rolename5}-%{id5} %if "%{roleprefix}" != "linux-system-roles." %patch5 -p1 %endif +%patch53 -p1 +%patch54 -p1 +cd .. +cd %{rolename6}-%{id6} +%if "%{roleprefix}" != "linux-system-roles." +%patch6 -p1 +%endif +%patch62 -p1 cd .. %build @@ -118,6 +149,7 @@ cp -pR %{rolename1}-%{id1} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolep cp -pR %{rolename2}-%{id2} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename2} cp -pR %{rolename3}-%{id3} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename3} cp -pR %{rolename5}-%{id5} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename5} +cp -pR %{rolename6}-%{id6} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}%{rolename6} %if 0%{?rolealtprefix:1} ln -s %{roleprefix}%{rolename0} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename0} @@ -125,6 +157,7 @@ ln -s %{roleprefix}%{rolename1} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{ 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}%{rolename5} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename5} +ln -s %{roleprefix}%{rolename6} $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{rolealtprefix}%{rolename6} %endif mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/kdump @@ -132,6 +165,7 @@ 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 cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/README.md \ $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}kdump/COPYING \ @@ -158,26 +192,39 @@ mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}timesync/examples/singl cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/README.md \ $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/LICENSE \ $RPM_BUILD_ROOT%{_pkgdocdir}/network -mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ - $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 \ - $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 \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth-with-vlan-playbook.yml +mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ + $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 \ + $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 \ + $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_with_vlan-playbook.yml mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-macvlan-playbook.yml -cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ - $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-down-profile-playbook.yml -rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples/down-profile.yml +cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ + $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 \ $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-inventory +mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ + $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-ethtool_features_default-playbook.yml +mv $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}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 \ + $RPM_BUILD_ROOT%{_pkgdocdir}/network/example-eth_with_802_1x-playbook.yml + +cp -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}storage/README.md \ + $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}storage/LICENSE \ + $RPM_BUILD_ROOT%{_pkgdocdir}/storage + rm $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}*/semaphore rm -r $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}*/molecule @@ -198,12 +245,14 @@ rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples %{_datadir}/ansible/roles/%{rolealtprefix}selinux %{_datadir}/ansible/roles/%{rolealtprefix}timesync %{_datadir}/ansible/roles/%{rolealtprefix}network +%{_datadir}/ansible/roles/%{rolealtprefix}storage %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 %doc %{_pkgdocdir}/*/example-*-playbook.yml %doc %{_pkgdocdir}/network/example-inventory %doc %{_pkgdocdir}/*/README.md @@ -221,8 +270,27 @@ rmdir $RPM_BUILD_ROOT%{_datadir}/ansible/roles/%{roleprefix}network/examples %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 %changelog +* Tue Jun 9 2020 Pavel Cahyna - 1.0-12 +- Rebase the network role + Resolves rhbz#1767177, rhbz#1842605, rhbz#1789813, rhbz#1724280 +- Tag tests suitable for Tier1 testing, rhbz#1732085 + In network role, do not use the tier1 tags, won't be needed. +- Fix or workaround test problems in network role, + rhbz#1842614, rhbz#1842619, rhbz#1842621 +- Set _python_bytecompile_errors_terminate_build to 0, otherwise + brp-python-bytecompile chokes on network/tests/ensure_provider_tests.py + +* Wed Jan 15 2020 Pavel Cahyna - 1.0-10 +- Update tests for the network role +- Fix typo in a test for the timesync role +- Rebase the network role to add support for device features (PR#115, + rhbz#1696703) and atomic changes (PR#119, rhbz#1695161) +- Add the storage role +- Depend on python-jmespath as Ansible>2.8 will not ship it, rhbz#1774096 + * Mon Jun 3 2019 Pavel Cahyna - 1.0-8 - Rebase the selinux role, fixes typo in tests, uncovered by Ansible 2.7, (rhbz#1651285) and lists all input variables of the selinux role in defaults