185 Commits

Author SHA1 Message Date
Takashi Kajinami
109bb65c3a Drop reference to dib-utils
The dib-utils repository was retired when TripleO was retired. We
decided to vendor the dib-run-parts script in os-refresh-config so
we no longer need the separate tiny package for the dib-run-parts
script.

Depends-on: https://review.opendev.org/c/openstack/os-refresh-config/+/910574
Change-Id: Id35efa4b387bd0fa21c1d73a4fe59f88c197f500
2024-02-29 17:08:10 +09:00
Zuul
64f020b602 Merge "Fix software config on rdo" 2020-11-16 06:46:30 +00:00
Andrei Nistor
63444ea47a Fix software config on rdo
The os-refresh-config scripts directory is currently set to
/opt/stack/os-config-refresh, but the latest os-refresh-config expects it to be
/usr/libexec/os-refresh-config

Change-Id: Ic3f61ea88fd431e7d9893c6930c778f6fbf21147
2020-11-16 05:48:26 +00:00
Pratik Raj
dd8d284c36
optimize size and time using --no-cache-dir
Using --no-cache-dir flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Change-Id: I99570e8da62205498bdba6064160d2592a86ad3e
Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2020-10-03 11:49:04 +05:30
ricolin
53800d1057 Remove docs, deprecated hooks, tests
Remove all deprecated hooks and tests.
Also since all test and hooks are removed,
we can remove the declare of python language in classifier.
Since we didn't actually provide any document,
we should remove docs too.

Hooks are maintained as Agents under heat-agents repo now.
Hooks in heat-templates are deprecated for a while. Hence, remove
hooks in heat-templates.

Depends-On: https://review.openstack.org/#/c/584774/
Change-Id: Ia886f71eaf99d75db0f9a6a7dfbe8664995c26e7
2019-01-03 20:18:06 +13:00
Zuul
6b5a7cd2b5 Merge "Deprecate hooks in heat-templates" 2018-05-10 13:01:59 +00:00
ricolin
20fb0efa11 Deprecate hooks in heat-templates
We already create repository `heat-agents` for hooks and will keep
maintain hooks there, so we should deprecate all hooks in
heat-templates and plan to remove it in futuer.

Change-Id: Ie2d89d5bab7db2bc6a2e171dc455098811519440
2018-02-07 16:50:34 +08:00
rabi
a276f088ce Make cirros-example v3 compatible
This example seems broken. Though it will work if you
change the auth_url to point to /v2.0 rather than /v3, it's
better to make it work with v3 (the default now for all
keystone deployments).

Change-Id: I411a0f50ae50ee5b7c2564a7764ee9a01b00afea
2017-08-01 14:42:43 +05:30
ricolin
e4df67e265 Fix undefined basestring and unicode in py35
In py3 basestring and unicode are no longer valid,
and should use `str` instead. In order to cover
py2 and py3, we change to use six lib to cover both.
Closes-Bug: #1682015

Change-Id: I3159470965e3a20161ff0e997af625b45ebe21fa
2017-07-08 03:47:08 +00:00
Spyros Trigazis
1351cc322b Fix heat-container-agent
* use fedora base image from fedora registry
* fix ADD and run script
* move package install in Dockerfile for layers
* add zaqarclient

Change-Id: Iaa82fcd7af25ec81e982e6b170aa1d449f6e1166
2017-06-22 10:45:34 +02:00
Alex Schultz
6d2659b468 Fix splay config template
The splay option was added in I88f623c9e8db9ed4a186918206a63faec8f7f673
but was missing a trailing } which leads to parse errors. This fixes the
parse errors.

Change-Id: Ic5783220f5d027e0bde0080f50f9e10cbb68289f
Closes-Bug: #1686455
2017-04-26 10:30:11 -06:00
Jenkins
2603dbedef Merge "Add splay option" 2017-04-26 05:33:18 +00:00
Alex Schultz
c09f1d0cde Add splay option
Add the ability to configure the splay option that was recently added to
os-collect-config.

