ceph-ansible/infrastructure-playbooks
Guillaume Abrioux 7d0e072da4 purge_cluster: fix bug when building device list
there is some leftover on devices when purging osds because of a invalid
device list construction.

typical error:
```
changed: [osd3] => (item=/dev/sda sda1) => {
    "changed": true,
    "cmd": "# if the disk passed is a raw device AND the boot system disk\n if parted -s \"/dev/sda sda1\" print | grep -sq boot; then\n echo \"Looks like /dev/sda sda1 has a boot partition,\"\n echo \"if you want to delete specific partitions point to the partition instead of the raw device\"\n echo \"Do not use your system disk!\"\n exit 1\n fi\n echo sgdisk -Z \"/dev/sda sda1\"\n echo dd if=/dev/zero of=\"/dev/sda sda1\" bs=1M count=200\n echo udevadm settle --timeout=600",
    "delta": "0:00:00.015188",
    "end": "2018-05-16 12:41:40.408597",
    "item": "/dev/sda sda1",
    "rc": 0,
    "start": "2018-05-16 12:41:40.393409"
}

STDOUT:

sgdisk -Z /dev/sda sda1
dd if=/dev/zero of=/dev/sda sda1 bs=1M count=200
udevadm settle --timeout=600

STDERR:

Error: Could not stat device /dev/sda sda1 - No such file or directory.
```

the devices list in the task `resolve parent device` isn't built
properly because the command used to resolve the parent device doesn't
return the expected output

eg:

```
changed: [osd3] => (item=/dev/sda1) => {
    "changed": true,
    "cmd": "echo /dev/$(lsblk -no pkname \"/dev/sda1\")",
    "delta": "0:00:00.013634",
    "end": "2018-05-16 12:41:09.068166",
    "item": "/dev/sda1",
    "rc": 0,
    "start": "2018-05-16 12:41:09.054532"
}

STDOUT:

/dev/sda sda1
```

For instance, it will result with a devices list like:
`['/dev/sda sda1', '/dev/sdb', '/dev/sdc sdc1']`
where we expect to have:
`['/dev/sda', '/dev/sdb', '/dev/sdc']`

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1492242

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 9cad113e2f)
2018-05-22 16:44:06 +02:00
..
untested-by-ci syntax: change local_action syntax 2018-01-31 10:45:34 +01:00
README.md rolling_update: fix wrong indent 2016-10-26 12:51:08 -05:00
ansible.cfg Cleanup plugins directories and references 2018-03-14 11:15:39 +01:00
ceph-keys.yml mon/client: remove acl code 2018-04-23 18:34:58 +02:00
osd-configure.yml infrastructure-playbooks: update with ceph-defaults roles 2017-08-02 17:12:20 +02:00
purge-cluster.yml purge_cluster: fix bug when building device list 2018-05-22 16:44:06 +02:00
purge-docker-cluster.yml purge-docker: added conditionals needed to successfully re-run purge 2018-04-10 13:39:14 +02:00
purge-iscsi-gateways.yml purge-iscsi: fix group name 2017-10-11 12:52:12 +02:00
rgw-standalone.yml infrastructure-playbooks: update with ceph-defaults roles 2017-08-02 17:12:20 +02:00
rolling_update.yml rolling_update: move osd flag section 2018-05-17 11:54:12 +02:00
shrink-mon.yml shrink-mon: fix typo in the code doc 2017-10-27 11:59:22 +02:00
shrink-osd.yml shrink-osd: ability to shrink NVMe drives 2018-04-20 15:08:29 +02:00
switch-from-non-containerized-to-containerized-ceph-daemons.yml switch: fix ceph_uid fact for osd 2018-04-30 08:15:18 +02:00
take-over-existing-cluster.yml take-over: fix bug when trying to override variable 2018-05-18 11:21:33 +02:00

README.md

Infrastructure playbooks

This directory contains a variety of playbooks that can be used independently of the Ceph roles we have. They aim to perform infrastructure related tasks that would help use managing a Ceph cluster or performing certain operational tasks.

To use them, you must move them to ceph-ansible's root directory, then run using ansible-playbook <playbook>.