Commit Graph

6014 Commits (efa91ad8896c5e2fabc8ddf94a95baee1801b425)
 

Author SHA1 Message Date
Guillaume Abrioux 5ffcf30954 facts: fix set_radosgw_address.yml
use `include_tasks` instead of `import_tasks`.
Given that with `import_tasks` statements are preprocessed
and the tasks that defines it hasn't been run yet, it will fail
and complain like following:

```
The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute '_interface'
```

Using `include_tasks` instead fixes this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 434793e2fe)
2022-07-06 02:05:27 +02:00
Guillaume Abrioux 5847fc5366 facts: fix deployments with different net interface names
Deployments when radosgws don't have the same names for
network interface.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f6b49f78a9)
2022-07-06 02:05:27 +02:00
Guillaume Abrioux 42bd198a91 backup-and-restore: various fixes
- preserve mode and ownership on main directories
- make sure the directories are well present prior to restoring files.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 047af3a3f6)
2022-07-05 14:45:56 +02:00
Guillaume Abrioux 42b2952b32 tests: add yes_i_know=true in tox-shrink_osd.ini
main branch requires it. Otherwise the playbook won't run.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e223630cf0)
2022-07-05 10:32:27 +02:00
Guillaume Abrioux 23dc2cc143 tests: drop shrink_osd from tox.ini
shrink_osd has its own tox config file (tox-shrink_osd.ini)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 6623f34679)
2022-07-05 10:32:27 +02:00
Guillaume Abrioux 800da79617 Revert "upgrade: block upgrade when rgw multisite is active"
This reverts commit 51bc8cb636.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 7d848fa19e)
2022-07-03 07:28:01 +02:00
Guillaume Abrioux ebf35fd191 common: fix a typo
s/of/or ..

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2099828#c25

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 2e823b117e)
2022-07-03 07:27:33 +02:00
Guillaume Abrioux 220a4a1369 backup-and-restore: fix check on 'target_node' variable
If the user doesn't pass a valid name (present in the inventory)
the playbook will fail like following:

```
fatal: [localhost -> {{ target_node }}]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: "hostvars['10.70.46.40']" is undefined
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit b18a1aa3ca)
2022-06-29 09:09:06 +02:00
Guillaume Abrioux 9965bf6cd6 backup-and-restore: fix check on 'mode' variable
Typical failure:

```
fatal: [localhost]: FAILED! =>
  msg: |-
    The conditional check 'mode not in ['backup', 'restore']' failed. The error was: error while evaluating conditional (mode not in ['backup', 'restore']): 'mode' is undefined
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 848dd03fa6)
2022-06-29 08:52:27 +02:00
Guillaume Abrioux 4156fd569f nfs: use repo from SIG
RPMs for nfs-ganesha aren't hosted anymore at https://download.ceph.com

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 19fedfbac5)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 3ad0d95643 handler: update path of pidfile for ganesha
default path has moved from `/var/run/ganesha.pid` to
`/var/run/ganesha/ganesha.pid`.

This updates the restart script accordingly.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 3614bcacff Revert "tests: temporarily disable nfs-ganesha"
This reverts commit 3f923d69ac.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 6615d97015 backup-and-restore: fix a typo
Typo introduced during initial implementation.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e28c486e52)
2022-06-22 07:17:32 +02:00
Michael Wagner a67defec2f fix(ceph-grafana): make dashboard download work again
This fixes the dashboard download for pacific and later.

Signed-off-by: Michael Wagner <mitch.wagna@gmail.com>
(cherry picked from commit 4edaab5f4c)
2022-06-22 07:17:32 +02:00
Seena Fallah 7eba726958 ceph_pool: set target size ratio on both 'on' and 'warn' mode
when we set target_size_ratio to warn it means that the administrator wants to get suggestion from the mgr module but apply it manually when he/she wants. So it's in the same approach as 'on' mode just triggered by hand.
So there is no need to set pg_num when target_size_ratio is 'warn' and the mgr module will calculate the correct pg_num and the administrator will adjust it whenever he/she wants.

It is the same approach that was in #6471

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit bb849a5586)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux fd2279e75d cephadm_adopt: set autotune_memory_target_ratio
This adds a task that sets `autotune_memory_target_ratio` depending on the
value of `is_hci`.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 41d62596fc)
2022-06-22 07:17:32 +02:00
Francesco Pantano abfb5385c1 Add ceph_infra tag to rolling_update
When the upgrade from Ceph 4 to 5 is performed in the OpenStack context,
ceph-ansible triggers the rolling_update playbook, which is supposed to
rollout new Ceph containers.  The ceph-infra role tries to take care
about firewall, ntp config and logrotate; however, TripleO manages them
through tripleo-heat-templates.  This patch just add an additional tag
to skip the ceph-infra role in the OpenStack context.