Change-Id: I88f623c9e8db9ed4a186918206a63faec8f7f673
Related-Bug: #1677314
2017-04-06 15:22:27 -06:00
chenaidong1
bb79184e69 Replace yaml.load() with yaml.safe_load()
Yaml.load() return Python object may be dangerous if
you receive a YAML document from an untrusted source
such as the Internet. The function yaml.safe_load()
limits this ability to simple Python objects like
integers or lists.

Reference:
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: Ib2bfd11354c6b35c90938c1075729dc7028236a3
2017-03-10 16:18:30 +08:00
Jenkins
15cf0b6ebb Merge "Add zaqar.use_websockets option to o-c-c" 2017-01-23 22:27:05 +00:00
Jenkins
01b1768740 Merge "Add a hook to help write json files" 2017-01-09 23:03:28 +00:00
Jenkins
2396e34af2 Merge "Use 'openstack' commands instead in docs" 2017-01-03 08:59:26 +00:00
huangtianhua
41927fa086 Use 'openstack' commands instead in docs
Now we suggest to use 'openstack' commands to
replace individual commands of every project.

Change-Id: I47dac03e9da1f00f33bd7caba003de0dd1a110b6
2017-01-03 06:42:36 +00:00
Dan Prince
08725114a8 Add a hook to help write json files
This patch adds a new Heat software configuration hook that
can be used to generate Json config files in a composable manner
within Heat templates.

This can be useful for everything from providing data to ad-hoc
scripts from configuring kolla containers.

Change-Id: I2b372ac2e291339e436202c9fe58a681ed6a743f
2017-01-01 14:59:00 -05:00
Sofer Athlan-Guyot
7e98f208ed Enable the use of a non-standard module-path for ansible.
This mirror the puppet hook.

Closes-Bug: #1651825
Change-Id: I19006c531591e9c02a95448007707c3f4a013633
2016-12-23 12:10:35 +01:00
Dan Prince
176d14a814 Add zaqar.use_websockets option to o-c-c
Change-Id: Iad5d7cc77157e00fb6ba27f589fa0bf5384bab3a
2016-12-22 16:43:38 -05:00
Steve Baker
d10069ac13 docker-cmd hook handle empty config file
Early in a server boot the file /var/run/heat-config/heat-config may
exist but be empty. This causes a stack trace to be raised in this
script.

This change detects a json parse error and exits gracefully.

Change-Id: I29d731098659bfbf10a2caf80c2cfc49de5df4cc
Closes-Bug: #1648249
2016-12-13 09:57:52 +13:00
Steve Baker
8ab13c5489 Do docker operations in a defined order
This fixes the heat-templates gate

Change-Id: If171d93408e9252606454ce61e5923502649d2bc
2016-12-13 09:57:52 +13:00
Jenkins
67e02ce57c Merge "Allow ansible inventory to be configurable" 2016-12-06 02:52:58 +00:00
huangtianhua
5b36b6fb38 Add example to configure ca certificates with userdata
Add template example to configure ca certificates when the
instance boots for the first time.

Change-Id: I016f67cf3af7b17482c0124eb07ffa67c0545bb0
2016-11-24 14:42:33 +08:00
Jenkins
a6a6861ff1 Merge "docker-cmd hook" 2016-11-16 03:07:12 +00:00
Steven Hardy
3aeb4359b9 Correct tags option position in ansible hook
I made a mistake with the argument ordering, these need to go
before the playbook name

Change-Id: If7d2dc9f9a09d1c9feb78c3a8cbb2980c3e647f4
2016-11-15 18:38:17 +00:00
Juan Antonio Osorio Robles
af01bb96ce Set content-type for SoftwareConfig's heat-config-notify
What the heat-config-notify actually POSTs/PUTs to heat is JSON, so
the content-type should be updated as such.

Change-Id: I85e116bec524ba37e96c5761346084ab149601cc
Related-Bug: #1641589
2016-11-14 16:59:22 +02:00
Alex Schultz
b1714b244d Add local logging output to puppet hook
This change updates the puppet hook to write out logs to the local node
if verbose or debug is enabled for the hook. The logs will be written
out to the /var/log/puppet/ folder that currently is empty at all times.
We will continue to output logs to the console for the traditional heat
processing of the stdout and stderr but will also write out the logs
locally only if debug or verbose is enabled for the puppet apply.

