]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
6 years agoupdate: fix a typo
Guillaume Abrioux [Mon, 26 Nov 2018 13:10:19 +0000 (14:10 +0100)]
update: fix a typo

`hostvars[groups[mon_host]]['ansible_hostname']` seems to be a typo.
That should be `hostvars[mon_host]['ansible_hostname']`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: do not fully override previous ceph_conf_overrides
Guillaume Abrioux [Thu, 22 Nov 2018 10:33:20 +0000 (11:33 +0100)]
tests: do not fully override previous ceph_conf_overrides

We run an initial deployment with `osd_pool_default_size: 1` in
`ceph_conf_overrides`.
When re-running the playbook to test idempotency and handlers, we reset
`ceph_conf_overrides`, we must append a new value instead of just
overwritting it, otherwise, this can lead to error in the CI.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorolling_update: refact set_fact `mon_host`
Guillaume Abrioux [Thu, 22 Nov 2018 16:52:58 +0000 (17:52 +0100)]
rolling_update: refact set_fact `mon_host`

each monitor node should select another monitor which isn't itself.
Otherwise, one node in the monitor group won't set this fact and causes
failure.

Typical error:
```
TASK [create potentially missing keys (rbd and rbd-mirror) when mon is containerized] ***
task path: /home/jenkins-build/build/workspace/ceph-ansible-prs-dev-update_docker_cluster/rolling_update.yml:200
Thursday 22 November 2018  14:02:30 +0000 (0:00:07.493)       0:02:50.005 *****
fatal: [mon1]: FAILED! => {}

MSG:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute u'mon2'
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorolling_update: create rbd and rbd-mirror keyrings
Sébastien Han [Wed, 21 Nov 2018 15:18:58 +0000 (16:18 +0100)]
rolling_update: create rbd and rbd-mirror keyrings

During an upgrade ceph won't create keys that were not existing on the
previous version. So after the upgrade of let's Jewel to Luminous, once
all the monitors have the new version they should get or create the
keys. It's ok to have the task fails, especially for the rbd-mirror
key, which only appears in Nautilus.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1650572
Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph_key: add a get_key function
Sébastien Han [Wed, 21 Nov 2018 15:17:04 +0000 (16:17 +0100)]
ceph_key: add a get_key function

When checking if a key exists we also have to ensure that the key exists
on the filesystem, the key can change on Ceph but still have an outdated
version on the filesystem. This solves this issue.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoswitch: do not look for devices anymore
Sébastien Han [Mon, 19 Nov 2018 13:58:03 +0000 (14:58 +0100)]
switch: do not look for devices anymore

It's easier lookup a directoriy instead of the block devices,
especially because of ceph-volume and ceph-disk have a different way to
handle devices.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoswitch: disable all ceph units
Sébastien Han [Fri, 16 Nov 2018 15:15:24 +0000 (16:15 +0100)]
switch: disable all ceph units

Prior to this commit we were only disabling ceph-osd units, but forgot
the ceph.target which is controlling everything and will restart the
ceph-osd units at each reboot.
Now that everything gets disabled there won't be any conflicts between
the old non-container and the new container units.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoswitch: do not mask systemd unit
Sébastien Han [Tue, 13 Nov 2018 16:43:21 +0000 (17:43 +0100)]
switch: do not mask systemd unit

If we mask it we won't be able to start the OSD container since now the
osd container use the osd ID as a name such as: ceph-osd@0

Fixes the error:  Failed to execute operation: Cannot send after transport endpoint shutdown

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agotests: change default pools size
Guillaume Abrioux [Wed, 21 Nov 2018 16:28:31 +0000 (17:28 +0100)]
tests: change default pools size

default pool size in our test should be explicitly set to 1

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoclient: change default pool size
Guillaume Abrioux [Wed, 21 Nov 2018 16:28:00 +0000 (17:28 +0100)]
client: change default pool size

default pool size should match the real default that is defined in ceph
itself.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodefaults: change default size for openstack pools
Guillaume Abrioux [Wed, 21 Nov 2018 16:27:11 +0000 (17:27 +0100)]
defaults: change default size for openstack pools

default pool size should match the real default that is defined in ceph
itself.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodefaults: change for default pool size for cephfs_pools
Guillaume Abrioux [Wed, 21 Nov 2018 16:08:19 +0000 (17:08 +0100)]
defaults: change for default pool size for cephfs_pools

default pool size should match the real default that is defined in ceph
itself.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodefaults: add ceph related vars file
Guillaume Abrioux [Wed, 21 Nov 2018 10:06:45 +0000 (11:06 +0100)]
defaults: add ceph related vars file

This is to add a granularity level.
We can have ceph specific variables that user shouldn't have to change
here.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorefact osd pool size customization
Guillaume Abrioux [Wed, 21 Nov 2018 10:00:11 +0000 (11:00 +0100)]
refact osd pool size customization

Add real default value for osd pool size customization.
Ceph itself has an `osd_pool_default_size` default value to `3`.

If users don't specify a pool size in various pools definition within
ceph-ansible, we should default to `3`.

By the way, this kind of condition isn't really clear:
```
when:
  - rbd_pool_size | default ("")