Closes: https://bugzilla.redhat.com/2090456
Signed-off-by: Francesco Pantano <fpantano@redhat.com>
(cherry picked from commit 0e9b3902b0)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 4dd57379bb purge: reset-failed ceph-crash
This ensures we always reset-failed the ceph-crash service.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 5ab46f836d)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux eadb33acdb common: config rhcs tools repo on all nodes
Otherwise `cephadm` can't be installed during cephadm-adopt.yml
playbook execution.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 1e11f879f6)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux aaf3dff30c cephadm-adopt: remove legacy directory after adoption
When this directory is left after the osd adoption, it leads to the following error:

```
[WRN] CEPHADM_REFRESH_FAILED: failed to probe daemons or devices
    host axdesec2ocs1n002.ecommerce.inditex.grp `cephadm ceph-volume` failed: cephadm exited with an error code: 1, stderr:Inferring config /var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config
ERROR: [Errno 2] No such file or directory: '/var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config'.
```

this is because of an unexpected behavior regarding 'config inferring' when a legacy directory is present in /var/lib/ceph.

Note: this doesn't fix the root cause, this is a workaround.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 6e2ebe857d)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 57fb213f29 contrib: add a playbook
this playbook can backup or restore some ceph files.
(/etc/ceph, /var/lib/ceph, ...)

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ed0bba4d77)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux b75a00207a tests: update vagrant_box default value
This updates the default value for the vagrant_box variable
in all vagrant_variables.yml files

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ef0455a0b1)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 63b3dadfbf common: move to `ansible.utils.ipwrap`
ipwrap has moved to ansible.utils

see
db4920ebf6

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit c1649862a9)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux c0aa42742a tests: use latest version for pytest
with the bump of py version, let's use newer version for pytest.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit dee49779c9)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux 46e719fda3 workflows: drop py36, py37 from pytest
no need to have a such matrix, let's test against py38 only.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-06-22 07:17:32 +02:00
Guillaume Abrioux ef4991910d ansible: bump to ansible 2.12
Add required changes to support ansible 2.12

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit aa68b06c99)
2022-06-22 07:17:32 +02:00
Guillaume Abrioux c698859617 stable-7.0: support Ceph Quincy
This adds required changes in order to support Ceph Quincy
with `stable-7.0` branch.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-06-22 07:17:32 +02:00
David Galloway 1c740c424a tests/setup: Use local mirror of centos 8 stream repo
The mirrors provided by CentOS' mirrorlists are super slow

Signed-off-by: David Galloway <dgallowa@redhat.com>
2022-04-21 11:43:39 +02:00
Ingo Ebel c5bb450f87 added AlmaLinux and Rocky for iscsi deploy
Signed-off-by: Ingo Ebel <ingo.ebel@desy.de>
2022-04-14 00:35:48 +02:00
Guillaume Abrioux 0f34cd16d8 dashboard: allow collecting stats from the host
This commit makes podman bindmount `/:/rootfs:ro` so the container can
collect data from the host.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-04-13 20:35:01 +02:00
pinotelio f288364c5c ceph-facts: fix ansible templating error for auto osd discovery
This commit fixes templating error that occurs when using auto osd discovery. Getting the len before converting the result to a list causes "object of type generator has no len()" error.

Signed-off-by: pinotelio <ahmadreza.mollapour@gmail.com>
2022-04-13 14:26:35 +02:00
Guillaume Abrioux 1cd1fa0560 validate: drop a check
Since the ISO install method removal, ceph-ansible isn't able
to detect wheter the user is deploying in a 'disconnected environment'.
By the way, given that ceph-ansible is available only for upgrading to RHCS 5,
this check doesn't make sense anymore, let's drop it.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-04-07 13:49:51 +02:00
insatomcat 58fdc03e63 do not update Debian cache when package-install is disabled
When deploying with --skip-tags=package-install (when there is no access to a repository), the playbook is still trying to update the package cache, which makes the playbook fail.
This change prevents the playbook to try to update the cache when the package-install tag is skipped.

Signed-off-by: Florent CARLI <florent.carli@rte-france.com>
2022-03-31 15:28:44 +02:00
Guillaume Abrioux 72e4654aae dashboard: always set `dashboard_server_addr`
When running the playbook with `--limit`, if the play targeted doesn't match
hosts present in the mgr group the playbook can fail.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-03-25 22:36:23 +01:00
Teoman ONAY f851d3232c Using another user than root for cephadm ssh connections fails
Fixes commit da42f3d139

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

