import rhel-system-roles-1.0.0-31.el8

This commit is contained in:
CentOS Sources 2021-03-30 08:15:18 -04:00 committed by Stepan Oksanichenko
parent c47cb838f1
commit 50c46fc881
27 changed files with 1929 additions and 619 deletions

29
.gitignore vendored
View File

@ -1,13 +1,18 @@
SOURCES/certificate-27986c2.tar.gz
SOURCES/kdump-0c2bb28.tar.gz
SOURCES/kernel_settings-f760285.tar.gz
SOURCES/logging-95e2574.tar.gz
SOURCES/metrics-e1ca747.tar.gz
SOURCES/nbde_client-da2db56.tar.gz
SOURCES/nbde_server-8110159.tar.gz
SOURCES/network-e0c7d55.tar.gz
SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz
SOURCES/auto-maintenance-e5ed203b2d7224c0bf0c3fd55452456c8f468cad.tar.gz
SOURCES/certificate-50041ce55348fcce34aba4cbe3ea160c5d890ab3.tar.gz
SOURCES/crypto_policies-76b2d5b0460dba22c5d290c1af96e4fdb3434cb9.tar.gz
SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz
SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz
SOURCES/kernel_settings-e5e5abb35fb695e22ccffa855c98ab882650480e.tar.gz
SOURCES/logging-4b07edf4e84882c9d0fb979092ba5953aac0b4d5.tar.gz
SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz
SOURCES/nbde_client-3af7452e4861ee2363b29b23bf78bf11e06be142.tar.gz
SOURCES/nbde_server-1.0.1.tar.gz
SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz
SOURCES/postfix-0.1.tar.gz
SOURCES/selinux-6cd1ec8.tar.gz
SOURCES/storage-36c4803.tar.gz
SOURCES/timesync-924650d.tar.gz
SOURCES/tlog-2b3ffab.tar.gz
SOURCES/selinux-1.1.1.tar.gz
SOURCES/ssh-effa0a0d993832dee726290f263a2182cf3eacda.tar.gz
SOURCES/storage-485de47b0dc0787aea077ba448ecb954f53e40c4.tar.gz
SOURCES/timesync-924650d0cd4117f73a7f0413ab745a8632bc5cec.tar.gz
SOURCES/tlog-1.1.0.tar.gz

View File

@ -1,13 +1,18 @@
76558f143e91d425a3fafd870d27ca159fe10696 SOURCES/certificate-27986c2.tar.gz
36b200d1c6a8d1cb1ea87e3e9aa8c4f6bbd8155d SOURCES/kdump-0c2bb28.tar.gz
da22df6ef24c73b447638b6d26ff09bab2ead1c8 SOURCES/kernel_settings-f760285.tar.gz
ec33cb64813a896c5dc3673ee22e0b343b60cfbf SOURCES/logging-95e2574.tar.gz
20e613542ae7f17b050ffe6b94e46e76295ed891 SOURCES/metrics-e1ca747.tar.gz
cbc09ce6f6460e828b46a7cfdc2fc32cb5b7b8d7 SOURCES/nbde_client-da2db56.tar.gz
4a6b50b20e61a96e3d6448203a443d1d9b0c7d17 SOURCES/nbde_server-8110159.tar.gz
5a9597aa5142df3564dd3d85c3bebc1bb62f465d SOURCES/network-e0c7d55.tar.gz
77e952b62e634c69e36115845b4f24ee3bfe76b7 SOURCES/ansible-sshd-e1de59b3c54e9d48a010eeca73755df339c7e628.tar.gz
c354a1d24b522a356ef487cf8a3f357ab6213b41 SOURCES/auto-maintenance-e5ed203b2d7224c0bf0c3fd55452456c8f468cad.tar.gz
20590d1e4ed8df7578926b7aab79e8fa1344be73 SOURCES/certificate-50041ce55348fcce34aba4cbe3ea160c5d890ab3.tar.gz
513057251590e81b629a69a4ed704b0976b1bc44 SOURCES/crypto_policies-76b2d5b0460dba22c5d290c1af96e4fdb3434cb9.tar.gz
838ed06d8d092271fff04bd5e7c16db4661e8567 SOURCES/ha_cluster-779bb78559de58bb5a1f25a4b92039c373ef59a4.tar.gz
fa3d5daf6cf1ceeaa87f58c16e11153cf250e2fa SOURCES/kdump-77596fdd976c6160d6152c200a5432c609725a14.tar.gz
c81700b81d7acf48b9eadb1ed7a9bf04b994cdb1 SOURCES/kernel_settings-e5e5abb35fb695e22ccffa855c98ab882650480e.tar.gz
3c94b12780f01bbdb8b77fc3515ccef1200ec1f6 SOURCES/logging-4b07edf4e84882c9d0fb979092ba5953aac0b4d5.tar.gz
821d8ebef2d30a41f0fa65bdc5e550f09b375370 SOURCES/metrics-e81b2650108727f38b1c856699aad26af0f44a46.tar.gz
a59b3d28bf5da0abbb3e2e188b0b65b2a78cd500 SOURCES/nbde_client-3af7452e4861ee2363b29b23bf78bf11e06be142.tar.gz
c55d45d134042b00ece17f2a21bb945c571310b3 SOURCES/nbde_server-1.0.1.tar.gz
c2d1aaca43cbe787ee7b1e41e875a76b8f95831d SOURCES/network-bda206d45c87ee8c1a5284de84f5acf5e629de97.tar.gz
66c82331f4ac9598c506c3999965b4d07dbfe49d SOURCES/postfix-0.1.tar.gz
246383bd6823533ed3a51a0501b75e38ba852908 SOURCES/selinux-6cd1ec8.tar.gz
b1f2825eca9a9e06c48d1ec4841a1bf1e52abf7b SOURCES/storage-36c4803.tar.gz
ffd2a706e4e3007684aa9874c8457ad5c8920050 SOURCES/timesync-924650d.tar.gz
43783aa7130ae254e8d848ab1295556628d0b1ef SOURCES/tlog-2b3ffab.tar.gz
f2ad38bd93487962de511b1f4bc9dc6607a5ab36 SOURCES/selinux-1.1.1.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