Change-Id: Idfbfc030350827a4653b26cef7c7deca92b0e05d
Closes-Bug: #1536009
2016-11-08 09:08:21 -07:00
Steve Baker
2baf44a32c docker-cmd hook
This hook takes the same format as the docker-compose hook, but makes
calls directly to the docker command rather than calling
docker-compose.

This hook currently supports the docker-compose v1 format, but in the
future will support other formats such as the kubernetes pod format.

TripleO will adopt this hook and will transition to using the pod
format when this hook supports it.

Co-Authored-By: Ian Main <imain@redhat.com>

Change-Id: I699107c3df64723a945c5d5ac82ae3a48b76700e
2016-11-04 16:13:18 +13:00
Steven Hardy
06205231a3 Add option to pass tags to the ansible hook
Currently we don't support options for the ansible hook, but it would
be useful to enable passing tags, like we already do for the puppet
hook.

Change-Id: Idf7e3aa520fd40a2c4c00b2d26c3c608059bb51d
2016-11-03 17:43:51 +00:00
Dan Prince
40a4ed0841 A hook which writes hiera datafiles.
This patch creates a hook that writes hiera.yaml and datafiles
to disk. This approach works well for users (like TripleO)
who prefer to maintain Hiera in a more composable manner with
Heat structured config resources rather than specifying all
the Hiera values for each puppet config resource.

Partial-bug: #1596373

Change-Id: I21639f6aadabf9e49f40d1bb0b1d0edcfc4dbc5e
2016-10-05 21:29:02 -04:00
Dan Prince
7c5aae183a A hook which invokes os-apply-config.
The intent is for this element (hook script) to be used in place of the
one in tripleo-image-elements which relies on an external signal handling
shell script at the end of the os-refresh-config run
(99-refresh-completed).

This version will run os-apply-config and return a signal immediately.
Because it uses the heat-hook mechanisms it also supports a broader set of
signal handling capabilities... which 99-refresh-completed doesn't fully
support.

Change-Id: Ic9402ff93cbc840bec1debcd8881de563d03cbf0
2016-09-29 14:46:45 -04:00
Nguyen Hung Phuong
1e6015d4b2 Clean imports in code
This patch set modifies lines which are importing objects instead
of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I4c34416623ac6899ab8b780bdd668acb414d09ef
2016-09-08 15:41:51 +07:00
Steve Baker
75ee492a7c Make hooks dir discovery more flexible
Currently the hooks dir is statically set to $HEAT_CONFIG_HOOKS or
/var/lib/heat-config/hooks.

This commit changes the approach to finding the hook to execute, it
now looks for the requested hook from a list of directories. The new
directory /usr/libexec/heat-config/hooks has precedence over the old
/var/lib/heat-config/hooks.

The reason for this is that /usr/libexec is a more appropriate
location for downstream packaging to install hook scripts (RDO, debian
etc).

This approach will gracefully handle upgrading an image built with
hooks in /var/lib/heat-config/hooks followed by a package based
upgrade which switches some or all of the hooks to
/usr/libexec/heat-config/hooks.

Change-Id: Id0262e8ab1f96fa556e2ffbdf8b1b25be14ea97b
2016-09-01 10:15:31 +12:00
Steve Baker
1b6a9536d3 Break out inlined boot config files
These are better on their own for maintainability.

Tested locally by successfully launching stack
example-config-pristine-image.yaml with CentOS 7 and the previous
change in this series.

Change-Id: I44650f6b40c8b7a8060f8b7408b2f3d8695aaf36
2016-09-01 10:15:31 +12:00
Steve Baker
5f1c6c66d7 Boot config env for RDO on centos7
This adds an environment centos7_rdo_env.yaml which defines
Heat::InstallConfigAgent to install agent packages from the RDO
package repository.

