Commit Graph

165 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov fb50e99438 Stop generating ssh keypair for ironic user
There is no obvious need to have an SSH keypairs for ironic user
I was not able to find any proof in the project installation guide that
such keypairs were ever needed. Thus, such functionality is removed.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: I493d5f5aa0a915e7bc9fb7dbcd2673749c0b95d3
2023-10-14 08:50:18 +00:00
Dmitriy Rabotyagov 7226653ad9 Fix linters and metadata
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223
Change-Id: I1ab9664505068c20924370790322caa67cc6e022
2023-07-14 18:07:30 +02:00
Damian Dabrowski 61fd6b6e14 Add TLS support to ironic backends
By overriding the variable `ironic_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the ironic backend api.

The ansible-role-pki is used to generate the required TLS
certificates if this functionality is enabled.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/879085
Change-Id: If97a857c36e9e3e7ad8a18926bb9cbf04189c7cb
2023-04-29 18:37:37 +02:00
Jonathan Rosser c305af301b Allow user defined extra files to be added to ironic tftp directory
Some of these files are already statically defined in the role vars,
but cannot be extended. The new variable ironic_tftp_extra_content
allows either local files (path:) or files from a web server (url:)
to be copied into the tftp server root.

A feature like this is needed to copy EFI firmware to the tftp root
for ironic node CPU architectures that are different to the
ironic control plane nodes. The EFI firmware is sometimes not
available from the system package manager for architechtures
different to the host CPU.

Change-Id: Ie30c009d0704b87c2298088935a7f2ec0d55c6fb
2022-12-12 12:36:40 +00:00
Zuul 591399a999 Merge "Tidy definition of http dir for inspector" 2022-12-09 12:44:51 +00:00
Zuul b4da13095e Merge "Create /var/log/ironic directory" 2022-12-08 22:17:39 +00:00
Jonathan Rosser 7521ced334 Create /var/log/ironic directory
This directory is used by ironic to write logs collected from
ironic-python-agent on nodes being deployed to the disk of the
controller. Without the directory errors occur and it is not possible
to read the log from the agent.

"Failed to store the logs from the node <uuid> deployment due a
file-system related error. Error: [Errno 13] Permission denied:
'/var/log/ironic'"

Change-Id: I25a03e35f29ad7a835dfd72447fa7d20c50fd85c
2022-12-08 14:54:22 +00:00
Jonathan Rosser ba1d9e9d4b Tidy definition of http dir for inspector
The directory for the tftp server defined consistently between ironic
and inspector, but not for the http directory.

This patch makes the definition of the http directory work the same
way as the tftp one.

Change-Id: I8d893faa31e5858c4923cb12ef453ec9397db5df
2022-12-07 14:04:19 +00:00
Jonathan Rosser db106d8b88 Add variable for user defined list of deploy images
It might be needed to supply a list of extra deploy images as
well as the defaults, possibly to cover architectures in
addition to x86.

Change-Id: I2ecf21c44bac75b0e2cbf3bd786821ff0b7bf31a
2022-12-07 14:04:11 +00:00
Jonathan Rosser b974a6c0e0 Refactor ironic deploy image handling.
The deploy image is required in two places in an ironic deployment,
first as images uploaded to glance for the ironic service, and second
as files on a web server for the ironic-inspector service.

Previously this role only placed the deploy images on the ironic
inspector web server, but this patch provides the functionality to
also upload the images to glance.

The variables for ironic deploy image source locations are
consolidated so that only one set are required to run the tasks
for both ironic and ironic-inspector, and several overrides are
available allowing the source to be overidden to a local mirror
easily.

Finally - the name of the files placed on the inspector web server
and into glance represent the upstream name of the image files rather
than generic names which lose versioning and release information.

Change-Id: I1aed9d97a4ddbfb70d2375f5204c55374d1067c9
2022-12-07 15:03:32 +01:00
Zuul d79071dddf Merge "Remove duplicate creation of nginx config directory" 2022-12-06 21:53:19 +00:00
Jonathan Rosser 7794cbd60b Ensure nginx config is present for ironic inspector
In an LXC deployment, nginx runs in both the ironc-api and
ironic-inspector containers. The api container can use ipxe to
boot the deployment and user images when `ironic_ipxe_enabled'
is true. The inspector container can use ipxe to independantly
serve the deploy images during inspection.

On a metal deployment these nginx instances are co-located on the
same host and share the same config files and directory structure
so no additional config is needed for inspectors nginx instance.

In an LXC depoyment the api and inspector containers need their
own individual nginx configuration to be written. This patch adds
that configuration for inspector.

A future patch could refactor the code so that only one set of
tasks is needed to deploy the nginx config to both inspector
and api.

Change-Id: Ida20e6835c6ca1c941fa76eadecf3d49e8b1239f
2022-12-01 14:22:39 +00:00
Jonathan Rosser 3da31daaf9 Remove duplicate creation of nginx config directory
ironic_nginx_conf_path already defaults to 'conf.d' so there
is no need to make it again.

