Commit Graph

310 Commits

Author SHA1 Message Date
Zuul a47980f00e Merge "Require valid type for available_themses" 2024-04-17 09:18:00 +00:00
Zuul 94fa2b3ec6 Merge "Restart httpd after config change" 2024-01-12 17:53:04 +00:00
Takashi Kajinami 5a3245f9d4 Require valid type for available_themses
Currently, if a users gives invalid input type for available_themses,
the logic ignores the input and reflect nothing in the config file,
which can cause unexpected results. This ensures the given input is
a hash value.

This also adds validations to ensure only required values are included
by the hash.

Change-Id: I61aefe65e6218a79dce7a0633cb0ceb13b0021b4
2024-01-10 15:42:02 +00:00
Takashi Kajinami d8098793ea Restart httpd after config change
This fixes the missing notifications so that the httpd service is
properly restarted after config files are updated.

This also realigns package resources for separate dasobhards to
the global install phase because these packages should be installed
before config phase.

Related-Bug: #2048037
Change-Id: I8331c6c528391401c57b450be6bf75829179a9f8
2024-01-10 01:52:26 +09:00
Takashi Kajinami 748e615c78 Support COMPRESS_ENABLED
The COMPRESS_ENABLED option controls whether the compression should be
enabled. This adds support for this option.

Change-Id: Ie3e48afc50770b121daacb90d8c70cf241efd330
2023-12-14 11:36:39 +09:00
Zuul 678f359196 Merge "Support purging local_settings.d" 2023-11-16 05:11:35 +00:00
Zuul 2467a38063 Merge "Create dedicated class for ironic-ui" 2023-11-15 17:06:26 +00:00
Takashi Kajinami e1e446e689 Support purging local_settings.d
In Debian, some files are installed into local_settings.d by their
packages and these conflict with the options added to local_settings.
This introduces an option to purge the directory.

Change-Id: I7e074f78b15ab22d86d6a6a10f573cfc4052023a
2023-11-14 08:25:48 +00:00
Takashi Kajinami cfe50237b6 Debian: Fix wrong wsgi script path
The horizon package in Debian installs the wsgi.py file at a path
different from the other distros.

Closes-Bug: #2043371
Change-Id: Idb8550dd534cd2a1bb442cd2e2256f1a8fc8d89e
2023-11-14 17:25:25 +09:00
Takashi Kajinami 1219aab898 Create dedicated class for ironic-ui
The package name of ironic-ui in Ubnutu/Debian does not follow
the general naming rule and the existing horizon::dashboard can't be
used.

Closes-Bug: #2033929
Change-Id: I7703550897c6b31f2b45ffce75f0ab2bae7a4157
2023-11-14 00:09:12 +09:00
Thomas Goirand d94647073a Add TOTP support
Horizon recently introduced TOTP support. This introduces a few new
parameters to allow users to enable the feature.

Depends-on: https://review.opendev.org/c/openstack/horizon/+/885570
Change-Id: I0b8d86c292715ffbb6d75dadcda7b51b1c190641
2023-10-22 14:40:48 +00:00
Takashi Kajinami 3a15e126e2 Remove usage of deleted manifest_dir
Recent update in rspec-puppet removed some of the config interfaces for
old puppet versions[1]. This drops usage of these interfaces to resolve
the following error in unit tests.

```
An error occurred while loading ./spec/unit/provider/manila_spec.rb.
Failure/Error: c.manifest_dir = File.join(fixture_path, 'manifests')

NoMethodError:
  undefined method `manifest_dir='...
