Merge "Add undercloud_enable_selinux"

This commit is contained in:
Zuul
2018-07-02 23:55:58 +00:00
committed by Gerrit Code Review
4 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
features:
- Add `undercloud_enable_selinux` configuration to the undercloud.conf.
This option is a boolean option to enable or disable SELinux during the
undercloud installation.

View File

@@ -250,6 +250,10 @@ class UndercloudConfig(StandaloneConfig):
'Whether to enable the debug log level for '
'Undercloud OpenStack services.')
),
cfg.BoolOpt('undercloud_enable_selinux',
default=True,
help=_('Enable or disable SELinux during the '
'deployment.')),
cfg.BoolOpt('undercloud_update_packages',
default=False,
help=_(

View File

@@ -61,6 +61,7 @@ class TestUndercloudConfig(base.TestCase):
'templates',
'undercloud_admin_host',
'undercloud_debug',
'undercloud_enable_selinux',
'undercloud_hostname',
'undercloud_log_file',
'undercloud_nameservers',
@@ -119,6 +120,7 @@ class TestUndercloudConfig(base.TestCase):
'templates',
'undercloud_admin_host',
'undercloud_debug',
'undercloud_enable_selinux',
'undercloud_hostname',
'undercloud_log_file',
'undercloud_nameservers',

View File

@@ -285,6 +285,11 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
# Parse the undercloud.conf options to include necessary args and
# yaml files for undercloud deploy command
if CONF.get('undercloud_enable_selinux'):
env_data['SELinuxMode'] = 'enforcing'
else:
env_data['SELinuxMode'] = 'permissive'
if CONF.get('undercloud_ntp_servers', None):
env_data['NtpServer'] = CONF['undercloud_ntp_servers'][0]