Change-Id: I28b4315ec0261598867d7632f4f75774f3ef8e60
2016-09-01 10:15:31 +12:00
Jenkins
051822a179 Merge "Correct perms of /var/run/heat-config/heat-config" 2016-07-29 09:09:51 +00:00
Pablo Caruana
497cf075f7 Fix some typos
Change-Id: I87f3328a13767367e6ade54217a226f6b660975a
2016-07-19 18:01:30 +02:00
Steve Baker
55f04e8b40 Correct perms of /var/run/heat-config/heat-config
/var/run isn't persisted during image building, so relying on
os-apply-config preserving the permissions of the existing file won't
work because there isn't one.

Instead, 55-heat-config needs to check and fix the permissions of this
file on each run. Once it is set by 55-heat-config, os-apply-config
will respect the corrected permissions when overwriting.

Change-Id: Iecce01d31d66f217ccf4b34cc29f05465dc1886d
Closes-Bug: #1520347
2016-06-27 10:31:32 +12:00
SamYaple
5e21990e81 Allow ansible inventory to be configurable
This allow the user to pass a string (or path to a file) for the
ansible inventory so it is not just localhost. This is important for
things like setting up groups and possible inventory scoped variables.

Added test to ensure ansible is getting called properly using the ENV
inventory value.

Change-Id: I9440ff9dae3595a1c57b2511f03792105f1beb88
2016-06-14 21:45:39 +00:00
Jason Dunsmore
c7adc9c1a9 Apply tripleo-image-elements fixes to agent configs
Fix configuration of os-collect-config collectors and add zaqar
collector.

Change-Id: Ia4ed349f34b407947f35e3efe228653506fc6775
Closes-Bug: #1567584
2016-05-19 14:26:25 -05:00
ricolin
bb36ace02a Add OS::Heat::SoftwareDeploymentGroup example
There currently did have any template example for
OS::Heat::SoftwareDeploymentGroup.

Change-Id: Ia259eca3f35bca3f9b0f985b2ead1ef2f30d54c5
2016-04-15 23:20:02 +08:00
Jenkins
cdd4d654ce Merge "Fix linting errors in YAML" 2016-04-06 05:55:28 +00:00
Jenkins
ecee4b968e Merge "Wrong usage of "a/an"" 2016-04-05 13:32:26 +00:00
Adrien Vergé
2a2fe91602 Fix linting errors in YAML
This change corrects many problems detected by the `yamllint` linter.
It's a preparation for enabling this linter in change
Ie746230f28fe3ed0cf218201d5a3810f7bc44070.

For instance, the first run of the YAML linter helped discovering a key
duplication problem in `oso_ha.yaml`: the `depends_on` key was present
twice, so the first occurence was ignored.

Other changes are cosmetic: extra spaces, extra blank lines, missing
newlines at end-of-file, etc.

Change-Id: I7f2369adfb152fd2a74b9b105e969e653e592922
2016-03-11 14:57:38 +01:00
Kanagaraj Manickam
96a0b0b3d2 Fix for heat-template build failure
In mitaka, a new feature is introduced to ignore a given
set of errors and is used here to fix the zuul faliure.

In addition, it fixes the invalid template errors.

For those templates which causes circular error is
moved to invalid folder

NOTE: openshift-origin/centos65/highly-available is marked
as invald to make the build jobs to pass.

depends-on: I4a3043fd17b69a346d447dfbd17488040cf9b387
Change-Id: I7b5b72cb8f6ff53b82edf92799a57917c718e032
Closes-bug: #1554380
2016-03-10 19:49:28 +05:30
Jenkins
e53f5d3214 Merge "Install docker-compose using pip" 2016-01-14 18:11:42 +00:00
Jenkins
f6d0b8a714 Merge "Chef-Zero software config hook" 2016-01-14 00:18:48 +00:00
Rabi Mishra
d79b1237a6 Install docker-compose using pip
This patch changes heat-container-agent to
a. pip install docker-compose
b. use latest fedora image(f23)

Change-Id: Ia1a841a3f0054c5c322eea118bdc6de3258eba34
2016-01-13 16:57:40 +05:30