From be3d5383c7b837bf37b26ececbe6e28c2ca2bdef Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 9 Jan 2024 11:24:05 +0100 Subject: [PATCH] Ensure the selinux topscope fact is present --- facts/3.0/ubuntu-15.10-i386.facts | 1 + facts/3.0/ubuntu-15.10-x86_64.facts | 1 + facts/3.10/ubuntu-18.04-aarch64.facts | 1 + facts/3.6/pcs-6-x86_64.facts | 1 + facts/4.0/centos-7-x86_64.facts | 1 + facts/4.0/debian-10-x86_64.facts | 1 + facts/4.0/oraclelinux-7-x86_64.facts | 1 + facts/4.0/redhat-7-x86_64.facts | 1 + facts/4.0/scientific-7-x86_64.facts | 1 + facts/4.2/amazon-2022-x86_64.facts | 1 + facts/4.2/centos-9-x86_64.facts | 1 + facts/4.2/oraclelinux-9-x86_64.facts | 1 + facts/4.2/popos-21.10-x86_64.facts | 1 + spec/facts_spec.rb | 7 +++++++ 14 files changed, 20 insertions(+) diff --git a/facts/3.0/ubuntu-15.10-i386.facts b/facts/3.0/ubuntu-15.10-i386.facts index 4f56f023..09b9238f 100644 --- a/facts/3.0/ubuntu-15.10-i386.facts +++ b/facts/3.0/ubuntu-15.10-i386.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "hostname": "foo", "domain": "example.com", diff --git a/facts/3.0/ubuntu-15.10-x86_64.facts b/facts/3.0/ubuntu-15.10-x86_64.facts index 2eb4d3fe..a009313b 100644 --- a/facts/3.0/ubuntu-15.10-x86_64.facts +++ b/facts/3.0/ubuntu-15.10-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "hostname": "foo", "domain": "example.com", diff --git a/facts/3.10/ubuntu-18.04-aarch64.facts b/facts/3.10/ubuntu-18.04-aarch64.facts index 93829b2f..b32ba253 100644 --- a/facts/3.10/ubuntu-18.04-aarch64.facts +++ b/facts/3.10/ubuntu-18.04-aarch64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "fqdn": "foo.example.com", "domain": "example.com", diff --git a/facts/3.6/pcs-6-x86_64.facts b/facts/3.6/pcs-6-x86_64.facts index 0effab23..e13813ab 100644 --- a/facts/3.6/pcs-6-x86_64.facts +++ b/facts/3.6/pcs-6-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "fqdn": "foo.example.com", "domain": "example.com", diff --git a/facts/4.0/centos-7-x86_64.facts b/facts/4.0/centos-7-x86_64.facts index 240bf116..906c3a45 100644 --- a/facts/4.0/centos-7-x86_64.facts +++ b/facts/4.0/centos-7-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "operatingsystem": "CentOS", "osfamily": "RedHat", diff --git a/facts/4.0/debian-10-x86_64.facts b/facts/4.0/debian-10-x86_64.facts index 593eef42..3659a0a7 100644 --- a/facts/4.0/debian-10-x86_64.facts +++ b/facts/4.0/debian-10-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "operatingsystem": "Debian", "osfamily": "Debian", diff --git a/facts/4.0/oraclelinux-7-x86_64.facts b/facts/4.0/oraclelinux-7-x86_64.facts index 57d8d9ea..3e90436b 100644 --- a/facts/4.0/oraclelinux-7-x86_64.facts +++ b/facts/4.0/oraclelinux-7-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "operatingsystem": "OracleLinux", "osfamily": "RedHat", diff --git a/facts/4.0/redhat-7-x86_64.facts b/facts/4.0/redhat-7-x86_64.facts index 0b1fcf64..7f82043b 100644 --- a/facts/4.0/redhat-7-x86_64.facts +++ b/facts/4.0/redhat-7-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "operatingsystem": "RedHat", "osfamily": "RedHat", diff --git a/facts/4.0/scientific-7-x86_64.facts b/facts/4.0/scientific-7-x86_64.facts index 237acac3..d85ad788 100644 --- a/facts/4.0/scientific-7-x86_64.facts +++ b/facts/4.0/scientific-7-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "ipaddress": "192.168.0.1", "operatingsystem": "Scientific", "osfamily": "RedHat", diff --git a/facts/4.2/amazon-2022-x86_64.facts b/facts/4.2/amazon-2022-x86_64.facts index c84902dd..588e9ba8 100644 --- a/facts/4.2/amazon-2022-x86_64.facts +++ b/facts/4.2/amazon-2022-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "hostname": "foo", "operatingsystem": "Amazon", "osfamily": "RedHat", diff --git a/facts/4.2/centos-9-x86_64.facts b/facts/4.2/centos-9-x86_64.facts index 5093e667..e54ed0a9 100644 --- a/facts/4.2/centos-9-x86_64.facts +++ b/facts/4.2/centos-9-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "domain": "example.com", "fqdn": "foo.example.com", "hostname": "foo", diff --git a/facts/4.2/oraclelinux-9-x86_64.facts b/facts/4.2/oraclelinux-9-x86_64.facts index 4a5b6b1c..d6836b95 100644 --- a/facts/4.2/oraclelinux-9-x86_64.facts +++ b/facts/4.2/oraclelinux-9-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "domain": "example.com", "fqdn": "foo.example.com", "hostname": "foo", diff --git a/facts/4.2/popos-21.10-x86_64.facts b/facts/4.2/popos-21.10-x86_64.facts index 50ea5b92..20c8f984 100644 --- a/facts/4.2/popos-21.10-x86_64.facts +++ b/facts/4.2/popos-21.10-x86_64.facts @@ -1,4 +1,5 @@ { + "selinux": false, "aio_agent_version": "7.12.1", "augeas": { "version": "1.12.0" diff --git a/spec/facts_spec.rb b/spec/facts_spec.rb index d32fb753..2b2d401a 100644 --- a/spec/facts_spec.rb +++ b/spec/facts_spec.rb @@ -122,6 +122,13 @@ it 'contains the legacy operatingsystem fact' do expect(content['operatingsystem']).not_to be_nil end + + # the fact got introduced in 1.5.5 and is confined to kernel=linux + # https://github.com/puppetlabs/facter/blob/1.6.0/lib/facter/selinux.rb + # f94abfccfd6687a88f62703e4005c28ec04467a1 from facter + it 'contains the legacy selinux fact' do + expect(content['selinux']).not_to be_nil if content['kernel'] == 'Linux' + end end end end