Change-Id: I2fb8921099706f50243d013a97bd5b54dddaaabd
2022-11-25 14:40:00 +00:00
Dmitriy Rabotyagov b09526d494 Pass CA pass to Swift CLI
Swift requires CA path to be set either with OS_CACERT env var or with
simmilar flag passed to command.

Change-Id: I40e4a0ae0e702fdc9bfbb18dcc6ef1ea3f84926f
2022-11-25 10:56:59 +01:00
Erik Berg b7b167aea0 Remove redundant vars line
This line snuck in with I097989555a5bd3c84a8cbe992ee64f1a3dd956c9
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: Ib4a369bb27e5e0fce47ddb955dab951e6871319a
2022-09-14 12:50:38 +02:00
Jonathan Rosser b4161545b3 Bind http and tftp services to the bmaas network
Currently the ironic role uses ansible_host as the IP to bind these
services to, which means that in an LXC deployment it is not
possible to provision ironic hosts on the bmaas network as
the services are instead bound to the mgmt network.

The code worked previously as it is most likley developed on metal
and the CI job does not actually enrol/provision a node so the
test coverage is very small.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/852174
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/854231
Change-Id: Id544d395f42f4c36a17e9c20a35aeb56a5e3bf03
2022-09-13 07:35:09 +00:00
Jonathan Rosser 8601bbc4a0 Install only the required dhcp config files for inspector
There is a choice of dnsmasq or isc-dhcpd from the role defaults,
only install the config file for the one that is in use.

Change-Id: I2ab5709789582c5de4b703e78c8ddd9672fc5ca8
2022-08-01 14:27:09 +01:00
Zuul 28795b1050 Merge "Update Ironic Inspector for Metal Deployments" 2022-01-20 19:12:18 +00:00
Zuul e091ea8248 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:07:00 +00:00
Jonathan Rosser e74e58c0e2 Use common service setup tasks from a collection rather than in-role
Change-Id: I402a6f894b5b4b582afbd7892bc1e48ea03490ce
2022-01-12 17:57:34 +00:00
Jonathan Rosser bdee06b603 Refactor use of include_vars
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.

This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.

Change-Id: I097989555a5bd3c84a8cbe992ee64f1a3dd956c9
2022-01-12 08:31:22 +00:00
James Denton f7e6cc04cf Update Ironic Inspector for Metal Deployments
This patchset aims to correct some design limitations with the current
ironic-inspector deploy process.

- a new ironic-inspector-dnsmasq service has been created to split
inspector-specific dnsmasq configuration out of the base dnsmasq
config files
- PXE/iPXE and UEFI support for ironic-inspector boot
- (todo) documentation improvements and diagrams

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/823426
Change-Id: Ib5cbb28f97dd7421bfecb815def89305f3b1da33
2022-01-11 19:56:38 +00:00
Zuul fc0df045ef Merge "Add Support for Deploying UEFI Baremetal Nodes" 2021-12-15 12:54:00 +00:00
James Denton 2a24dd59ba Add Support for Deploying UEFI Baremetal Nodes
This patchset adds support for deploying instances using UEFI baremetal
nodes. UEFI may replace Legacy BIOS mode in future Ironic releases. Tested
with Ubuntu Focal 20.04 LTS.

Change-Id: I0fa6234ec7321e1d69901175baeab4ddb08afc50
2021-12-12 14:24:30 +00:00
OpenStack Proposal Bot 8bf07336bc Updated from OpenStack Ansible Tests
Change-Id: Iea19ef0b94e9bb402b1adf2b2a79fb777f5c308a
2021-12-04 17:40:09 +00:00
Zuul 18690acd54 Merge "Use config_template as a collection" 2021-12-02 13:44:23 +00:00
Dmitriy Rabotyagov d446c8a0fb Use config_template as a collection
Since we still use ceph-ansible that has their own implementation of
config_template module it's worth to use mentioned module as a collection
explicitly.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819814
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/820110


Change-Id: I30a19fc655e2b173a9623297a88cd874d800d13e
2021-12-02 04:01:06 +00:00
Dmitriy Rabotyagov 301900f373 Refactor definition of lock path
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819300
Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/819298
Change-Id: I4d2fe4659fed362ab0bb1c179339a623d7ce3e08
2021-11-30 12:14:13 +02:00
OpenStack Proposal Bot 55545c4a51 Updated from OpenStack Ansible Tests
Change-Id: I88a34ccad5b4c070d3e8b487f9c902e5845e1863
2021-04-19 09:58:16 +00:00
Dmitriy Rabotyagov 109698e942 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to replace policy.json to
policy.yaml and remove deprecated policy.json.

config_template has been choosen instead of the copy, since it can
properly handle content that has been lookuped.