15
SOURCES/collection_readme.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -euxo pipefail
readme_md=${1:-"lsr_role2collection/collection_readme.md"}
sed -i -e '/## Currently supported distributions/{:1;/## Dependencies/!{N;b 1};s|.*|## Dependencies|}' \
-e 's/\(Linux System Roles is a set of roles for managing Linux system components.\)/\1\n\nThis collection is available as a Technology Preview./' \
-e 's/Linux/RHEL/g' \
-e 's/Ansible Galaxy/Automation Hub/g' \
-e 's/fedora\(.\)linux_system_roles/redhat\1rhel_system_roles/g' \
-e 's/linux-system-roles/rhel-system-roles/g' \
-e '/## Documentation/{:a;/## Support/!{N;b a};s|.*|## Documentation\nThe official RHEL System Roles documentation can be found in the [Product Documentation section of the Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/administration_and_configuration_tasks_using_system_roles_in_rhel/index).\n\n## Support|}' \
-e 's/ $//' \
$readme_md

View File

@ -0,0 +1,28 @@
commit cafd95d0b03360d12e86170eb10fc1fc3dcade06
Author: Pavel Cahyna <pcahyna@redhat.com>
Date: Thu Jan 14 11:42:48 2021 +0100
Get rid of the extra final newline in string
Use the `-` chomping indicator to indicate that the trailing newline is
not intended as a part of the string.
https://yaml.org/spec/1.1/#chomping/
The trailing newline was causing an actual problem in the test.
Also use the `>` folded style, which is more appropriate here than the
`|` literal style.
diff --git a/tests/tests_ssh.yml b/tests/tests_ssh.yml
index 6d3699c..d3503f7 100644
--- a/tests/tests_ssh.yml
+++ b/tests/tests_ssh.yml
@@ -27,7 +27,7 @@
- include_role:
name: linux-system-roles.kdump
vars:
- kdump_ssh_user: |
+ kdump_ssh_user: >-
{{ hostvars[kdump_ssh_server_outside]['ansible_user_id'] }}
# This is the outside address. Ansible will connect to it to
# copy the ssh key.

View File

@ -0,0 +1,13 @@
diff --git a/meta/main.yml b/meta/main.yml
index 2478fa6..ad8f4c6 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -7,6 +7,6 @@ galaxy_info:
min_ansible_version: 2.4
platforms:
- name: Fedora
- versions: [ 27, 28 ]
+ versions: [ 31, 32 ]
- name: EL
- versions: [ 6, 7 ]
+ versions: [ 6, 7, 8 ]

View File