```

[1] 316d95923c

Change-Id: Ic74097dd92e23c6575284cbe61a605deac4f646c
2023-10-11 12:00:46 +09:00
Zuul ba53673ea1 Merge "Simplify setting of urls" 2023-09-18 21:16:08 +00:00
Zuul c4af4b3d35 Merge "CentOS: Skip redundant compress/cache clear" 2023-09-15 14:06:14 +00:00
Takashi Kajinami d967012a7a CentOS: Skip redundant compress/cache clear
The horizon package in RDO provides the systemd drop-in[1] to execute
these commands before starting the httpd service, so we don't have to
execute these explicitly.

[1] https://github.com/rdo-packages/horizon-distgit/blob/rpm-master/python-django-horizon-systemd.conf

Change-Id: Ifb5cb45ce848345a8ca865443040830325686043
2023-09-12 16:36:32 +09:00
Takashi Kajinami 173cd6b8c5 Align default SESSION_TIMEOUT with horizon's default
The SESSION_TIMEOUT parameter in horizon defaults to 3600. This updates
the default in our module to use the consistent default.

Change-Id: Icb609fad8ce95f867fe467064995e665e42f253c
2023-09-12 13:47:13 +09:00
Takashi Kajinami b9780547a9 Add support for TOKEN_TIMEOUT_MARGIN
Change-Id: Ia0ceb69a45680a29e7311da94676d026978c2caa
2023-09-12 13:46:06 +09:00
Takashi Kajinami 5bc9978891 Simplify setting of urls
Since [1] was merged, all the URL options are set according to
the WEBROOT option. Also the trailing slash is added automatically.

[1] 2a772d64800070689478a49b6aa26a5893b2067b

Change-Id: Ic13cd2e541f21d07ed1b2b1337eeae042dbe2daa
2023-09-12 01:50:09 +09:00
Takashi Kajinami 9554a40a63 Verify each line separately in fragment
Currently when any of the expected lines do not appear in the concat
fragment, the verify fails but shows only the truncated contents. This
makes it difficult to find out which line is wrong.

This split the evaluation to every single line so that more specific
error is shown.

Change-Id: I1f6233bd1fa7ec3557e622942397fe58e583e4c9
2023-08-31 15:13:15 +09:00
Takashi Kajinami 19db7a0d2f Stop replacing a dict value
Currently we completely replace some dict values in local_settings but
this causes a few problems.

 - Some keys(eg OPENSTACK_HYPERVISOR_FEATURES['enable_quotas']) are
   missing from the default dict value, which overrides its default
   value (True) in Horizon

 - We have to maintain the default values defined in our manifest
   according to any update in Horizon side.

This updates the logic to override keys only when requested, so that
the configuration basically leverage the defaults defined in Horizon.

Change-Id: I0fa105e595ff053d389e75004638af5856dbb734
2023-08-31 15:13:12 +09:00
Tobias Urdin bec3f3a214 Remove hardcoded hypervisor_options values
The default value of can_set_mount_point
that we merge into the hypervisor_options
parameter is not the Horizon default.

This removes the defaults that sets the
can_set_mount_point to true by default when
Horizon has this as false by default, it's
also only really functional on a very specific
hypervisor.

This also removes the can_set_password config
that we set to False that already is the Horizon
default.

Change-Id: Iba05bce817da1c1bc51acb06b6bdc69beba2ea26
Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
2023-08-23 08:52:34 +02:00
Tobias Urdin 7c0c3e4d45 Add per module policy service refresh
Updating the policies for this project should only
refresh the services that reads it.

Change-Id: I94e1120013aa6e15bbf3aa48a9c29d9943985440
2023-06-22 22:09:24 +00:00
Radomir Dopieralski 910420589e ENFORCE_PASSWORD_CHECK is a standalone setting
... , not in HORIZON_CONFIG

Change-Id: Ic53612971f8e8d88e3f052583c5f4dba42c4a113
2023-05-15 13:15:17 +09:00
Zuul 041da00755 Merge "Stop overriding default value for some limit options" 2023-04-11 16:28:26 +00:00
Zuul ec0775af28 Merge "Use separate file to store SECRET_KEY" 2023-04-11 16:28:24 +00:00
Takashi Kajinami 8a2be0b25a Use separate file to store SECRET_KEY
Horizon supports loading secret key from a separate file. This change
updates the configurations to use that feature instead of putting
the key content in local_settings.

This allows us to more strictly limit access to the key content.

Change-Id: Ie91c2286afc102145ee49f5ef91b250e92af16a7
2023-04-07 09:17:05 +00:00
Takashi Kajinami c7229c6176 Allow tuning cache timeout
This allows users to tune cache timeout in Django.

Change-Id: I18cf8d80074203c044e69609dd7f713f6a2a593d
2023-04-07 14:27:06 +09:00
Takashi Kajinami 10e543f333 Stop overriding default value for some limit options
This removes the hard-coded default values for the following options
so that we can leverage the defaults defined in Horizon itself.
 - API_RESULT_LIMIT
 - API_RESULT_PAGE_SIZE
 - DROPDOWN_MAX_ITEMS

Change-Id: Id392b959ff05bba0dd75343313b2c3f956d29565
2023-04-07 14:04:51 +09:00
Takashi Kajinami 0e618ae9e7 Debian: Fix the wrong package name of manila-ui
Closes-Bug: #2009921
Change-Id: I0e01ff19c8271162f693ec1859160a8377aacb3c
2023-03-10 17:28:38 +09:00
Takashi Kajinami 17f9bd3fcf Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: I7a37d698eaf31fe51f656966cfcda44721648b17
2023-03-02 12:23:01 +09:00
Takashi Kajinami ead7aabb85 Support customizing HORIZON_CONFIG['bug_url']
Change-Id: I912f7c7d9e7547e0d77b5af9b15492b439f1635c
2023-02-16 16:50:03 +09:00
Takashi Kajinami 08acafc46b Stop replacing whole HORIZON_CONFIG dict
... so that we can leverage the default items defined in horizon.

Change-Id: I6242f8cb48e51892476ead2f764d7d2c96d11448
2023-02-16 16:46:23 +09:00
Takashi Kajinami 4f3e975a9e Deprecate ineffective images_panel
The images_panel key in HORIZON_CONFIG setting dict was once added
during Newton cycle but was removed when ANGULAR_FEATURES option was
added in the same cycle[1].

Because the parameter has have no effect for long, this deprecates
the parameter so that we can remove it in a future release instead of
fixing it.

[1] https://review.opendev.org/c/openstack/horizon/+/353377

Change-Id: I376af3b7c4525036bf1bb449cb71490495395f2c
2023-02-16 12:08:14 +09:00
Tobias Urdin 77dcef9b78 Add openstack_keystone_endpoint_type param
The new config option OPENSTACK_KEYSTONE_ENDPOINT_TYPE
is added in the [1] change and updated in change [2].

[1] https://review.opendev.org/c/openstack/horizon/+/844574
[2] https://review.opendev.org/c/openstack/horizon/+/868060

Depends-On: https://review.opendev.org/c/openstack/horizon/+/868060
Change-Id: I1be058ebf43f7f40d73ddf67c8356282a6acaacc
2023-01-16 16:03:55 +09:00
Takashi Kajinami 5660159a6e Ensure pymemcache library is installed
The pymemcache library should be installed when pymemcache backend is
used but this library is not installed by the package dependencies and
should be installed additionally.

This also ensures the cache libraries are installed during package
installation phase, so that the libraries are available when horizon
is started.

Closes-Bug: #1988205
Change-Id: I90cd9d9e1276fae71fcb9cbc7ba95b8839690dbd
2022-08-31 10:53:13 +09:00
Zuul dfb5c37f91 Merge "Validate boolean values used in if-statement" 2022-08-23 08:10:49 +00:00
Zuul a90402f337 Merge "Do not show diff of local_settings(.py)" 2022-08-19 19:24:15 +00:00
Takashi Kajinami ccc9227b12 Validate boolean values used in if-statement
This change ensures the parameters used in if-statement take boolean
values, because usage of a different type(eg. String) can cause
unexpected evaluation result.

[vagrant@localhost ~]$ cat foo.pp
$foo = false
$bar = 'False'
$baz = 'false'

if $foo { warning('foo') }
if $bar { warning('bar') }
if $baz { warning('baz') }
[vagrant@localhost ~]$ puppet apply foo.pp
Warning: Scope(Class[main]): bar
Warning: Scope(Class[main]): baz
Notice: Compiled catalog for localhost.localdomain in environment production in 0.02 seconds
Notice: Applied catalog in 0.01 seconds
[vagrant@localhost ~]$

Change-Id: I5c327c37e700829ffb80b9f58d15607aa883bdc1
2022-08-19 14:20:58 +09:00
Takashi Kajinami a810ca2b4e Do not show diff of local_settings(.py)
... because the file contains a few sensitive values like SECRET_KEY.

Closes-Bug: #1987015
Change-Id: Ie96eb626148214270c5a3a041087fcc679c127ce
2022-08-19 13:56:11 +09:00
Zuul d73e23c4bc Merge "Remove redundant include of apache::mod::*" 2022-08-18 17:34:54 +00:00
Zuul be8bcfb5a2 Merge "Stop testing apache::mod::wsgi::wsgi_socket_prefix" 2022-08-18 17:34:52 +00:00
Zuul 97531bfc05 Merge "Remove logic for Puppet < 4" 2022-08-18 17:34:50 +00:00
Takashi Kajinami 5a5ef576be Remove redundant include of apache::mod::*
The puppetlabs-apache module includes the classes for required modules
automatically based on the parameters used in apache::vhost.

apache::mod::wsgi
https://github.com/puppetlabs/puppetlabs-apache/commit/efffa854f
(available since 1.1.0)

apache::mod::ssl
https://github.com/puppetlabs/puppetlabs-apache/commit/ee37f2146
(available since 0.3.0)

Change-Id: I44d49918b81325815d5d7a3770c2e8a7487eef74
2022-08-17 14:20:24 +00:00
Takashi Kajinami ce67a64bbd Stop testing apache::mod::wsgi::wsgi_socket_prefix
The parameter is no longer set by this module since [1] was merged.

[1] 78bdbe683a

Change-Id: Ic867d57363bee6d573db14a1efae89126b1c4b3c
2022-08-17 23:19:02 +09:00
Takashi Kajinami 586d4f3401 Remove logic for Puppet < 4
... because that old version is no longer supported.

Change-Id: I0a6507e82edcfb66b116ca505dba1ac84bb25eb7
2022-08-17 23:13:15 +09:00
Takashi Kajinami 6bf7abada9 Remove logic to handle quoted horizon_upload_mode
This is follow-up of 625275af36 and
removes the temporal logic to keep compatibility, because we have kept
the warning message for several cycles.

Related-Bug: #1946277
Change-Id: I1b11305df67dbe3127642a96bda429faae0059d5
2022-08-17 09:05:34 +09:00
Takashi Kajinami 14b45e9987 Fix type validation error with puppetlabs-apache 8.0.0
This is follow-up of 3ae8f91ca4 and fixes
type validation error of apache::vhost::access_log_format, which no
longer accepts a boolean value.

Related-Bug: #1983300
Change-Id: Ic5bcbcd94bfe74b0ff7ea750780021daa772a196
2022-08-15 02:54:04 +09:00
Zuul 2d3d0244a5 Merge "Add inet6 prefix only when MemcacheCache is used" 2022-08-12 09:33:54 +00:00
Zuul 50980b9a1d Merge "Adapt to new type validation in puppetlabs-apache" 2022-08-11 18:31:10 +00:00
Takashi Kajinami 57905ff386 Drop default_dashboard
default_dashboard was deprecated a long ago in Horizon[1] and
Having that parameter in local_settings triggers the following warning
message.

```
WARNING:root:"dashboards" and "default_dashboard" in (local_)settings
is DEPRECATED now and may be unsupported in some future release.
The preferred way to specify the order of dashboards and the default
dashboard is the pluggable dashboard mechanism (in ...).
```

This change removes that parameter hard-coded in the template file to
get rid of the warning message. Currently the project dashboard is
shown first in Horizon by default so removing the parameter does not
cause any change in behavior.

This also removes these deprecated parameters from the template file
used in unit tests.

[1] 75bc2e6aa86d31f60288021694699302b3873af3

Closes-Bug: #1983390
Change-Id: I8cd5346a553db9ba9f6bdf8ffdd9e7d89d16c4be
2022-08-04 00:58:04 +09:00