We make a separate task not to restart service when it's not needed.

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I701473f4d99e0be06dea494eee4f08212bb7d853
2021-03-24 12:14:22 +00:00
Jonathan Rosser e5920f628e Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: If731b98c03bae2b38eb494c060699abea3cda9e0
2021-03-16 08:04:54 +00:00
Jonathan Rosser a0a07a43ac Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: Ia73e88947f52a74d9c03a17a7b1201a6346b5ac3
2021-03-10 12:16:38 +00:00
Dmitriy Rabotyagov 67733c8f0c Define condition for the first play host one time
We use the same condition, which defines against what host some "service"
tasks should run against, several times. It's hard to keep it the same
across the role and ansible spending additional resources to evaluate
it each time, so it's simpler and better for the maintenance to set
a boolean variable which will say for all tasks, that we want to run
only against signle host, if they should run or not now.

Depends-On: https://review.opendev.org/758953
Change-Id: Iab3194322e133282fcb71830f2b94e1279106ebd
2020-12-02 08:41:27 +00:00
Zuul af9cf08525 Merge "Add iPXE support to Ironic Conductor" 2020-10-26 12:36:22 +00:00
James Denton 8f3a9e207c Add iPXE support to Ironic Conductor
This patchset adds support for iPXE, which can speed up baremetal
provisioning considerably due to the use of HTTP versus TFTP.

Change-Id: I8b49ae37a0380cd7a2191f050a52c85cc373026b
2020-10-22 15:24:19 +00:00
Zuul 09825dc934 Merge "Updated from OpenStack Ansible Tests" 2020-10-21 23:41:51 +00:00
Dmitriy Rabotyagov 1fb838443e Trigger uwsgi restart
When we were migrating service to uwsgi usage, we clean forgot to
trigger uwsgi restart on service config change.

Depends-On: https://review.opendev.org/758953
Change-Id: Iaf42be11b69bd2630c3f2e929ccff8b9ad9f0639
2020-10-21 07:49:16 +00:00
OpenStack Proposal Bot a7f4df532f Updated from OpenStack Ansible Tests
Depends-On: https://review.opendev.org/758953
Change-Id: Ie75b18dd4399030089f8048a53688f5c1d52f35e
2020-10-21 07:31:06 +00:00
Dmitriy Rabotyagov 9a5cbb3dfc Use the utility host for db setup tasks
Move it to the service setup host (defaults to utility[0]) instead
of the galera[0] host, and use galera_address (defaults to internal VIP)
as the endpoint instead of a local connection on the db host.

Change-Id: I87d61c619920a945c7a0b0887e3902f39f2b1b3c
2020-08-20 18:20:08 +03:00
OpenStack Proposal Bot 187b8e5ee6 Updated from OpenStack Ansible Tests
Change-Id: Ib2ae57cc377f14c25c59886933afdd3a69987e5f
2020-08-12 11:33:16 +00:00
Zuul a8dac8d1ed Merge "inspector: fix service catalog creation" 2020-06-18 00:38:06 +00:00
Mohammed Naser eeffeeef04 inspector: fix service catalog creation
The service catalog is not properly created at the moment, this patch
fixes it.

Change-Id: I7439b21247302f2cf1dbe6732c124c3b1d25bb70
2020-06-11 11:18:53 -04:00
OpenStack Proposal Bot f30ce56146 Updated from OpenStack Ansible Tests
Change-Id: I638d85cd3fa96d0e17620295f8f0270baa41cf29
2020-06-08 19:55:05 +00:00
Cameron Loader 1f434661b1 Ironic fixes from inspector addition
1. There was an issue with pip packages not being installed when
inspector_hosts is not defined.

2. The db_setup task failed when inspector_hosts not defined because of
the condition.

Change-Id: I0ccd782ffd54322896559e5a6218ff532f3cae03
2020-02-19 11:31:55 -06:00
Cam Loader 7da7127071 Adds configuration for the Ironic Inspector
This commit enables and configures the Ironic Inspector. This feature
allows for baremetal nodes to be introspected. This provides useful
information about an Ironic host. Such information includes harware
and mac addresses.

Depends-On: https://review.opendev.org/680553
Change-Id: I2ee09d9cc20f9b8e4430c55129cd8bac9435299d
2019-12-06 06:21:05 +00:00
Zuul 1bd52d6a3a Merge "Allow venv python interpreter to be overridden" 2019-09-12 17:32:32 +00:00
Jonathan Rosser e366e4f018 Allow venv python interpreter to be overridden
Change-Id: I3c05c6e96c77f0af4421eebad51df8adc2e4f3dd
2019-09-11 17:58:17 +01:00
Zuul 4a596c6850 Merge "Start using uWSGI role" 2019-09-06 15:54:29 +00:00
Dmitriy Rabotyagov 39dcdeedc8 Start using uWSGI role
Move service to use uWSGI role instead of iternal task for uwsgi
deployment. This aims to ease the maintenance of uWSGI and speedup
metal deployments as the same uwsgi environment will be used
across all services.

Change-Id: Ie79a7ba7d62504e9e81edbb386f8e52ce0a03074
2019-09-04 20:13:20 +03:00
OpenStack Proposal Bot 37c8d659cc Updated from OpenStack Ansible Tests
Change-Id: Icf376172703a3223bdea10d43bb94e6563c500f7
2019-09-04 15:14:42 +00:00