Commit Graph

58 Commits

Author SHA1 Message Date
Alex Kavanagh ea0ef6d32e Improve platform mocking
Patch out charmhelpers.osplatform.get_platform() and
charmhelpers.core.host.lsb_release() globally in the unit tests to
insulate the unit tests from the platform that the unit tests are being
run on.

Change-Id: I27979aaeec8040b8cd5c07e5ad12a6ca8544278c
2023-10-24 18:02:12 +01:00
Gabriel Cocenza 19cf71dc79 Add support for HAProxy L7 checks
This change add several configuration options to enable HTTP checks
to the HAProxy configuration, instead of the default TCP connection
checks (which continue to be the default). It also enables /healthcheck
endpoint for heat-api and heat-cfn-api on openstack releases >= queens.

Closes-Bug: #1880610
Change-Id: I94c9418c82cdddd5a5d9ed400ab47889bfb225b1
2023-02-17 12:05:27 -03:00
Zhang Hua de88ad5344 Number of heat queues will keep growing forever after heat-engine restarts
Set TTL as a solution for topic queue engine_worker and heat-engine-listener
to avoid them growing all the time after heat-engin restarts.

This is heat part.

Closes-Bug: 1925436
Change-Id: I196346e4ca869efab45d1c2aafb1420b2a917d39
2021-05-24 15:44:46 +08:00
Alex Kavanagh c81858c248 Updates for testing period for 20.01 release
Includes updates to charmhelpers/charms.openstack for cert_utils
and unit-get for the install hook error on Juju 2.9

* charm-helpers sync for classic charms
* rebuild for reactive charms
* ensure tox.ini is from release-tools
* ensure requirements.txt files are from release-tools
* On reactive charms:
  - ensure master branch for charms.openstack
  - ensure master branch for charm-helpers
* Fix unit tests due to changes in core subordinate context lib.

Change-Id: I61d51dc65ba29390df1c057535a2065e205d32b2
2021-01-18 20:14:48 +00:00
Alvaro Uria 213a6a8c95 Add nrpe support
Parses services() available, and uses charmhelpers' haproxy checks to
set default checks for Heat. By enabling nrpe-external-master interface,
we also allow hacluster subordinate application to be monitored for
check_crm and pacemakerd.

Change-Id: I4ad2b1c514099f9b6fe352cdab65587780915e5c
Closes-Bug: 1664745
Signed-off-by: Alvaro Uria <alvaro.uria@canonical.com>
2020-11-13 15:38:52 +01:00
Alex Kavanagh 84f636c9d0 Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Func test pr is needed for py35 compatibility - test to ensure that zaza
change works.

func-test-pr: https://github.com/openstack-charmers/zaza/pull/390

Change-Id: Id729d01b6f2e41ccb3f605638a1837fc2b3c626d
2020-10-06 18:51:21 +01:00
Hervé Beraud a53c5b244a Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: Ic61aac57ab757e555be0eef818052c58b8cf03dd
2020-06-09 16:36:35 +02:00
Felipe Reyes 50d114aa1f Add max-stacks-per-tenant config option
This configuration option allows operators to change the default of
how many stacks a project can have in parallel.

This key has been available since Mitaka:
https://docs.openstack.org/mitaka/config-reference/orchestration.html

Closes-Bug: #1871772
Change-Id: I4dc0008c1098a969d62ee4a8afe76de4bfb5c235
2020-05-19 02:42:28 +00:00
Zuul 5f3a4c0d3d Merge "Disable Apache port 80" 2020-01-31 15:54:13 +00:00
Liam Young e74c9a4d5f Do not access DB when it is in maintenance mode.
If the database is in maintenace mode do not attempt to access
it.

Depends-On: I5d8ed7d3935db5568c50f8d585e37a4d0cc6914f
Change-Id: Ib654a82fd91cd73c6ab5c178d87d054d8717ce4f
2020-01-30 12:37:29 +00:00
tpsilva 0ef0ebb9b0 Disable Apache port 80
Currently, Apache ports.conf file is not being configured by this
charm. This patch changes the ports.conf default file with another one
that does not open port 80 on SSL environments.

Change-Id: I881c3569a25c0f0a84c14ee086b3f3adfdbc97f9
Closes-bug: #1845665
2020-01-28 14:52:33 +00:00
Alex Kavanagh 98de623820 Policyd override implementation
This patchset implements policy overrides for heat.  It uses the
code in charmhelpers.

It also fixes a bug in the actions/domain-setup where it assumes that
the python2 version of openstackclient should be installed, and corrects
this via code in hooks/install and hooks/upgrade-charm.

A sync of charm-helpers is included to bring the latest policyd changes
through to the charm.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/111

