Commit Graph

115 Commits

Author SHA1 Message Date
Dan Prince 5c8456c5cd move ceph-ansible into deployment
Change-Id: I67dc1c2dd7d1e0308db660577f25d74a6305dae6
Related-Blueprint: services-yaml-flattening
2019-03-22 01:01:30 +00:00
fpantano 548f54b39d Added tar option to preserve metadata of existing fetch_dir
Added tar option to allow the current user to unpack local
or downloaded data (from swift) into ceph-ansible/fetch_dir,
preserving the existing metadata.
Added also a "/*" as trailing character on the *path field* of
the *archive* ansible task to create a tar.gz containing all
the fetch_dir content whithout including the parent directory
in the resulting path: in this way we should be able to avoid
nested fetch_dir.

1. Added a step to fix broken environment excluding the nested
fetch_dir from the archive sections;

2. Added a new task to delete from filesystem the nested
section to make everything clean: this task is executed
according to the output of the previous one (the archive task).

Change-Id: I45c394bd6b5c09730399202b476ed913e8f334c0
Related-Bug: 1816094
2019-03-01 13:10:07 +01:00
Giulio Fidente 94e3070641 Restrict use of become to minimum necessary for Ceph deployment
We should avoid use of become: true where unnecessary because
additional files might get created with the wrong permissions.

Change-Id: I4dc71fd23134a9e4a5b2b6e93d2cf45735e71711
Related-Bug: 1813832
2019-02-13 11:38:15 +00:00
Steve Baker 5ceb3c5ec7 Make ceph-ansible working dir owned by tripleo-admin
The ceph-ansible tasks are now invoked with the tripleo-admin user,
which doesn't by default have write access to /var/lib/mistral, but it
does have sudo access.

This change makes /var/lib/mistral/overcloud/ceph-ansible be owned by
the tripleo-admin user so that subsequent tasks can write to that
directory.

Related-Bug: #1813832
Change-Id: I98bb38078be84cbda3e9a9e338af0d054dc53420
2019-02-12 09:13:15 +05:30
Giulio Fidente ad803ab716 Sanitize the uuid string for ceph-ansible
dmidecode can return some additional data if SMBIOS is updated; this
ensures output matches the UUID format.

Change-Id: I5c61c0049bfd16114894cf4db3b79f94b6d9291b
Related-Bug: 1762460
2019-02-08 13:18:46 +00:00
Giulio Fidente c01d9d8475 Handle case change for dmidecode >= 3.1 in Ceph templates
Forces lowercase matching of user provided node data with dmidecode
output.

Change-Id: I844a2f7660dff5feda8397706671ac0efd37949f
Co-Authored-By: Francesco Pantano <fpantano@redhat.com>
Closes-Bug: 1814070
2019-02-05 16:51:25 +00:00
John Fulton fe2fda491b Change NodeDataLookup type from string to json
The NodeDataLookup parameter should be valid JSON and we should
help the user by adding type checking for this early in the
deployment so that the user doesn't experience the related bug.

Change-Id: Id9d2208f1cbaba9234d7657420cd7efcad3507a0
Related-Bug: #1784967
Related-Bug: #1814070
2019-02-05 11:53:45 +00:00
John Fulton 8f297c22e7 Make ceph-ansible integration respect PythonInterpreter
PythonInterpreter defaults to /usr/bin/python. If a user overrides
this default, e.g. to something like python3, then we should use it.
Modify ceph-base.yml to use the PythonInterpreter parameter. The
variable will already be set to ansible_python_interpreter by the
calling ansible execution.

Change-Id: If599855c00d0ab8861ea7f873d410f9a880d35be
Closes-Bug: #1811974
2019-01-16 14:20:42 +00:00
Zuul 8f4a2607d8 Merge "Make NetCidrMapValue contain list of cidrs in each net" 2019-01-09 20:02:14 +00:00
Tony Breeds f9b5401c1f Do not dereference .stdout if dmidecode is missing
In 459b2664d9 (Handle missing or bad
dmidecode) we accept return values of 0, 1 or 2 from command modules
that call 'dmidecode'.  However we then unconditionally look at the
stdout key in the result object.  When the dmidecode binary is missing
the result dictionary from the command module doesn't contain a stdout
key (resulting in something like):