```

we should try to get the customized value then default to what is in
`osd_pool_default_size` (which has its default value pointing to
`ceph_osd_pool_default_size` (`3`) as well) and compare it to
`ceph_osd_pool_default_size`.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomon: move `osd_pool_default_pg_num` in `ceph-defaults`
Guillaume Abrioux [Tue, 13 Nov 2018 14:40:35 +0000 (15:40 +0100)]
mon: move `osd_pool_default_pg_num` in `ceph-defaults`

`osd_pool_default_pg_num` parameter is set in `ceph-mon`.
When using ceph-ansible with `--limit` on a specifc group of nodes, it
will fail when trying to access this variables since it wouldn't be
defined.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1518696
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoconfig: convert _osd_memory_target to int
Guillaume Abrioux [Wed, 21 Nov 2018 13:38:25 +0000 (14:38 +0100)]
config: convert _osd_memory_target to int

ceph.conf doesn't accept float value.

Typical error seen:
```
$ sudo ceph daemon osd.2 config get osd_memory_target
Can't get admin socket path: unable to get conf option admin_socket for osd.2:
parse error setting 'osd_memory_target' to '7823740108,8' (strict_si_cast:
unit prefix not recognized)
```

This commit ensures the value inserted in ceph.conf will be an integer.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agosite: resync container playbook
Sébastien Han [Tue, 20 Nov 2018 17:03:14 +0000 (18:03 +0100)]
site: resync container playbook

This PR https://github.com/ceph/ceph-ansible/pull/3251 forgot to create a symlink from site-docker.yml.sample to site-container.yml.sample.
This commit resyncs and put the symlink in place.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agodefaults/facts: Use list instead of keys
Boris Ranto [Tue, 20 Nov 2018 10:46:08 +0000 (11:46 +0100)]
defaults/facts: Use list instead of keys

It is safer to use the list filter than the keys() method since the keys
method does have some interoperability issues between python2 and
python3 based ansible/jinja.

Signed-off-by: Boris Ranto <branto@redhat.com>
6 years agostart_osds: Use list instead of keys
Boris Ranto [Mon, 19 Nov 2018 23:45:40 +0000 (00:45 +0100)]
start_osds: Use list instead of keys

If you use python3 based ansible then keys() returns a dict_keys object,
not a list of keys. This breaks the installation on such a system. Using
the list filter provides a more robust solution that should work on both
python2 and python3 based ansible. You can find some more information
about the issue, here:

https://github.com/ansible/ansible/issues/19514

Signed-off-by: Boris Ranto <branto@redhat.com>
6 years agoDiscover rbd facts.
Valentin Lorentz [Mon, 19 Nov 2018 20:49:45 +0000 (21:49 +0100)]
Discover rbd facts.

Signed-off-by: Valentin Lorentz <progval+git@progval.net>
6 years agovalidate plugin: handle missing exception fields without traceback
Dan Mick [Sat, 17 Nov 2018 00:28:54 +0000 (16:28 -0800)]
validate plugin: handle missing exception fields without traceback

"missing variable" errors introduced by PR3058 would attempt to
be reported, but since the exception contained no "path" definition,
would cause a second exception in the Invalid exception handler.
Make the exception handler verify that any field it tries to use
exists, clean up its message formatting, and reduce the verbose
level to see the literal error from notario in case more goes
wrong in future.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
6 years agoosd_memory_target: standardize unit and fix calculation
Neha Ojha [Mon, 19 Nov 2018 06:50:02 +0000 (06:50 +0000)]
osd_memory_target: standardize unit and fix calculation

* The default value of osd_memory_target used by ceph is 4294967296 bytes,
so use the same as ceph-ansible default.

* Convert ansible_memtotal_mb to bytes to calculate osd_memory_target

Signed-off-by: Neha Ojha <nojha@redhat.com>
6 years agodoc: update doc to add stable-3.2 information
Guillaume Abrioux [Mon, 19 Nov 2018 08:42:08 +0000 (09:42 +0100)]
doc: update doc to add stable-3.2 information

Since the branch has been created, we must reflect it in the doc.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoceph.ceph-container-common remove symlink
Sébastien Han [Sun, 18 Nov 2018 20:48:47 +0000 (21:48 +0100)]
ceph.ceph-container-common remove symlink

This error was introduced in the recent refactor of ceph-docker-common
in https://github.com/ceph/ceph-ansible/pull/3251. However, the Ansible
galaxy linter is not happy about it and fails importing the role.
Removing this since it's not used anymore.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoclient: fix a typo in create_users_keys.yml
Guillaume Abrioux [Sat, 17 Nov 2018 16:40:35 +0000 (17:40 +0100)]
client: fix a typo in create_users_keys.yml

cd1e4ee024ef400ded25e8c99948648ead3a0892 introduced a typo.
This commit fixes it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoinfra: don't restart firewalld if unit is masked
Guillaume Abrioux [Thu, 15 Nov 2018 20:56:11 +0000 (21:56 +0100)]
infra: don't restart firewalld if unit is masked

if firewalld.service systemd unit is masked, the handler will fail when
trying to restart it.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1650281
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoRemove outdated documentation
Noah Watkins [Thu, 15 Nov 2018 22:04:45 +0000 (14:04 -0800)]
Remove outdated documentation

Fixes BZ
https://bugzilla.redhat.com/show_bug.cgi?id=1640525

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
6 years agotox: add lvm setup to shrink mon
Sébastien Han [Tue, 13 Nov 2018 16:54:14 +0000 (17:54 +0100)]
tox: add lvm setup to shrink mon

Fix shrink mon scenario by setting lvm so we can configure ceph-volume
lvm osds.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoosd: commonize start_osd code
Guillaume Abrioux [Wed, 7 Nov 2018 10:45:29 +0000 (11:45 +0100)]
osd: commonize start_osd code

since `ceph-volume` introduction, there is no need to split those tasks.

Let's refact this part of the code so it's clearer.

By the way, this was breaking rolling_update.yml when `openstack_config:
true` playbook because nothing ensured OSDs were started in ceph-osd role (In
`openstack_config.yml` there is a check ensuring all OSD are UP which was
obviously failing) and resulted with OSDs on the last OSD node not started
anyway.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: set pool size to 1 in ceph-override.json
Guillaume Abrioux [Thu, 8 Nov 2018 08:08:28 +0000 (09:08 +0100)]
tests: set pool size to 1 in ceph-override.json

setting this setting to 1 makes the CI covering the related code in the
playbook without breaking the upgrade scenarios.

Those scenarios were broken because there is a check `TASK [waiting for
clean pgs...]` in rolling_update.yml, since the pool size for
`cephfs_metadata` and `cephfs_data` are updated to `2` in
`ceph-override.json` and there is not enough osd to honor this size,
some PGs are degraded and make the mentioned check failing.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agosite-docker: rename to 'site-container.yml.sample'
Guillaume Abrioux [Fri, 19 Oct 2018 15:49:34 +0000 (17:49 +0200)]
site-docker: rename to 'site-container.yml.sample'

Add a symlink for backward compatibility

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: rename role
Guillaume Abrioux [Fri, 19 Oct 2018 15:07:55 +0000 (17:07 +0200)]
docker-common: rename role

rename `ceph-docker-common` role to `ceph-container-common`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove system_checks.yml
Guillaume Abrioux [Fri, 19 Oct 2018 14:58:44 +0000 (16:58 +0200)]
docker-common: remove system_checks.yml

This check is now part of `ceph-validate`.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove check_mandatory_vars.yml
Guillaume Abrioux [Fri, 19 Oct 2018 14:51:38 +0000 (16:51 +0200)]
docker-common: remove check_mandatory_vars.yml

this is part of `ceph-validate` role.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove dirs_permissions.yml
Guillaume Abrioux [Fri, 19 Oct 2018 14:06:44 +0000 (16:06 +0200)]
docker-common: remove dirs_permissions.yml

this is already done in `ceph-config` role.
Let's remove this duplicated task.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove legacy tasks for ntp configuration
Guillaume Abrioux [Fri, 19 Oct 2018 13:57:18 +0000 (15:57 +0200)]
docker-common: remove legacy tasks for ntp configuration

Those tasks aren't needed in docker-common since the introduction of
`ceph-infra` role. They are duplicated tasks.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove duplicate running cluster check
Guillaume Abrioux [Fri, 19 Oct 2018 13:52:28 +0000 (15:52 +0200)]
docker-common: remove duplicate running cluster check

this is already done in ceph-defaults, there is no need to have this
check in ceph-docker-common.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodocker-common: remove duplicate set_fact (monitor_name)
Guillaume Abrioux [Wed, 17 Oct 2018 15:30:36 +0000 (17:30 +0200)]
docker-common: remove duplicate set_fact (monitor_name)

this fact is already set in ceph-defaults, there is no need to set it
again in ceph-docker-common

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoadd quotes around package names added in da6f384
Rishabh Dave [Thu, 8 Nov 2018 13:08:07 +0000 (18:38 +0530)]
add quotes around package names added in da6f384

Add quotes around package names added in the commit
da6f38422396307605d62ef63980bd0c5b7868f6 so that the difference between
the Ansible variables and package names is clear.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agopass the list of packages to package management modules
Rishabh Dave [Thu, 8 Nov 2018 09:26:58 +0000 (04:26 -0500)]
pass the list of packages to package management modules

Instead of looping over a list of packages or repeating the task
separately for different packages, pass the list of packages to the
task performing package management.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agorbd-mirror: use the new rbd-mirror key
Sébastien Han [Mon, 5 Nov 2018 16:14:31 +0000 (17:14 +0100)]
rbd-mirror: use the new rbd-mirror key

Instead of using the old rbd key let's use the new rbr-mirror key to
bootstrap the rbd -mirror daemon.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph_key: add fetch_initial_keys capability
Sébastien Han [Tue, 23 Oct 2018 16:38:40 +0000 (18:38 +0200)]
ceph_key: add fetch_initial_keys capability

This is needed for Nautilus since the ceph-create-keys script goes away.
(https://github.com/ceph/ceph/pull/21305)
Now the module if called with 'state: fetch_initial_keys' will lookup
keys generated by the monitor and write them down on the filesystem to
the right location (/etc/ceph and /var/lib/ceph/boostrap*).
This is not applicable to container since keys are generated by the
container only.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoigw: open iscsi target port
Mike Christie [Tue, 30 Oct 2018 19:03:37 +0000 (14:03 -0500)]
igw: open iscsi target port

Open the port the iscsi target uses for iscsi traffic.

Signed-off-by: Mike Christie <mchristi@redhat.com>
6 years agoigw: use api_port variable for firewall port setting
Mike Christie [Thu, 8 Nov 2018 21:23:24 +0000 (15:23 -0600)]
igw: use api_port variable for firewall port setting

Don't hard code api port because it might be overridden by the user.

Signed-off-by: Mike Christie <mchristi@redhat.com>
6 years agoigw: fix firewall iscsi_group_name check
Mike Christie [Tue, 30 Oct 2018 18:54:52 +0000 (13:54 -0500)]
igw: fix firewall iscsi_group_name check

The firewall setup for igw is not getting setup because iscsi_group_name
does not it exist. It should be iscsi_gw_group_name.

Signed-off-by: Mike Christie <mchristi@redhat.com>
6 years agoigw: Fix default api port
Mike Christie [Tue, 30 Oct 2018 18:54:03 +0000 (13:54 -0500)]
igw: Fix default api port

The default igw api port is 5000 in the manual setup docs and
ceph-iscsi-config package so this syncs up ansible.

Signed-off-by: Mike Christie <mchristi@redhat.com>
6 years agoigw: stop tcmu-runner on iscsi purge
Mike Christie [Thu, 8 Nov 2018 21:38:08 +0000 (15:38 -0600)]
igw: stop tcmu-runner on iscsi purge

When the iscsi purge playbook is run we stop the gw and api daemons but
not tcmu-runner which I forgot on the previous PR.

Fixes Red Hat BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1621255

Signed-off-by: Mike Christie <mchristi@redhat.com>
6 years agovalidate: do not validate ceph_repository if deploying containers
Andrew Schoen [Wed, 31 Oct 2018 15:25:26 +0000 (10:25 -0500)]
validate: do not validate ceph_repository if deploying containers

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1630975
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agodon't use "role" or "roles" to include roles
Noah Watkins [Wed, 7 Nov 2018 20:54:45 +0000 (12:54 -0800)]
don't use "role" or "roles" to include roles

see 3f62fc585f60fcaecbc783316a99cd8314aab062

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
6 years agoFix comments in shrink-osd-ceph-disk playbook
Noah Watkins [Wed, 7 Nov 2018 20:54:38 +0000 (12:54 -0800)]
Fix comments in shrink-osd-ceph-disk playbook

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
6 years agoAdd a ceph-volume aware shrink-osd playbook
Noah Watkins [Wed, 31 Oct 2018 18:17:16 +0000 (11:17 -0700)]
Add a ceph-volume aware shrink-osd playbook

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
6 years agoFixup shrink_osd[_container] scenario config
Noah Watkins [Tue, 6 Nov 2018 16:49:39 +0000 (08:49 -0800)]
Fixup shrink_osd[_container] scenario config

** configuration seems to be for filestore:

[ERROR]: [ceph-osd0] Validation failed for variable: lvm_volumes

** Removing `radosgw_interface: eth1` to resolve:

The task includes an option with an undefined variable. The error was:
'ansible.vars.hostvars.HostVarsVars object' has no attribute
u'ansible_eth1'

The error appears to have been in
'/home/nwatkins/src/ceph-ansible/roles/ceph-defaults/tasks/set_radosgw_address.yml':
line 21, column 5, but may be elsewhere in the file depending on the
exact syntax problem.

The offending line appears to be:

  - name: set_fact _radosgw_address to radosgw_interface - ipv4
    ^ here

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
6 years agoRename ceph-disk version of shrink-osd playbook
Noah Watkins [Wed, 31 Oct 2018 18:14:08 +0000 (11:14 -0700)]
Rename ceph-disk version of shrink-osd playbook

This will be replaced by a ceph-volume aware verison.

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
6 years agoigw: add support for IPv6
Jason Dillaman [Fri, 2 Nov 2018 14:30:34 +0000 (10:30 -0400)]
igw: add support for IPv6

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
6 years agoRevert "ceph_key: add fetch_initial_keys capability"
Sébastien Han [Thu, 8 Nov 2018 13:33:29 +0000 (14:33 +0100)]
Revert "ceph_key: add fetch_initial_keys capability"

This reverts commit 17883e09ba6356c79886db069db235b1e30130fb.

6 years agoRevert "rbd-mirror: use the new rbd-mirror key"
Sébastien Han [Thu, 8 Nov 2018 13:33:29 +0000 (14:33 +0100)]
Revert "rbd-mirror: use the new rbd-mirror key"

This reverts commit cdee9f01194eff27e6b6bf66ab436cecdd482dcb.

6 years agorbd-mirror: use the new rbd-mirror key
Sébastien Han [Mon, 5 Nov 2018 16:14:31 +0000 (17:14 +0100)]
rbd-mirror: use the new rbd-mirror key

Instead of using the old rbd key let's use the new rbr-mirror key to
bootstrap the rbd -mirror daemon.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph_key: add fetch_initial_keys capability
Sébastien Han [Tue, 23 Oct 2018 16:38:40 +0000 (18:38 +0200)]
ceph_key: add fetch_initial_keys capability

This is needed for Nautilus since the ceph-create-keys script goes away.
(https://github.com/ceph/ceph/pull/21305)
Now the module if called with 'state: fetch_initial_keys' will lookup
keys generated by the monitor and write them down on the filesystem to
the right location (/etc/ceph and /var/lib/ceph/boostrap*).
This is not applicable to container since keys are generated by the
container only.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: Don't compare to empty string
Sébastien Han [Thu, 1 Nov 2018 15:03:16 +0000 (16:03 +0100)]
lint: Don't compare to empty string

description = 'Use `when: var` rather than `when: var != ""` (or ' \ 'conversely `when: not var` rather than `when: var == ""`)'

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: don't lint 204
Sébastien Han [Thu, 1 Nov 2018 14:54:12 +0000 (15:54 +0100)]
lint: don't lint 204

Ignore linter warnings when line length is > 120 chars.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: Don't compare to literal True/False
Sébastien Han [Thu, 1 Nov 2018 13:02:55 +0000 (14:02 +0100)]
lint: Don't compare to literal True/False

Use `when: var` rather than `when: var == True`

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoremove ceph-common-coreos role
Sébastien Han [Thu, 1 Nov 2018 11:52:00 +0000 (12:52 +0100)]
remove ceph-common-coreos role

This role is not maintained and not tested so removing it.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: meta add company info
Sébastien Han [Thu, 1 Nov 2018 12:02:16 +0000 (13:02 +0100)]
lint: meta add company info

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: do not use local_action
Sébastien Han [Thu, 1 Nov 2018 11:50:31 +0000 (12:50 +0100)]
lint: do not use local_action

Use delegate_to: localhost instead.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: use galaxy_tags instead of categories
Sébastien Han [Thu, 1 Nov 2018 11:49:34 +0000 (12:49 +0100)]
lint: use galaxy_tags instead of categories

Update the meta

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: line length should not exceed 160 chars
Sébastien Han [Thu, 1 Nov 2018 11:48:59 +0000 (12:48 +0100)]
lint: line length should not exceed 160 chars

Line was too long

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: yaml space before and after {{ }}
Sébastien Han [Thu, 1 Nov 2018 11:47:17 +0000 (12:47 +0100)]
lint: yaml space before and after {{  }}

Fix tasks using variables that did not have space before and after {{
  }}

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agotravis: add ansible-galaxy linter
Sébastien Han [Wed, 31 Oct 2018 18:01:53 +0000 (19:01 +0100)]
travis: add ansible-galaxy linter

Run the same rules as the galaxy.
If the rules return an error then the roles who be uploaded to the
galaxy so we must make sure they pass.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agomisc: rm useless file
Sébastien Han [Wed, 31 Oct 2018 18:01:04 +0000 (19:01 +0100)]
misc: rm useless file

This file is not correct anymore since the ansible galaxy contains the
entire repo in it.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agodon't loop over a task using package management modules
Rishabh Dave [Wed, 31 Oct 2018 16:07:25 +0000 (12:07 -0400)]
don't loop over a task using package management modules

For tasks using (Ansible) modules for package management utilities,
pass the list of packages to be installed instead of repeating the task
for each package. Using the latter manner of installing a list of
packages leads to a deprecation warning by ansible-playbook command.

Fixes: https://github.com/ceph/ceph-ansible/issues/3293
Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agoremove configuration files for ceph packages on ubuntu clusters
Rishabh Dave [Wed, 31 Oct 2018 14:46:13 +0000 (10:46 -0400)]
remove configuration files for ceph packages on ubuntu clusters

For apt-get, purge command needs to be used, instead of remove command,
to remove related configuration files. Otherwise, packages might be
shown as installed while running dpkg command even after removing them.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1640061
Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agotests: test ooo_collocation agasint v3.0.3 ceph-container image
Guillaume Abrioux [Tue, 6 Nov 2018 08:17:29 +0000 (09:17 +0100)]
tests: test ooo_collocation agasint v3.0.3 ceph-container image

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorbd-mirror: enable ceph-rbd-mirror.target
Sébastien Han [Mon, 5 Nov 2018 17:53:44 +0000 (18:53 +0100)]
rbd-mirror: enable ceph-rbd-mirror.target

Without this the daemon will never start after reboot.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph-validate : Added functions to accept true and flase
VasishtaShastry [Sun, 28 Oct 2018 17:37:21 +0000 (23:07 +0530)]
ceph-validate : Added functions to accept true and flase

ceph-validate used to throw error for setting flags as 'true' or 'false' for True and False
Now user can set the flags 'dmcrypt' and 'osd_auto_discovery' as 'true' or 'false'

Will fix - Bug 1638325

Signed-off-by: VasishtaShastry <vipin.indiasmg@gmail.com>
6 years agoceph-common: update_cache whenever a new deb repo is added
Alfredo Deza [Thu, 1 Nov 2018 18:48:06 +0000 (14:48 -0400)]
ceph-common: update_cache whenever a new deb repo is added

The use of a handler meant that the cache would be updated at the very
end of the play, which doesn't work when adding a development repo and
trying to install right after it. This mostly reverts
53cdddf88699263763b36643565e5f846d9d13a8 without an actual `git revert`
because that caused other conflicts.

Signed-off-by: Alfredo Deza <adeza@redhat.com>
6 years agoremove task named "include ntp debian setup tasks"
Rishabh Dave [Thu, 1 Nov 2018 13:46:03 +0000 (19:16 +0530)]
remove task named "include ntp debian setup tasks"

The task was included by mistake while resolving a merge confict for
commit 8edbda96df6896d51703fcc250f562abb4011a2d. The task removed in
commit b3a71eeb08e9cdb2607ed60d724f387a0a24d3de.

Fixes: https://github.com/ceph/ceph-ansible/issues/3292
Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agogalaxy roles: polish metadata
Sébastien Han [Wed, 31 Oct 2018 16:42:44 +0000 (17:42 +0100)]
galaxy roles: polish metadata

Update the meta with the relavant support such as:

* ansible version: min 2.4
* distro supported (tested on) centos 7

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoremove roles symlinks
Sébastien Han [Wed, 31 Oct 2018 16:41:23 +0000 (17:41 +0100)]
remove roles symlinks

These 2 symlinks are not needed anymore as the whole ceph-ansible repo
is now in ansible galaxy.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoroles: add missing meta on roles
Sébastien Han [Wed, 31 Oct 2018 16:34:42 +0000 (17:34 +0100)]
roles: add missing meta on roles

In order to have roles in the Ansible galaxy, we must have a meta
directory.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint yaml: remove blank lines
Sébastien Han [Wed, 31 Oct 2018 14:52:54 +0000 (15:52 +0100)]
lint yaml: remove blank lines

Fixes : [error] too many blank lines (1 > 0)

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoiscsi: rm README entry
Sébastien Han [Wed, 31 Oct 2018 14:49:55 +0000 (15:49 +0100)]
iscsi: rm README entry

The file does not bring much to the repo.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: use command instead of shell
Sébastien Han [Tue, 30 Oct 2018 16:16:05 +0000 (17:16 +0100)]
lint: use command instead of shell

Use command when the tasks does not have any pipes or wilcards.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: skip the linter
Sébastien Han [Tue, 30 Oct 2018 16:13:20 +0000 (17:13 +0100)]
lint: skip the linter

Do not run the linter for these 3:

* we use latest for pip docker-py package
* for ssl keys this is a false positive since the inital command is a
'shell' it'll always change
* for keystone, we must use shell since the with_items contains pipes

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: remove trailling spaces
Sébastien Han [Tue, 30 Oct 2018 16:12:33 +0000 (17:12 +0100)]
lint: remove trailling spaces

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph-common: use yum install of shell
Sébastien Han [Tue, 30 Oct 2018 15:45:07 +0000 (16:45 +0100)]
ceph-common: use yum install of shell

Use yum module to list repos and then activate them if needed.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoceph-common: use a handler
Sébastien Han [Tue, 30 Oct 2018 14:53:07 +0000 (15:53 +0100)]
ceph-common: use a handler

We need a handler because the task changed, the old implementation was
basically mimicing a handler.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: add changed_when to command
Sébastien Han [Tue, 30 Oct 2018 14:51:32 +0000 (15:51 +0100)]
lint: add changed_when to command

Calling command should have changed_when false otherwise each time it
runs it will show as 'changed' and this is irrelevant.
Commands should not change things if nothing needs doing

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agolint: name tasks
Sébastien Han [Tue, 30 Oct 2018 14:51:03 +0000 (15:51 +0100)]
lint: name tasks

Tasks must have names.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agomon: use `_current_monitor_address` in systemd unit file
Guillaume Abrioux [Mon, 15 Oct 2018 13:25:24 +0000 (15:25 +0200)]
mon: use `_current_monitor_address` in systemd unit file

Let's avoid a jinja loop and use `_current_monitor_address` to get the
monitor address.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomon: refact docker/main.yml
Guillaume Abrioux [Mon, 15 Oct 2018 13:23:32 +0000 (15:23 +0200)]
mon: refact docker/main.yml

since the jinja logic has been moved into ansible task, we can simply
this part of the code and use `_current_monitor_address`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodefaults: add a fact '_current_monitor_address'
Guillaume Abrioux [Mon, 15 Oct 2018 13:22:40 +0000 (15:22 +0200)]
defaults: add a fact '_current_monitor_address'

So we don't have to loop over `_monitor_addresses` when we need the
monitor address of the current node being played.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoconfig: remove complex jinja logic in ceph.conf.j2
Guillaume Abrioux [Wed, 3 Oct 2018 14:09:33 +0000 (16:09 +0200)]
config: remove complex jinja logic in ceph.conf.j2

using consecutive set_fact in the playbook instead of complex jinja syntax
makes ceph.conf.j2 more readable.
By the way, jinja can be painful to debug at some point.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoplaybook: remove jinja syntax in when statement
Guillaume Abrioux [Mon, 29 Oct 2018 19:28:29 +0000 (20:28 +0100)]
playbook: remove jinja syntax in when statement

this syntax in deprecated

Closes: #3281
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoRevert "DNM: allow expanding Jinja2 template for Ansible custom plugin"
Rishabh Dave [Wed, 31 Oct 2018 10:51:33 +0000 (16:21 +0530)]
Revert "DNM: allow expanding Jinja2 template for Ansible custom plugin"

This reverts commit 192c0baf03d83741a83918de25fd7ae9a2771cb3.

6 years agoRevert "DNM: use ansible 2.7 for testing this PR"
Rishabh Dave [Wed, 31 Oct 2018 10:51:20 +0000 (16:21 +0530)]
Revert "DNM: use ansible 2.7 for testing this PR"

This reverts commit 162010d90eb2d7ec8bb04508ffd4ddb256aec5cd.

6 years agoDNM: allow expanding Jinja2 template for Ansible custom plugin
Rishabh Dave [Mon, 15 Oct 2018 19:02:42 +0000 (00:32 +0530)]
DNM: allow expanding Jinja2 template for Ansible custom plugin

This code should probably move to Ansible codebase.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agoDNM: use ansible 2.7 for testing this PR
Rishabh Dave [Fri, 5 Oct 2018 08:56:00 +0000 (04:56 -0400)]
DNM: use ansible 2.7 for testing this PR

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agodon't use "role" or "roles" to include roles
Rishabh Dave [Mon, 1 Oct 2018 15:43:24 +0000 (11:43 -0400)]
don't use "role" or "roles" to include roles

Since import_role and include_role are more readable, explicit (about
the nature of inclusion) and flexible (allows placibf inclusion
anywhere) amongst the tasks, use them instead of using roles or role
keyword. Besides, these keywords also allow more arguments.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agouse blocks directives to group tasks
Rishabh Dave [Fri, 7 Sep 2018 12:45:43 +0000 (18:15 +0530)]
use blocks directives to group tasks

Using block directives simplifies the playbooks and makes them more
readable.

Fixes: https://github.com/ceph/ceph-ansible/issues/2835
Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agorgw: move multisite default variables in ceph-defaults
Guillaume Abrioux [Tue, 30 Oct 2018 14:01:46 +0000 (15:01 +0100)]
rgw: move multisite default variables in ceph-defaults

Move all rgw multisite variables in ceph-defaults so ceph-validate can
go through them.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>