Change-Id: Ia607dc9120cfb03902efb019041b43cf12ade2d3
Closed-Bug: #1741723
2019-11-06 16:12:34 +00:00
Liam Young 8c7bc961a9 Use chelper generate_ha_relation_data for ha rel
Use the generate_ha_relation_data helper from charmhelpers to
generate the data to send down the relation to the hacluster
charm.

This results in a few changes in behaviour:

1) The charm will no longer specify a nic name to bind the vip. This
   is because Pacemaker VIP resources are able to automatically
   detect and configure correct iface and netmask parameters based
   on local configuration of the unit.
2) The original iface named VIP resource will be stopped and deleted
   prior to the creation of the new short hash named VIP resource.

Change-Id: I116b1ffd02803b71ecbb3e6612ee392698b6eaa4
2018-12-04 11:34:22 +00:00
James Page ade222568d Deal with py2-py3 migration during charm upgrade
On charm upgrade the charm may switch to py3 packages. If so, ensure
the old py2 packages are purged after any new packages have been
installed.  If packages where removed during the upgrade, then
restart all services to pickup any py2->py3 switches.

Change-Id: I9acd536c437ff9d8c6a7056ac255aa4b6de62673
Closes-Bug: 1803451
2018-11-15 12:16:52 +00:00
Ryan Beisner b0f7a69e5b
Fix lint in unit test
Change-Id: I73b3f57c8743f58c3568a71b436e58cf8910be16
2018-11-01 14:59:05 -05:00
David Ames 0bcdc44c01 Series Upgrade
Implement the series-upgrade feature allowing to move between Ubuntu
series.

Change-Id: I4377125f537c555e4b0b63dc08a3d9c0fc9d5251
2018-10-15 16:25:06 -07:00
Corey Bryant 711693ac47 py3: Switch to using Python 3 for rocky or later
Switch package install to Python 3 for OpenStack Rocky or later.

When upgrading, remove any python-* packages that where explicitly
installated and then autoremove --purge any dependencies that are
no longer required.

Change-Id: Iaac7c48041200a21a2fdb86dbeadefcad5e8b579
2018-09-20 08:31:30 +00:00
Ante Karamatic 4c9088b396 Add support for subordinate charms
These changes provide support for extending heat with
subordinate charms.

Change-Id: I9266390e1393bcf9c60fb294814100d6957320ae
Closes-Bug: #1626077
Closes-Bug: #1627703
2018-07-23 18:01:25 +02:00
James Page db73787c80 Remove deploy from source support
Drop support for deployment from Git repositories, as deprecated
in the 17.02 charm release.  This feature is unmaintained and has
no known users.

Change-Id: I821f8b6d93f84b0fd632e18c47dc4184c5897756
2018-01-10 11:41:00 +00:00
David Ames c7fea4af07 Update for Python 3 execution
Charm helpers sync

Change-Id: I6cfa96b23354f68521a3179eb690340e1c9f23bf
2017-11-20 15:11:08 -08:00
Alex Kavanagh 275a8f61c6 Ensure auth_encryption_key is identical for all units
This patch ensures that if multiple heat units are deployer, that each
one will have the same auth_encryption_key in the /etc/heat/heat.conf.
This is automatically generated on the (juju) leader and then remains
unchanged for the application's duration.  It can be overriden by the
config setting 'encryption-key'.

Testing is via the amulet 500 test (added) which checkes that the two
units deployed have the same key.

Change-Id: I89a11efe772314acd58ab9be21773eee89a23980
Closes-Bug: #1714157
2017-09-22 16:23:30 +01:00
zhangyangyang 6cb0ede086 change assert(Not)Equals to assert(Not)Equal
According to http://docs.python.org/2/library/unittest.html
assert(Not)Equals is a deprecated alias of assert(Not)Equal.

Change-Id: Ib311e5de005f8601e534da15b5a51af024ba8d60
Closes-Bug: #1329757
2017-09-13 21:45:36 +08:00
David Ames 1479919153 Network space aware address for cluster relation
Use the get_relation_ip function for selecting addresses for the
cluster relationship. Including overrides for the admin, internal,
and public config settings or extra bindings.

Change-Id: I9a22868bca6b443f9b7b0e7cecc314ca6b50a112
Partial-Bug: #1687439
2017-05-05 09:35:50 -07:00
Liam Young f7dc1f111c Enable Memcache service for Token Caching
With the release of 4.2.0 of keystonemiddleware using the
in-process token cache is no longer recommended. It is recommended
that a memcache backend to store tokens is used instead,

This installs and configures memcache and configures neutron-server
to use memcache for token caching.

http://docs.openstack.org/releasenotes/keystonemiddleware/mitaka.html#id2