Signed-off-by: Teoman ONAY <tonay@redhat.com>
2022-03-20 12:51:16 +01:00
Guillaume Abrioux 3e87df5e8f tests: update the system before deploying
Having a system up-to-date is usually a good idea.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-03-20 08:13:38 +01:00
Guillaume Abrioux 51bc8cb636 upgrade: block upgrade when rgw multisite is active
With this commit, upgrading a cluster from Nautilus to Pacific with
active rgw multisite replication will be blocked.
This is because a lot of bugs are currently present in Pacific regarding
RGW multisite.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-03-20 08:13:38 +01:00
Teoman ONAY 7e8ce2567e Turn off SELinux separation for containers MON and RGW
Initially MONs and RGW binded /etc/pki/ca-trust/extracted using the :z flag
(introduced to solve an OSP TripleO issue on RHEL - #3638) but using
this flag prevents local services (like sssd) running on the host from accessing
the certificates/files in that folder.

Signed-off-by: Teoman ONAY <tonay@redhat.com>
2022-03-08 14:45:45 +01:00
Guillaume Abrioux 266b6e739c adopt: fix node labelling
When using group of group, the playbook will apply undesired
labels on nodes.
This commit fixes it by applying only the expected labels.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-03-03 15:52:00 +01:00
Teoman ONAY f8c6bba657 Add cluster custom name support
When using cluster custom names, cephadm commands are executed using
the default admin keyring name which fails.

Signed-off-by: Teoman ONAY <tonay@redhat.com>
2022-03-03 15:52:00 +01:00
Teoman ONAY da42f3d139 Enable user to change the account used for ssh connection
By default cephadm uses root account to connect remotely
to other nodes in the cluster. This change allows to choose
another account.
This commit also allows to use a dedicated subnet for cephadm mgmt.

Signed-off-by: Teoman ONAY <tonay@redhat.com>
2022-03-03 15:52:00 +01:00
Guillaume Abrioux 2f11982590 purge: ceph-crash purge fixes
This fixes the service file removal and makes the playbook
call `systemctl reset-failed` on the service because in Ceph
Nautilus, ceph-crash doesn't handle `SIGTERM` signal.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-03-02 10:08:35 +01:00
Guillaume Abrioux f08129edf2 switch2containers: fail if less than 3 monitors
This playbook doesn't support less than 3 monitors present in the inventory.
Just like the rolling_update playbook, let's fail if less than
3 monitors are present.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-02-21 21:07:27 +01:00
Seena Fallah 9d87fd87cb ceph-facts: ignore mounted disks on osd auto discovery
Ignore disks with active mountpoint when osd_auto_discovery is true

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2022-02-21 17:15:30 +01:00
Mathias Chapelain 6c0c53fa2d tests/library: Add radosgw_caps tests
Provide basic tests for `radosgw_caps` module.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-16 09:44:36 +01:00
Mathias Chapelain 65003f4ff9 library: Add radosgw_caps to manage capabilities
This commit add `radosgw_caps` module to be able to manage RadosGW users
capabilities.

Usage from module's documentation:
```YAML
- name: add users read write and all buckets capabilities
  radosgw_caps:
    name: foo
    state: present
    caps:
      - users=read,write
      - buckets=*
- name: remove usage write capabilities
  radosgw_caps:
    name: foo
    state: absent
    caps:
      - usage=write
```

This module support check mode by simulating the original `radosgw-admin`
behavior when adding capabilities.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-16 09:44:36 +01:00
Mathias Chapelain 055326be7c module_utils/ca_common: Add optional diff argument to exit_module
Add optional `diff` argument defaulting to `{ "before": "", "after": ""}`.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-16 09:44:36 +01:00
Guillaume Abrioux 3e5bc30c87 rpm: fix packaging
This fixes a couple of issues:

- ansible 2.10 isn't packaged.
- MOCK_CONFIG variable is wrong (centos 8 is EOL)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-02-15 17:37:22 +01:00
Joel Capitao 78c56f1c5f Update EPEL mock config
CL8 is EOL since 31st January 2022 [1].
So the EPEL mock config needs to be switched to
new one supported [2][3].

[1] https://www.centos.org/centos-linux-eol/
[2] https://pagure.io/epel/issue/133
[3] https://github.com/rpm-software-management/mock/pull/817

Signed-off-by: Joel Capitao <jcapitao@redhat.com>
2022-02-15 16:39:17 +01:00
Mathias Chapelain f0f1dd986a library/ceph_pool: Fix potential null value when creating pools
Before, creating a pool by providing *only* `pg_num` would result in an
error as it would produce `--pgp-num null`.

This commit fix this behavior by defaulting `pgp_num` value to `pg_num`.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-15 15:54:07 +01:00