---
fatal: [overcloud-novacomputeppc64le-1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/var/lib/mistral/overcloud/ceph-ansible/nodes_uuid_playbook.yml': line 14, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      failed_when: machine_uuid.rc not in [0, 1, 2]\n    - name: generate host vars from nodes data\n      ^ here\n"}
---

This change just adds a default('') filter to the lookup so a missing
key will fallback to an empty dictionary

Closes-Bug: 1790447
Change-Id: I7db180674c3696508a7f449e2e825e7083a00f6e
2019-01-09 00:21:22 +11:00
Harald Jensås 8665a0d97b Make NetCidrMapValue contain list of cidrs in each net
Prior to routed networks we only had one subnet per network.
With routed networks each network can have multiple subnets.
The NetCidrMapValue should contain a list storing the cidr
of each subnet for each network.

Ceph:
  list_join is used to make a comma separated list of
  cidrs for public_network, monitor_address_block,
  cluster_network and radosgw_address_block.

Partial: blueprint tripleo-routed-networks-templates
Depends-On: Ia8e219b30d4f8b199b882e95fe2834252a92c15a
Depends-On: I1ace0a02e6aa2610559fee0d8576e6f1bc98d699
Change-Id: I68e064d23ec5d43f59146d974cae604d2c5fdb52
2019-01-06 18:20:27 +01:00
Emilien Macchi 89f276cdab ceph: allow curl tasks to run in dry run mode
When running dry-run, --check option is used with Ansible CLI which
means the shell command don't actually run so the curl isn't producting
any change. This patch fixes the tasks that relied on the curl outputs
to only run these tasks when the curl changed and produced something.

Change-Id: I5b722ac111db0a1b6272a95496251107e23dd764
Closes-Bug: #1803986
2018-11-19 09:39:54 -05:00
John Fulton 7f6f64b8be Autocreate CephAnsibleFetchDirectoryBackup
Originally the playbook failed to make user aware that they need
to create the CephAnsibleFetchDirectoryBackup. However, if they
specified the path, then they should know about the directory.
Autocreate it so that the user only needs to specify a path.

Change-Id: I06eca1cf8987c9366492973cbe861e1a6b47f744
2018-11-15 17:26:27 -05:00
Alan Bishop 2af5dd6fca Fix whitespace around "ansible_connection: local"
Small follow-up fix to the original patch [1].

[1] https://review.openstack.org/613793

Related-Bug: #1800148
Change-Id: I8db6dc3b3beaeb1b6582a7ab086d3942eb03dfc4
2018-11-02 13:08:14 -04:00
John Fulton b201df7257 Add additional whitespace around "ansible_connection: local"
The jinja2 condition to look for "ansible_connection: local"
did not contain enough whitespace and resulted in an invalid
Ansible inventory. This patch adds the missing whitespace by
indenting the condition.

Change-Id: Ia114edafe6f1b37d6e6d47af146ab35adeb79efd
Closes-Bug: #1800148
2018-10-31 11:19:05 -04:00
Giulio Fidente 5bcfb71146 Skip hosts group in ceph-ansible inventory when all are blacklisted
Ensures the hosts group is not created in the ceph-ansible inventory
if all nodes of a given group are blacklisted.

Closes-Bug: 1798044
Change-Id: Ibf25e28d02cee6308f3e9a2660e001ba73d756c0
2018-10-24 22:13:33 +00:00
Zuul a6cf9b8b14 Merge "Improve support for deploying ceph on standalone system" 2018-10-18 07:24:03 +00:00
Zuul 94943cfff9 Merge "Introduce proper steps to external update/upgrade tasks" 2018-10-17 15:03:47 +00:00
Alan Bishop 3f5ed998eb Improve support for deploying ceph on standalone system
The standalone deployer adds "ansible_connection: local" to facilitate
all-in-one deployments. This patch passes on this setting when generating
the inventory used by ceph-ansible.

Change-Id: I694c4b3c7fb98e11d7a52eed4072a37471c0e405
2018-10-11 17:13:04 -04:00
John Fulton d556fd68d8 Do not reference ansible_hostname if it is undefined
Change-Id: I59c3de74c41b97ed1803d82c69db52199f27393e
Closes-Bug: #1797117
2018-10-10 15:18:32 +02:00
Jiri Stransky bcd6cde608 Introduce proper steps to external update/upgrade tasks
So far the tasks for external update/upgrade were not using the step
mechanism as other tasks, we had a single step. As external
deploy/update/upgrade tasks are being used for more things nowadays,
it's likely that we'll need to go towards a similar model like we have
for deploy/update/upgrade tasks -- proper usage of steps.

For now we have just 2:

* Step 0 for setting global facts, and performing validations.

* Step 1 for actual update/upgrade tasks. (There's an upcoming change
  to run online data migrations in step 1).

Change-Id: I1933bd0eedab71caab56c0e5d93ba7927fb7c20f
Partial-Bug: #1793332
2018-10-04 12:08:21 +02:00
Jiri Stransky a0ead2f1a7 Chunk up ceph-ansible output to prevent clogging the CLI
The CLI commands running Ansible can crash if we send too much
single-line log output their way. This was happening on upgrades, when
we run Ansible with verbosity level 1.

The fix is twofold:

* If ceph-ansible finishes successfully, we don't print the
  ceph-ansible output into the main log.

* If ceph-ansible fails, we do print the output, but we print it
  line-by-line, which should give us much better readability than
  before, and we shouldn't break the limits of the Mistral-Zaqar-CLI
  message passing.

Change-Id: I6e0fc36749e74fce25f414c2547e49e2a20437ab
Closes-Bug: #1795689
2018-10-03 11:21:34 +02:00
Zuul dc2f4e7556 Merge "Persist ceph-ansible fetch_directory using config-download" 2018-10-03 01:42:50 +00:00
Zuul 6799cc0363 Merge "Handle missing or bad dmidecode" 2018-09-27 04:34:04 +00:00
Giulio Fidente e0b52904c0 Stop cap granting to empty pool when telemetry disabled
Attempt to not create GnocchiRbdPool pool when it is set to empty
string [1] resulted in related bug which was not resolved by
originally proposed fix [2].

1. https://review.openstack.org/#/c/575571
2. https://review.openstack.org/#/c/570043

Change-Id: Ie7a42822be89cced480302d40180b9972d191004
Closes-Bug: 1776987
2018-09-20 14:33:25 +02:00
Tony Breeds 459b2664d9 Handle missing or bad dmidecode
dmidecode isn't functional on all architectures.  Don't treat a missing
binary or a missing DMI table as fatal from an install POV.

Change-Id: I33c50ee00ac0b478839b2536f0b965e444e66e53
Related-Bug: 1790447
2018-09-11 14:48:48 +10:00
John Fulton 7fc83987dc Persist ceph-ansible fetch_directory using config-download
When scaling ceph monitors, ceph-ansible uses context from the
fetch_directory to prevent new monitors from behaving like they
are the only monitors.

Save the fetch_directory after each ceph-ansible playbook run;
and if there is a previously saved fetch directory, restore it
before each playbook run.

Fetch directory can be saved on the undercloud in Swift or if
the new LocalCephAnsibleFetchDirectoryBackup parameter is passed
then it will be saved in a directory local to the undercloud
instead.

Note that https://review.openstack.org/#/c/567782 only resolves
1769769 for Queens/Pike where Mistral runs ceph-ansible. This
change resolves 1769769 when using config-download.

Change-Id: I0591be8419828cc32f976afce8be1b787b783c23
Depends-On: Icce658f803a608ee4b7df34b0b8297ecabcdb0ee
Related-Bug: #1769769
2018-09-09 17:06:56 +00:00
Jiri Stransky 4504aadef6 Allow performing Ceph update/upgrade separately
Running `openstack overcloud external-update run` will update all
external services. This commit adds possibility of running `openstack
overcloud external-update run --tags ceph` to specifically update just
Ceph. It works analogically for upgrades.

Change-Id: Ic1786b6dbfa54516bfb836b450fc35452dca8cb5
Partial-Bug: #1783949
2018-08-02 15:04:22 +02:00
Jiri Stransky 20f614ba9a Ceph update and upgrade in config-download era
Correct playbook selection is now done automatically using
external_update_tasks and external_upgrade_tasks. The
CephAnsiblePlaybook is still usable and highest priority if set to
something else than the default. It can also be set to [] to
completely skip ceph-ansible playbook execution.

Closes-Bug: #1783949
Change-Id: If7955b31eda432dd61331281ad3d8f25a335fdfe
Depends-On: Ifdf5f1175849f79b98c76b4bcdef2a70f8f1fedb
2018-08-02 15:04:22 +02:00
Giulio Fidente 787e7910a8 Fix parameter name used to create the Manila CephX keyring
We obsoleted the CephFS native parameter but missed to update it
in the Ceph profile.

Change-Id: I12a91da7df6079d391fa9583c4f2c926d123044f
Closes-Bug: #1783341
2018-07-30 12:05:48 +00:00
Zuul e87fcba49d Merge "Use global ansible.cfg for nodes-uuid playbook" 2018-07-27 03:24:46 +00:00
Zuul db72fcd2e4 Merge "Remove unecessary back-slashes in CephManilaClientKey caps mon" 2018-07-25 03:25:24 +00:00
Giulio Fidente 694ac8ce46 Use global ansible.cfg for nodes-uuid playbook
Previously we tried setting from within the Ceph service some Ansible
settings before launching the nodes-uuid playbook; we should instead
just point to the global ansible.cfg file.

Also includes setting environment variables not in the ansible.cfg.

Co-Authored-By: John Fulton <fulton@redhat.com>
Closes-Bug: #1782423
Change-Id: Id220ebba5d9881eae943c7459b2328d3384b7370
2018-07-19 18:01:43 +02:00
Zuul c07fd369d1 Merge "Add support for NodeDataLookup for Ceph deployment" 2018-07-05 07:19:41 +00:00
Giulio Fidente 9746e2f9bb Do not grant caps if pool name is empty
The openstack_keys map can have permissions for an empty pool
which results in an invalid kerying.

Co-Authored-By: Giulio Fidente <gfidente@redhat.com>
Change-Id: Ic5ae53d9ab52ea5e7c3f75a240a7a7f4bb5632ba
Closes-Bug: 1776987
2018-06-27 09:51:16 +00:00
Giulio Fidente a2e6f92d47 Add support for NodeDataLookup for Ceph deployment
Restores compatibility with NodeDataLookup parameter for the
deployment of Ceph via config-download.

Change-Id: I06764271adb73ba73e15e3f7d8d553532db727ef
Closes-Bug: 1778617
2018-06-26 16:13:01 +02:00
John Fulton 0c7e7454ea Remove unecessary back-slashes in CephManilaClientKey caps mon
Within the double-quoted capability string replace back-slashed
double quotes with single quotes.

Change-Id: Iff6e8f52c28a2de826e1582775727df85384b696
Closes-Bug: #1777249
2018-06-16 14:51:47 +00:00
Giulio Fidente e65889dff2 Update CephX client.openstack keyring to use 'profile rbd'
The minimum set of permissions necessary to operate on the Ceph
pools changed with Luminous and the 'profile rbd' setting ensures
the necessary additional operations are granted. See Luminous [1]
vs Jewel [2] settings.

Closes-Bug: 1773449

1. http://docs.ceph.com/docs/luminous/rbd/rbd-openstack/#setup-ceph-client-authentication
2. http://docs.ceph.com/docs/jewel/rbd/rbd-openstack/#setup-ceph-client-authentication

Change-Id: I9639d606bd538f6776c368a4f34aa6783ab91abb
2018-06-15 17:40:30 +02:00
Zuul b7dcbd8da7 Merge "Set Ceph pools rule_name to replicated_rule" 2018-06-15 12:03:25 +00:00
Giulio Fidente c0fc85f306 Uses new format for CephX keys caps
Updates the format of the CephX keys caps to a new one which
does not need backward compatibility in ceph-ansible

Change-Id: Icd36ac32ec0ed708e66fe638bcbf54cee2d1ae69
2018-06-12 10:58:32 +02:00
Giulio Fidente dcf558628f Set Ceph pools rule_name to replicated_rule
By setting the value of rule_name explicitly, we prevent backward
incompatibility issues because the default which ceph-ansible uses
might fit a particular version of Ceph, not all.

Change-Id: I275c1ca53ea79eea607cbbb58aa21cae6d6be80b
Closes-Bug: 1776252
2018-06-11 18:57:02 +02:00
John Fulton 959cb6c539 Set default application for Ceph Luminous openstack_pools
Luminous can assign application types to pools and ceph-ansible
supports this, provided it is passed an appropriate list of maps.
The list of maps is defined in openstack_pools and this change
updates this variable to contain the correct default application
type.

Includes update to environments/disable-telemetry.yaml so that
the GnocchiRbdPool is not created if telemetry is disabled.

Change-Id: I3966a8a1b170202e020684a36ecece78599296b5
Closes-Bug: #1772743
2018-05-24 18:08:16 +00:00
Carlos Camacho 44ef2a3ec1 Change template names to rocky
The new master branch should point now to rocky.

So, HOT templates should specify that they might contain features
for rocky release [1]

Also, this submission updates the yaml validation to use only latest
heat_version alias. There are cases in which we will need to set
the version for specific templates i.e. mixed versions, so there
is added a variable to assign specific templates to specific heat_version
aliases, avoiding the introductions of error by bulk replacing the
the old version in new releases.

[1]: https://docs.openstack.org/heat/latest/template_guide/hot_spec.html#rocky
Change-Id: Ib17526d9cc453516d99d4659ee5fa51a5aa7fb4b
2018-05-09 08:28:42 +02:00
Giulio Fidente 1dedf30fdd Do not overescape the Manila keyring caps
Recent changes [1] [2] in ceph-ansible break old way of escaping
quotes in the Manila keyring caps.

1. 82ccbdafbc
2. 424815501a

Change-Id: I7ff5df0e602aff000c9a4213231b7abc68871fc4
Closes-Bug: 1769436
2018-05-07 19:40:51 +00:00
John Fulton cf8c443ffb Execute ceph-ansible with its own ansible.cfg
Modify the ceph-ansible execution so that it uses the ansible.cfg
that is shipped with ceph-ansible. ceph-ansible's own testing uses
this file and the project's maintainers recommend it be used.

This configuration file also uses ControlMaster=auto which is not
used by config download at this time. Adding this setting to the
ceph-ansible execution should make it take less time.

Change-Id: I774132eb8b7a43c921c0696635d56b4136301346
Closes-Bug: 1767252
2018-04-27 12:27:47 -04:00
Zuul 1e55a35f47 Merge "Do not pass ceph_release to ceph-ansible" 2018-04-25 18:22:58 +00:00
Giulio Fidente 2905293097 Do not pass ceph_release to ceph-ansible
Hardcoding the Ceph version to use in the templates causes issues in
some generic tasks during upgrade, when the cluster has nodes in
mixed state.

Closes-Bug: 1766502
Change-Id: I20bfd46c1db41e2d2ebd3f810591cabf27f2e664
2018-04-24 07:34:09 +00:00
Giulio Fidente 5a4abeeeb9 Deprecate support for workflow_tasks in Ceph services.
With the migration to external_deploy_tasks, we can remove support
for workflow_tasks in the Ceph services.

Change-Id: Ib7851e02424d4adb1490e8ed36327dc4a573c44f
2018-04-20 12:10:57 +02:00
Giulio Fidente 40eee6a4dc Migrate Ceph deployment to external_deploy_task
Uses external_deploy_tasks instead of workflow_tasks for the
deployment of Ceph, via ceph-ansible.

Initially, external_deploy_tasks are added alongside workflow_tasks so
that CI will pass. Once CI is updated to use config-download for these
jobs, we will remove the workflow_tasks.

Co-Authored-By: James Slagle <jslagle@redhat.com>
Co-Authored-By: John Fulton <fulton@redhat.com>
Implements: blueprint ceph-ansible-external-deploy-tasks
Change-Id: I4b88e97c38ff394023a92bec5631b3cd0f6e293e
2018-04-16 17:54:44 -04:00
Giulio Fidente 3acf7e4cfd Remove hiera interpolation from ceph-ansible parameters
We can't interpolate hiera parameters when setting values
for the ceph-ansible parameters.

Change-Id: I647497a593acd8628a2b0f439d8b5380ba8705aa
2018-03-16 15:41:21 +01:00