Change-Id: Ic921a7efbd860cbcd4da2313126f73d7bdfdb4ed
2016-12-13 09:26:51 +00:00
James Page be88635418 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I8fa16392527906102fed38d0c557e68bfff33959
2016-07-01 17:23:55 +01:00
David Ames 10c3025809 DNS HA
Implement DNS high availability. Pass the correct information to
hacluster to register a DNS entry with MAAS 2.0 or greater rather
than using a virtual IP.

Charm-helpers sync to bring in DNS HA helpers

Change-Id: Ia4ccb2e28ea5b2b07cef10fcbaf7885336d21c8b
2016-06-15 11:40:19 -07:00
David Ames cc6811b7f7 Use restore heat_ prefix for shared-db relation
Heat is staying in status blocked Missing relation database when
doing an upgrade from stable to next. Missing required data:
database_password. The relation is actually passing heat_password.

Commit 1bdc87f495 removed the heat_
prefix. This changes restores the heat_ prefix to allow stable to
next upgrades to work.

Change-Id: Id87afd5eda14eceac6c734867f9f96328c116c79
Closes-Bug: #1571830
2016-04-20 11:13:42 -07:00
James Page b6b0af9377 Use network space binding for shared-db relation
To ensure that the charm presents the right IP address for
accessing the MySQL database over the shared-db relation,
ensure that any network space binding provided by the user
is preferred over the default of 'private-address'.

If network spaces is not supported (juju < 2.0), fallback to
using 'private-address'.

Change-Id: Ic49f16c8ccceeb5aa25a2197a92767dc5aacf703
2016-04-13 11:28:51 +01:00
Edward Hope-Morley 2e717d228d Add hardening support
Add charmhelpers.contrib.hardening and calls to install,
config-changed, upgrade-charm and update-status hooks. Also
add new config option to allow one or more hardening
modules to be applied at runtime.

Change-Id: I3d3ff350256bb09145c335a29e48c21433ac4c43
2016-03-24 10:39:29 +00:00
Liang Chen 1bdc87f495 Provide heat charm HA support
[cbjchen,r=]
2016-02-19 19:22:51 +08:00
James Page 4e55e2f4c1 Updates for liberty fixes 2016-02-10 12:27:52 +00:00
Mick Gregg 21d5961517 Merged with next 2015-12-02 15:50:33 +00:00
Edward Hope-Morley 05f14be73f sync /next and resolve conflict 2015-11-16 09:14:33 +00:00
Mick Gregg 4794992a3f Merge with next 2015-11-03 08:39:23 +00:00
Mick Gregg 3822132ed4 Merge with next 2015-11-02 16:40:35 +00:00
James Page 855aa2e698 Add tox support 2015-11-02 11:18:46 +00:00
Edward Hope-Morley 3c8d5bb12e more 2015-10-30 10:53:01 +00:00
Edward Hope-Morley 3ce21c8a53 [hopem,r=]
Add ipv6 support
Closes-Bug: 1511326
2015-10-29 11:33:33 +00:00
Corey Bryant 1f7a734231 fix lint errors 2015-09-22 21:55:13 +00:00
Corey Bryant 537e5d0d1d Restart services after migrating database. 2015-09-22 21:53:17 +00:00
Corey Bryant 0921e84ca7 apt upgrade packages during openstack upgrade 2015-09-22 20:21:39 +00:00
Corey Bryant a77f97c13d Migrate heat database on upgrade and work around juno python-swiftclient upgrade issue. 2015-09-22 19:53:18 +00:00
Corey Bryant a1f2428e97 Import CONFIGS instead of calling register_configs() again. 2015-09-22 19:41:24 +00:00
Corey Bryant c10efd0a91 Action-managed openstack upgrade support 2015-09-21 19:35:41 +00:00
Mick Gregg 3c227b98bb Merged with trunk, includes replacing Amulet tests with those from trunk 2015-08-11 17:13:33 +01:00
Billy Olsen b9d15257ec [wolsen,r=] Add support for overriding public endpoint addresses.
Adds in the config option for overriding public endpoint addresses
and introduces a unit tests to ensure that the override for the
public address is functioning correctly.

Closes-Bug: #1398182
2015-06-04 16:14:33 -07:00
Mick Gregg 74a78e5f58 [macgreagoir] Make heat.conf instance_user item configurable. 2015-05-06 15:03:04 +01:00
Edward Hope-Morley 633896c4d2 added haproxy support like other charms 2015-04-02 12:52:13 +01:00
Edward Hope-Morley 53ee4bc20b fixes 2015-04-02 12:31:56 +01:00
Edward Hope-Morley f3478dddd3 adds ssl support 2015-04-01 13:18:13 +01:00