Add undercloud_enable_selinux

Expose selinux configuration via the undercloud.conf

Change-Id: I6973fec9bcc55373f89e5c873ff6ae7050fff432
Depends-On: I2109bf62e307df92b6bdb57600c58dd61482f46d
Partial-Bug: #1779005
This commit is contained in:
Alex Schultz 2018-06-28 09:44:15 -06:00
parent e70d027d53
commit 4aa679e960
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

@ -284,6 +284,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]