@ -45,13 +45,13 @@ index 0000000..2035dfc
+ with_items: "{{ restore_services }}"
+ tags: tests::cleanup
diff --git a/tests/tests_default.yml b/tests/tests_default.yml
index 4c93830..9e7743a 100644
index af0b2a0..6ce5241 100644
--- a/tests/tests_default.yml
+++ b/tests/tests_default.yml
@@ -4,3 +4,13 @@
@@ -3,3 +3,13 @@
roles:
- kdump
- linux-system-roles.kdump
+
+ pre_tasks:
+ - name: Import tasks
@ -63,7 +63,7 @@ index 4c93830..9e7743a 100644
+# tags: tests::tier1::cleanup
+ import_tasks: restore_services_state.yml
diff --git a/tests/tests_default_wrapper.yml b/tests/tests_default_wrapper.yml
index 2763fbd..95b3886 100644
index eba31a0..857aab8 100644
--- a/tests/tests_default_wrapper.yml
+++ b/tests/tests_default_wrapper.yml
@@ -1,6 +1,9 @@
@ -92,12 +92,12 @@ index 2763fbd..95b3886 100644
+ - '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
command: >
diff --git a/tests/tests_ssh.yml b/tests/tests_ssh.yml
index 14a59d9..23bc7eb 100644
index d12e884..6d3699c 100644
--- a/tests/tests_ssh.yml
+++ b/tests/tests_ssh.yml
@@ -11,6 +11,13 @@
@@ -10,6 +10,13 @@
# this is the address at which the ssh dump server can be reached
# from the managed host. Dumps will be uploaded there.
kdump_ssh_server_inside: "{{ kdump_ssh_source if kdump_ssh_source in hostvars[kdump_ssh_server_outside]['ansible_all_ipv4_addresses'] + hostvars[kdump_ssh_server_outside]['ansible_all_ipv6_addresses'] else hostvars[kdump_ssh_server_outside]['ansible_default_ipv4']['address'] }}"
@ -112,7 +112,7 @@ index 14a59d9..23bc7eb 100644
tasks:
- name: gather facts from {{ kdump_ssh_server_outside }}
diff --git a/tests/tests_ssh_wrapper.yml b/tests/tests_ssh_wrapper.yml
index 9a8ecfd..1a6db73 100644
index 2203f3f..96a764e 100644
--- a/tests/tests_ssh_wrapper.yml
+++ b/tests/tests_ssh_wrapper.yml
@@ -1,6 +1,8 @@
@ -139,4 +139,4 @@ index 9a8ecfd..1a6db73 100644
+ - 'tests::multihost_localhost'
tasks:
- name: Run ansible-playbook with tests_ssh.yml in check mode
command: ansible-playbook -vvv -i {{ tempinventory.path }} --check tests_ssh.yml
command: |

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -euxo pipefail
for file in "$@"; do
pandoc -f markdown_github "${file}" -t asciidoc -o "${file%.md}.tmp.adoc"
touch -r "${file}" "${file%.md}.tmp.adoc"
TZ=UTC asciidoc -o "${file%.md}.html" -a footer-style=none -a toc2 -a source-highlighter=highlight "${file%.md}.tmp.adoc"
rm "${file%.md}.tmp.adoc"
done

View File

@ -0,0 +1,24 @@
From 7ff86f2fa05998afcd8ae87d9cdd660ef5b6ee2c Mon Sep 17 00:00:00 2001
From: Jan Kurik <jkurik@redhat.com>
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

View File

@ -0,0 +1,48 @@
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
port2_profile: bond0.1
dhcp_interface2: test2
+ tags:
+ - "tests::expfail"
tasks:
- name: "INIT Prepare setup"
debug:
diff --git a/tests/tests_bond_initscripts.yml b/tests/tests_bond_initscripts.yml
index 8fa74c5..6a231c4 100644
--- a/tests/tests_bond_initscripts.yml
+++ b/tests/tests_bond_initscripts.yml
@@ -9,5 +9,6 @@
network_provider: initscripts
tags:
- always
+ - "tests::expfail"
- import_playbook: playbooks/tests_bond.yml

View File

