From 4698a1da8c6472fb61f8fecb19795e74a476e80e Mon Sep 17 00:00:00 2001
From: Fabien COMBERNOUS <fabien.combernous@adullact.org>
Date: Mon, 13 May 2019 23:40:17 +0200
Subject: [PATCH] remove CentOS7 from compatible OSes

---
 .gitlab-ci.yml                 | 30 ------------------------------
 .sync.yml                      | 28 ----------------------------
 README.md                      |  6 ++++--
 manifests/params.pp            |  2 ++
 metadata.json                  |  6 ------
 spec/spec_helper_acceptance.rb | 12 +++---------
 6 files changed, 9 insertions(+), 75 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f1fcb41..e18ae32 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -78,21 +78,6 @@ acceptance with Puppet5 Debian9:
   tags:
     - puppet-tests
 
-acceptance with Puppet5 CentOS7:
-  stage: 'acceptance'
-  variables:
-    RBENV_VERSION: '2.5.1'
-    PUPPET_INSTALL_TYPE: 'agent'
-    BEAKER_IS_PE: 'no'
-    BEAKER_PUPPET_COLLECTION: 'puppet5'
-    BEAKER_debug: 'true'
-    BEAKER_setfile: 'centos7-64'
-    BEAKER_HYPERVISOR: 'docker'
-  script:
-    - bundle exec rake beaker
-  tags:
-    - puppet-tests
-
 acceptance with Puppet6 Ubuntu1604:
   stage: 'acceptance'
   variables:
@@ -138,21 +123,6 @@ acceptance with Puppet6 Debian9:
   tags:
     - puppet-tests
 
-acceptance with Puppet6 CentOS7:
-  stage: 'acceptance'
-  variables:
-    RBENV_VERSION: '2.5.1'
-    PUPPET_INSTALL_TYPE: 'agent'
-    BEAKER_IS_PE: 'no'
-    BEAKER_PUPPET_COLLECTION: 'puppet6'
-    BEAKER_debug: 'true'
-    BEAKER_setfile: 'centos7-64'
-    BEAKER_HYPERVISOR: 'docker'
-  script:
-    - bundle exec rake beaker
-  tags:
-    - puppet-tests
-
 module release:
   stage: 'release'
   variables:
diff --git a/.sync.yml b/.sync.yml
index 0d1e24d..e576e11 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -72,20 +72,6 @@ appveyor.yml:
           - bundle exec rake beaker
         tags:
           - puppet-tests
-      acceptance with Puppet5 CentOS7:
-        stage: acceptance
-        variables:
-          RBENV_VERSION: '2.5.1'
-          PUPPET_INSTALL_TYPE: 'agent'
-          BEAKER_IS_PE: 'no'
-          BEAKER_PUPPET_COLLECTION: 'puppet5'
-          BEAKER_debug: 'true'
-          BEAKER_setfile: 'centos7-64'
-          BEAKER_HYPERVISOR: 'docker'
-        script:
-          - bundle exec rake beaker
-        tags:
-          - puppet-tests
       acceptance with Puppet6 Ubuntu1604:
         stage: acceptance
         variables:
@@ -128,20 +114,6 @@ appveyor.yml:
           - bundle exec rake beaker
         tags:
           - puppet-tests
-      acceptance with Puppet6 CentOS7:
-        stage: acceptance
-        variables:
-          RBENV_VERSION: '2.5.1'
-          PUPPET_INSTALL_TYPE: 'agent'
-          BEAKER_IS_PE: 'no'
-          BEAKER_PUPPET_COLLECTION: 'puppet6'
-          BEAKER_debug: 'true'
-          BEAKER_setfile: 'centos7-64'
-          BEAKER_HYPERVISOR: 'docker'
-        script:
-          - bundle exec rake beaker
-        tags:
-          - puppet-tests
       module release:
         stage: release
         variables:
diff --git a/README.md b/README.md
index 30e4b99..9f5ee72 100644
--- a/README.md
+++ b/README.md
@@ -262,10 +262,12 @@ Known bugs are listed in `CHANGELOG.md` file.
 
 Even if module should work with Puppet4, Puppet 4 is end of life since 2019-01-01.
 So tests with Puppet 4 are removed.
-Acceptance tests are done with last available release 5 and 6.
+Acceptance tests are done with last available release of Puppet 5 and Puppet 6 (AIO).
 
 PHP shiped with CentOS 7 is version 5.4. WordPress 5.2 requires at least 5.6.20.
-So, CentOS7 is removed from acceptance tests and from the list of compatible OSes.
+Default values for CentOS7 are not removed from the code.
+By this way we expect the module should works if php version requirement is respected.
+But, CentOS7 is removed from acceptance tests and from the list of compatible OSes.
 
 ## Development
 
diff --git a/manifests/params.pp b/manifests/params.pp
index a5e85d0..74bb71f 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -12,6 +12,8 @@ class wordpress::params {
       $default_owner = 'www-data'
     }
     'RedHat': {
+      # even with CentOS unsupported, this is not removed.
+      # If a CentOS7 user installs expected php version this module should work.
       $default_owner = 'apache'
     }
     default: {
diff --git a/metadata.json b/metadata.json
index bc92f06..81dc05f 100644
--- a/metadata.json
+++ b/metadata.json
@@ -25,12 +25,6 @@
         "9"
       ]
     },
-    {
-      "operatingsystem": "CentOS",
-      "operatingsystemrelease": [
-        "7.0"
-      ]
-    },
     {
       "operatingsystem": "Ubuntu",
       "operatingsystemrelease": [
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index fceec94..85d7c2b 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -28,12 +28,6 @@ RSpec.configure do |c|
         on(host, 'apt-get update', acceptable_exit_codes: [0]).stdout
         on(host, 'apt install php5-cli php5-mysql --yes', acceptable_exit_codes: [0]).stdout
         on(host, 'apt install curl libapache2-mod-php5 apache2-mpm-itk --yes', acceptable_exit_codes: [0]).stdout
-      elsif host[:platform] =~ %r{el-7-x86_64}
-        # apache mpm itk is provided by EPEL
-        # curl is used in tests to access at a wordpress newly installed
-        on(host, 'yum install epel-release -y', acceptable_exit_codes: [0]).stdout
-        on(host, 'yum makecache', acceptable_exit_codes: [0]).stdout
-        on(host, 'yum install curl.x86_64 php-cli.x86_64 php-mysql.x86_64 -y', acceptable_exit_codes: [0]).stdout
       elsif host[:platform] =~ %r{ubuntu-16.04-amd64}
         on(host, 'apt-get update', acceptable_exit_codes: [0]).stdout
         # curl is used in tests to access at a wordpress newly installed
@@ -45,9 +39,9 @@ RSpec.configure do |c|
     include '::mysql::server'
 
     $myfqdn = 'localhost'
-    accounts::user { 'wp' : }
-    accounts::user { 'wp2' : }
-    accounts::user { 'wp3' : }
+    accounts::user { 'wp' :}
+    accounts::user { 'wp2' :}
+    accounts::user { 'wp3' :}
 
     class { 'apache':
       default_vhost => false,
-- 
GitLab