@ -0,0 +1,401 @@
diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml
index 075355b..5fc9dea 100644
--- a/tests/playbooks/integration_pytest_python3.yml
+++ b/tests/playbooks/integration_pytest_python3.yml
@@ -9,6 +9,11 @@
- rsync
tasks:
+ - name: Install EPEL for RHEL and CentOS
+ # yamllint disable-line rule:line-length
+ command: "yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
+ when: ansible_distribution in ["CentOS", "RedHat"]
+
- name: Install rpm dependencies
package:
state: present
diff --git a/tests/tasks/el_repo_setup.yml b/tests/tasks/el_repo_setup.yml
deleted file mode 100644
index 0656e8c..0000000
--- a/tests/tasks/el_repo_setup.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-- name: Fix CentOS6 Base repo
- copy:
- dest: /etc/yum.repos.d/CentOS-Base.repo
- content: |
- [base]
- name=CentOS-$releasever - Base
- baseurl=https://vault.centos.org/6.10/os/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-
- [updates]
- name=CentOS-$releasever - Updates
- baseurl=https://vault.centos.org/6.10/updates/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-
- [extras]
- name=CentOS-$releasever - Extras
- baseurl=https://vault.centos.org/6.10/extras/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- when:
- - ansible_distribution == 'CentOS'
- - ansible_distribution_major_version == '6'
-- include_tasks: enable_epel.yml
diff --git a/tests/tasks/setup_802_1x_server.yml b/tests/tasks/setup_802_1x_server.yml
index 49d1ce1..3bf16a9 100644
--- a/tests/tasks/setup_802_1x_server.yml
+++ b/tests/tasks/setup_802_1x_server.yml
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
+- include_tasks: enable_epel.yml
+
- name: Install hostapd
package:
name: hostapd
diff --git a/tests/tasks/setup_mock_wifi.yml b/tests/tasks/setup_mock_wifi.yml
index 997b704..d7a1e22 100644
--- a/tests/tasks/setup_mock_wifi.yml
+++ b/tests/tasks/setup_mock_wifi.yml
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
+- include_tasks: enable_epel.yml
+
- name: Install packages required to set up mock wifi network
package:
name:
diff --git a/tests/tests_802_1x_nm.yml b/tests/tests_802_1x_nm.yml
index a27d8ea..288cd5d 100644
--- a/tests/tests_802_1x_nm.yml
+++ b/tests/tests_802_1x_nm.yml
@@ -5,7 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_802_1x.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_802_1x_updated_nm.yml b/tests/tests_802_1x_updated_nm.yml
index 5a25f5b..bd335e4 100644
--- a/tests/tests_802_1x_updated_nm.yml
+++ b/tests/tests_802_1x_updated_nm.yml
@@ -5,7 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_802_1x_updated.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- 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
+++ b/tests/tests_bond_initscripts.yml
@@ -4,7 +4,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_bond.yml' with initscripts as provider
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_nm.yml b/tests/tests_bond_nm.yml
index 7075d95..8ac6cbd 100644
--- a/tests/tests_bond_nm.yml
+++ b/tests/tests_bond_nm.yml
@@ -5,7 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_bond.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_bridge_initscripts.yml b/tests/tests_bridge_initscripts.yml
index 8ce42e6..db5663c 100644
--- a/tests/tests_bridge_initscripts.yml
+++ b/tests/tests_bridge_initscripts.yml
@@ -4,7 +4,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_bridge.yml' with initscripts as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_bridge_nm.yml b/tests/tests_bridge_nm.yml
index 3d1b53a..c565952 100644
--- a/tests/tests_bridge_nm.yml
+++ b/tests/tests_bridge_nm.yml
@@ -5,7 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_bridge.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_default.yml b/tests/tests_default.yml
index e196314..f6f7550 100644
--- a/tests/tests_default.yml
+++ b/tests/tests_default.yml
@@ -5,7 +5,6 @@
roles:
- linux-system-roles.network
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Test warning and info logs
assert:
that:
diff --git a/tests/tests_default_initscripts.yml b/tests/tests_default_initscripts.yml
index 006889c..cc8b875 100644
--- a/tests/tests_default_initscripts.yml
+++ b/tests/tests_default_initscripts.yml
@@ -2,7 +2,6 @@
---
- hosts: all
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_default_nm.yml b/tests/tests_default_nm.yml
index 54bc3e1..8138ca9 100644
--- a/tests/tests_default_nm.yml
+++ b/tests/tests_default_nm.yml
@@ -2,7 +2,6 @@
---
- hosts: all
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_ethernet_initscripts.yml b/tests/tests_ethernet_initscripts.yml
index 366b052..62e75fe 100644
--- a/tests/tests_ethernet_initscripts.yml
+++ b/tests/tests_ethernet_initscripts.yml
@@ -4,8 +4,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_ethernet.yml' with initscripts as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_ethernet_nm.yml b/tests/tests_ethernet_nm.yml
index 238172d..ecefa14 100644
--- a/tests/tests_ethernet_nm.yml
+++ b/tests/tests_ethernet_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_ethernet.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_ethtool_features_initscripts.yml b/tests/tests_ethtool_features_initscripts.yml
index 5bac5d3..6aea73b 100644
--- a/tests/tests_ethtool_features_initscripts.yml
+++ b/tests/tests_ethtool_features_initscripts.yml
@@ -2,7 +2,6 @@
# set network provider and gather facts
- hosts: all
tasks:
- - include_tasks: tasks/el_repo_setup.yml
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_ethtool_features_nm.yml b/tests/tests_ethtool_features_nm.yml
index 2027862..30c6faa 100644
--- a/tests/tests_ethtool_features_nm.yml
+++ b/tests/tests_ethtool_features_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_ethtool_features.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_helpers_and_asserts.yml b/tests/tests_helpers_and_asserts.yml
index 64e2875..5514182 100644
--- a/tests/tests_helpers_and_asserts.yml
+++ b/tests/tests_helpers_and_asserts.yml
@@ -3,8 +3,6 @@
- name: Check that creating and removing test devices and assertions work
hosts: all
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: test veth interface management
include_tasks: tasks/create_and_remove_interface.yml
vars:
diff --git a/tests/tests_integration_pytest.yml b/tests/tests_integration_pytest.yml
index 9b80bd4..153214d 100644
--- a/tests/tests_integration_pytest.yml
+++ b/tests/tests_integration_pytest.yml
@@ -1,8 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
-- hosts: all
- tasks:
- - include_tasks: tasks/el_repo_setup.yml
+- name: Empty play to gather facts
+ hosts: all
- import_playbook: playbooks/integration_pytest_python3.yml
when: (ansible_distribution in ["CentOS", "RedHat"] and
diff --git a/tests/tests_provider_nm.yml b/tests/tests_provider_nm.yml
index 67fcffe..99306a1 100644
--- a/tests/tests_provider_nm.yml
+++ b/tests/tests_provider_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_provider.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_reapply_nm.yml b/tests/tests_reapply_nm.yml
index eb48ddb..69fb208 100644
--- a/tests/tests_reapply_nm.yml
+++ b/tests/tests_reapply_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_reapply.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_regression_nm.yml b/tests/tests_regression_nm.yml
index b2c46e9..9eb8084 100644
--- a/tests/tests_regression_nm.yml
+++ b/tests/tests_regression_nm.yml
@@ -3,8 +3,6 @@
# set network provider and gather facts
- hosts: all
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_states_initscripts.yml b/tests/tests_states_initscripts.yml
index fa94103..3e55a43 100644
--- a/tests/tests_states_initscripts.yml
+++ b/tests/tests_states_initscripts.yml
@@ -4,8 +4,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_states.yml' with initscripts as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_states_nm.yml b/tests/tests_states_nm.yml
index 34c8a24..3164a3a 100644
--- a/tests/tests_states_nm.yml
+++ b/tests/tests_states_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_states.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_team_nm.yml b/tests/tests_team_nm.yml
index 8048029..0516765 100644
--- a/tests/tests_team_nm.yml
+++ b/tests/tests_team_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_team.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml
index 44dfaec..8c5388b 100644
--- a/tests/tests_unit.yml
+++ b/tests/tests_unit.yml
@@ -3,7 +3,7 @@
- hosts: all
name: Setup for test running
tasks:
- - include_tasks: tasks/el_repo_setup.yml
+ - include_tasks: tasks/enable_epel.yml
- name: Install dependencies
package:
diff --git a/tests/tests_vlan_mtu_initscripts.yml b/tests/tests_vlan_mtu_initscripts.yml
index dcd5d74..37770a9 100644
--- a/tests/tests_vlan_mtu_initscripts.yml
+++ b/tests/tests_vlan_mtu_initscripts.yml
@@ -4,8 +4,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_vlan_mtu.yml' with initscripts as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'initscripts'
set_fact:
network_provider: initscripts
diff --git a/tests/tests_vlan_mtu_nm.yml b/tests/tests_vlan_mtu_nm.yml
index c38263c..f201de3 100644
--- a/tests/tests_vlan_mtu_nm.yml
+++ b/tests/tests_vlan_mtu_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_vlan_mtu.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm
diff --git a/tests/tests_wireless_nm.yml b/tests/tests_wireless_nm.yml
index 03b5ad6..86baf67 100644
--- a/tests/tests_wireless_nm.yml
+++ b/tests/tests_wireless_nm.yml
@@ -5,8 +5,6 @@
- hosts: all
name: Run playbook 'playbooks/tests_wireless.yml' with nm as provider
tasks:
- - include_tasks: tasks/el_repo_setup.yml
-
- name: Set network provider to 'nm'
set_fact:
network_provider: nm

View File

@ -1,14 +0,0 @@
diff --git a/tests/playbooks/tests_ethtool_features.yml b/tests/playbooks/tests_ethtool_features.yml
index 9b51cab..57c48bd 100644
--- a/tests/playbooks/tests_ethtool_features.yml
+++ b/tests/playbooks/tests_ethtool_features.yml
@@ -186,6 +186,9 @@
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent
+ - name: Reload NetworkManager config
+ command: nmcli connection reload
+ ignore_errors: true
tags:
- "tests::cleanup"

View File

@ -22,6 +22,30 @@ index 9cce1ae..76d99e9 100644
+ hosts: all
+ tasks:
+ - import_tasks: tasks/restore_state.yml
diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml
index 69f07f8..1e45788 100644
--- a/tests/playbooks/tests_bond.yml
+++ b/tests/playbooks/tests_bond.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:
controller_profile: bond0
@@ -95,3 +100,8 @@
- import_tasks: tasks/remove_test_interfaces_with_dhcp.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
@ -172,7 +196,7 @@ index cd02579..adcffee 100644
+ tasks:
+ - import_tasks: tasks/restore_state.yml
diff --git a/tests/playbooks/tests_ethtool_features.yml b/tests/playbooks/tests_ethtool_features.yml
index 76b0f8a..9b51cab 100644
index 43fddc3..d1a87fe 100644
--- a/tests/playbooks/tests_ethtool_features.yml
+++ b/tests/playbooks/tests_ethtool_features.yml
@@ -1,5 +1,10 @@
@ -185,8 +209,8 @@ index 76b0f8a..9b51cab 100644
+
- hosts: all
vars:
interface: lsrfeat1
@@ -183,3 +188,8 @@
interface: testnic1
@@ -198,3 +203,8 @@
state: absent
tags:
- "tests::cleanup"
@ -195,6 +219,30 @@ index 76b0f8a..9b51cab 100644
+ hosts: all
+ tasks:
+ - import_tasks: tasks/restore_state.yml
diff --git a/tests/playbooks/tests_provider.yml b/tests/playbooks/tests_provider.yml
index 1db2d08..e097b4b 100644
--- a/tests/playbooks/tests_provider.yml
+++ b/tests/playbooks/tests_provider.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: testnic1
@@ -33,3 +38,8 @@
- tasks/cleanup_profile+device.yml
tags:
- tests::provider:initscripts_to_nm
+
+- 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
@ -221,10 +269,10 @@ index 4b1cb09..6995607 100644
+ tasks:
+ - import_tasks: tasks/restore_state.yml
diff --git a/tests/playbooks/tests_states.yml b/tests/playbooks/tests_states.yml
index 5926ad0..e936d4e 100644
index eec27c0..a8d0ecd 100644
--- a/tests/playbooks/tests_states.yml
+++ b/tests/playbooks/tests_states.yml
@@ -135,3 +135,18 @@
@@ -135,3 +135,23 @@
- tasks/cleanup_profile+device.yml
tags:
- tests::states:remove_down_twice
@ -234,12 +282,17 @@ index 5926ad0..e936d4e 100644
+ import_tasks: tasks/save_state.yml
+
+ post_tasks:
+ - name: Remove test bridge in case it is still lingering
+ command: 'ip link delete "{{ interface }}"'
+ - name: Remove test profile
+ tags:
+ - 'tests::cleanup'
+ - 'tests::net::bridge::cleanup'
+ ignore_errors: yes
+ import_role:
+ name: linux-system-roles.network
+ vars:
+ network_connections:
+ - name: statebr
+ state: down
+ persistent_state: absent
+
+ - name: Restore host state
+ import_tasks: tasks/restore_state.yml
@ -404,7 +457,7 @@ index 0000000..5690aed
+ register: etc_sysconfig_network_stat
+ ignore_errors: yes
diff --git a/tests/tests_802_1x_nm.yml b/tests/tests_802_1x_nm.yml
index 3bd0719..77cf2d9 100644
index 288cd5d..840958d 100644
--- a/tests/tests_802_1x_nm.yml
+++ b/tests/tests_802_1x_nm.yml
@@ -4,6 +4,8 @@
@ -416,14 +469,14 @@ index 3bd0719..77cf2d9 100644
tasks:
- name: Set network provider to 'nm'
set_fact:
@@ -21,3 +23,5 @@
@@ -17,3 +19,5 @@
- import_playbook: playbooks/tests_802_1x.yml
when:
- ansible_distribution_major_version != '6'
+ tags:
+ - tests::expfail
diff --git a/tests/tests_802_1x_updated_nm.yml b/tests/tests_802_1x_updated_nm.yml
index 0d4c741..ca666a6 100644
index bd335e4..4ebcaf9 100644
--- a/tests/tests_802_1x_updated_nm.yml
+++ b/tests/tests_802_1x_updated_nm.yml
@@ -4,6 +4,8 @@
@ -435,7 +488,7 @@ index 0d4c741..ca666a6 100644
tasks:
- name: Set network provider to 'nm'
set_fact:
@@ -21,3 +23,5 @@
@@ -17,3 +19,5 @@
- import_playbook: playbooks/tests_802_1x_updated.yml
when:
- ansible_distribution_major_version != '6'

View File

@ -0,0 +1,16 @@
diff --git a/meta/main.yml b/meta/main.yml
index a0ef6f4..da22270 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -7,8 +7,8 @@ galaxy_info:
min_ansible_version: 2.2
platforms:
- name: Fedora
- versions: [ 24, 25 ]
+ versions: [ 31, 32 ]
- name: EL
- versions: [ 6, 7 ]
+ versions: [ 6, 7, 8 ]

View File

@ -44,10 +44,10 @@ index bf24210..504ff34 100644
path {{ kdump_path }}
{% if kdump_core_collector %}
diff --git a/tests/tests_ssh.yml b/tests/tests_ssh.yml
index 679148e..14a59d9 100644
index 1da99df..d12e884 100644
--- a/tests/tests_ssh.yml
+++ b/tests/tests_ssh.yml
@@ -6,6 +6,11 @@
@@ -5,6 +5,11 @@
# known and ansible is supposed to be configured to be able to
# connect to it (via inventory).
kdump_ssh_server_outside: localhost

View File

@ -1,148 +0,0 @@
diff --git a/examples/bond_simple.yml b/examples/bond_simple.yml
index 4ca9811..f6f5897 100644
--- a/examples/bond_simple.yml
+++ b/examples/bond_simple.yml
@@ -32,5 +32,5 @@
interface_name: eth2
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
@@ -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
index 037ff8e..83c586d 100644
--- 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
index 0ba168a..e4c4a54 100644
--- 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_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 c580f89..0881316 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
index 22603d9..9e7e267 100644
--- a/examples/infiniband.yml
+++ b/examples/infiniband.yml
@@ -23,4 +23,4 @@
- 198.51.100.133/30
roles:
- - 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 @@
- 192.168.1.1/24
roles:
- - linux-system-roles.network
+ - rhel-system-roles.network
diff --git a/examples/remove+down_profile.yml b/examples/remove+down_profile.yml
index da2b1b8..f2d93e8 100644
--- a/examples/remove+down_profile.yml
+++ b/examples/remove+down_profile.yml
@@ -8,5 +8,5 @@
persistent_state: absent
state: down
roles:
- - linux-system-roles.network
+ - rhel-system-roles.network
...
diff --git a/examples/wireless_wpa_psk.yml b/examples/wireless_wpa_psk.yml
index eeec22f..60b0d83 100644
--- a/examples/wireless_wpa_psk.yml
+++ b/examples/wireless_wpa_psk.yml
@@ -12,4 +12,4 @@
# see https://docs.ansible.com/ansible/latest/user_guide/vault.html
password: "p@55w0rD"
roles:
- - linux-system-roles.network
+ - rhel-system-roles.network
diff --git a/tests/playbooks/down_profile.yml b/tests/playbooks/down_profile.yml
index 5087240..65e542d 100644
--- a/tests/playbooks/down_profile.yml
+++ b/tests/playbooks/down_profile.yml
@@ -7,4 +7,4 @@
- name: "{{ profile }}"
state: down
roles:
- - linux-system-roles.network
+ - rhel-system-roles.network
diff --git a/tests/playbooks/remove_profile.yml b/tests/playbooks/remove_profile.yml
index a50e848..b6e6796 100644
--- a/tests/playbooks/remove_profile.yml
+++ b/tests/playbooks/remove_profile.yml
@@ -7,4 +7,4 @@
- name: "{{ profile }}"
persistent_state: absent
roles:
- - linux-system-roles.network
+ - rhel-system-roles.network

View File

@ -1,40 +0,0 @@
diff --git a/README.md b/README.md
index 5950215..a59d72f 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Install and enable postfix. Configure "relay_domains=$mydestination" and
relay_domains: "$mydestination"
relay_host: "example.com"
roles:
- - postfix
+ - linux-system-roles.postfix
```
Install and enable postfix. Do not run 'postfix check' before restarting
@@ -37,7 +37,7 @@ postfix:
vars:
postfix_check: false
roles:
- - postfix
+ - linux-system-roles.postfix
```
Install and enable postfix. Do single backup of main.cf (older backup will be
@@ -51,7 +51,7 @@ rewritten) and configure "relay_host=example.com":
relay_host: "example.com"
postfix_backup: true
roles:
- - postfix
+ - linux-system-roles.postfix
```
Install and enable postfix. Do timestamped backup of main.cf and
@@ -66,7 +66,7 @@ set to true postfix_backup is ignored):
relay_host: "example.com"
postfix_backup_multiple: true
roles:
- - postfix
+ - linux-system-roles.postfix
```

View File

@ -1,32 +0,0 @@
diff --git a/README.md b/README.md
index a0385b0..6efc62d 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ This role can be configured using variab
vars:
[ see below ]
roles:
- - role: linux-system-roles.selinux
+ - role: rhel-system-roles.selinux
become: true
```
diff --git a/selinux-playbook.yml b/selinux-playbook.yml
index 78d3953..b2348d5 100644
--- a/selinux-playbook.yml
+++ b/selinux-playbook.yml
@@ -31,7 +31,7 @@
- name: execute the role and catch errors
block:
- include_role:
- name: linux-system-roles.selinux
+ name: rhel-system-roles.selinux
rescue:
# Fail if failed for a different reason than selinux_reboot_required.
- name: handle errors
@@ -52,4 +52,4 @@
- name: reapply the role
include_role:
- name: linux-system-roles.selinux
+ name: rhel-system-roles.selinux

View File

@ -1,13 +0,0 @@
diff --git a/README.md b/README.md
index c2debc9..d9e40b3 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ Example Playbook
- hosts: all
roles:
- - name: linux-system-roles.storage
+ - name: rhel-system-roles.storage
storage_pools:
- name: app
disks:

View File

@ -1,46 +0,0 @@
diff -up timesync-1.0.0/README.md.orig timesync-1.0.0/README.md
--- timesync-1.0.0/README.md.orig 2018-08-21 11:46:41.000000000 +0200
+++ timesync-1.0.0/README.md 2018-11-06 22:29:14.586770442 +0100
@@ -82,7 +82,7 @@ Install and configure ntp to synchronize
- hostname: baz.example.com
iburst: yes
roles:
- - linux-system-roles.timesync
+ - rhel-system-roles.timesync
```
Install and configure linuxptp to synchronize the system clock with a
@@ -95,7 +95,7 @@ grandmaster in PTP domain number 0, whic
- number: 0
interfaces: [ eth0 ]
roles:
- - linux-system-roles.timesync
+ - rhel-system-roles.timesync
```
Install and configure chrony and linuxptp to synchronize the system clock with
@@ -122,5 +122,5 @@ synchronization:
transport: UDPv4
delay: 0.000010
roles:
- - linux-system-roles.timesync
+ - rhel-system-roles.timesync
```
diff -up timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/multiple-ntp-servers.yml.orig timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/multiple-ntp-servers.yml
--- timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/multiple-ntp-servers.yml.orig 2019-06-03 18:03:18.081868584 +0200
+++ timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/multiple-ntp-servers.yml 2019-06-03 18:03:26.718704991 +0200
@@ -11,4 +11,4 @@
- hostname: 3.pool.ntp.org
iburst: yes
roles:
- - linux-system-roles.timesync
+ - rhel-system-roles.timesync
diff -up timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/single-pool.yml.orig timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/single-pool.yml
--- timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/single-pool.yml.orig 2019-06-03 16:36:40.000000000 +0200
+++ timesync-85b90feedee2a5b3148fd3f72b229b44ec597682/examples/single-pool.yml 2019-06-03 18:03:36.721515519 +0200
@@ -6,4 +6,4 @@
pool: yes
iburst: yes
roles:
- - linux-system-roles.timesync
+ - rhel-system-roles.timesync

View File

@ -0,0 +1,34 @@
From 035a9b2db26af071a95e02a0af08bcbb73b69abf Mon Sep 17 00:00:00 2001
From: Florian Bachmann <fbachmann.public@gmail.com>
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

View File

@ -16,10 +16,18 @@ index f294101..7571066 100644
command: /usr/sbin/semanage boolean -l -n -C
register: selinux_role_boolean
diff --git a/tests/tests_all_purge.yml b/tests/tests_all_purge.yml
index 03dfe05..c686837 100644
index 03dfe05..6775847 100644
--- a/tests/tests_all_purge.yml
+++ b/tests/tests_all_purge.yml
@@ -14,7 +14,9 @@
@@ -8,13 +8,17 @@
fcontext -a -t user_home_dir_t /tmp/test_dir
login -a -s staff_u sar-user
+ tags:
+ - 'tests::avc'
tasks:
- name: Install SELinux tool semanage on Fedora
package:
name:
- policycoreutils-python-utils
state: present
@ -47,8 +55,7 @@ diff --git a/tests/tests_boolean.yml b/tests/tests_boolean.yml
index 47eafc0..2aa0025 100644
--- a/tests/tests_boolean.yml
+++ b/tests/tests_boolean.yml
@@ -1,5 +1,6 @@
@@ -1,4 +1,5 @@
- name: Check if selinux role sets SELinux booleans
+ tags: tests::expfail
hosts: all
@ -80,10 +87,9 @@ diff --git a/tests/tests_login.yml b/tests/tests_login.yml
index efa826d..c7ce462 100644
--- a/tests/tests_login.yml
+++ b/tests/tests_login.yml
@@ -18,7 +18,7 @@
@@ -18,6 +18,6 @@
- { 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
@ -103,10 +109,18 @@ index 446f79d..7bb112e 100644
set_fact:
port_after: "{{ selinux_role_port.stdout }}"
diff --git a/tests/tests_selinux_disabled.yml b/tests/tests_selinux_disabled.yml
index afd23e4..706882f 100644
index afd23e4..883dc6d 100644
--- a/tests/tests_selinux_disabled.yml
+++ b/tests/tests_selinux_disabled.yml
@@ -18,7 +18,9 @@
@@ -12,13 +12,17 @@
fcontext -a -t user_home_dir_t /tmp/test_dir
login -a -s staff_u sar-user
+ tags:
+ - 'tests::avc'
tasks:
- name: Install SELinux tool semanage on Fedora
package:
name:
- policycoreutils-python-utils
state: present
@ -157,6 +171,6 @@ index afd23e4..706882f 100644
+ state: absent
+
+ - import_role:
+ name: selinux
+ name: linux-system-roles.selinux
+ vars:
+ selinux_all_purge: true

43
SOURCES/sshd-example.diff Normal file
View File

@ -0,0 +1,43 @@
diff --git a/README.md b/README.md
index 676ad72..dc06d85 100644
--- a/README.md
+++ b/README.md
@@ -190,7 +190,7 @@ defaults. This is useful if the role is used in deployment stage to make sure
the service is able to start on the first attempt. To disable this check, set
this to empty list.
-* `sshd_hostkey_owner`, `sshd_hostkey_group`, `sshd_hostkey_group`
+* `sshd_hostkey_owner`, `sshd_hostkey_group`, `sshd_hostkey_mode`
Use these variables to set the ownership and permissions for the host keys from
the above list.
@@ -273,6 +273,8 @@ for example:
X11Forwarding: yes
```
+More example playbooks can be found in [`examples/`](examples/) directory.
+
Template Generation
-------------------
diff --git a/examples/example-root-login.yml b/examples/example-root-login.yml
new file mode 100644
index 0000000..156e629
--- /dev/null
+++ b/examples/example-root-login.yml
@@ -0,0 +1,15 @@
+---
+- hosts: all
+ tasks:
+ - name: Configure sshd to prevent root and password login except from particular subnet
+ include_role:
+ name: ansible-sshd
+ vars:
+ sshd:
+ # root login and password login is enabled only from a particular subnet
+ PermitRootLogin: no
+ PasswordAuthentication: no
+ Match:
+ - Condition: "Address 192.0.2.0/24"
+ PermitRootLogin: yes
+ PasswordAuthentication: yes

View File

@ -0,0 +1,25 @@
From bb612fb6c5f76a40fce368acb43d2847e699213d Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
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

View File

@ -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

View File

@ -0,0 +1,30 @@
commit effb7faf20301ddcee8ee36a1b156a0b9f006bb0
Author: David Lehman <dlehman@redhat.com>
Date: Tue Aug 4 16:00:33 2020 -0400
Be smarter in choosing expected partition name.
BlivetVolume._get_device_id is only used to look up pre-existing
volumes, so we don't have to try too hard to guess it by name.
We can just see if the disk has a single partition and, if so,
return the name of that partition.
Fixes: #141
diff --git a/library/blivet.py b/library/blivet.py
index eb8bb11..0f7ce98 100644
--- a/library/blivet.py
+++ b/library/blivet.py
@@ -554,7 +554,11 @@ class BlivetPartitionVolume(BlivetVolume):
return self._device.raw_device.type == 'partition'
def _get_device_id(self):
- return self._blivet_pool._disks[0].name + '1'
+ device_id = None
+ if self._blivet_pool._disks[0].partitioned and len(self._blivet_pool._disks[0].children) == 1:
+ device_id = self._blivet_pool._disks[0].children[0].name
+
+ return device_id
def _resize(self):
pass

View File

@ -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:

File diff suppressed because it is too large Load Diff