New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add role for installing ceph-ansible and its confiuration #23
Conversation
@Tendrl/qe please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just few small notes/questions.
collocation: true | ||
|
||
# if collocation is false and journal devices are set, | ||
# create journals on journal devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if collocation
is false
but journal_devices
are not set? Does it use some autodetection, same as for empty devices
, or it is not supported configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If devices
variable is empty devices are autodetected by ceph-ansible. If collocation
is false
, journal_devices
should contain list of devices for journals.
dest: /usr/share/ceph-ansible/group_vars/osds.yml | ||
regexp: '^#devices:' | ||
line: 'devices:' | ||
when: "{{ devices }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double curly brackets {{
and }}
shouldn't be required here (see the Ansible doc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works with double curly brackets.
dest: /usr/share/ceph-ansible/group_vars/osds.yml | ||
regexp: "^#osd_auto_discovery: false" | ||
line: "osd_auto_discovery: true" | ||
when: "{{ not devices }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this construction works correctly? (maybe yes, I'm just asking, because the double quotes and double curly brackets are not usually used in such when
construction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works.
line: 'raw_journal_devices:' | ||
when: "{{ (not collocation) and journal_devices }}" | ||
|
||
- name: Add devices for if they are set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this should be:
Add devices for journal if they are set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also required to prepare specific hosts file for ceph-ansible.
# TODO do apt installation | ||
- name: Install ceph-ansible package | ||
yum: | ||
name=ceph-ansible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkudlej I see that you just install ceph-ansible
package without enabling particular repository for it. That is good.
That said, I would like to know which ceph-ansible package you tested this role with?
- name: Copy sample files | ||
copy: | ||
src: "/usr/share/ceph-ansible/{{ item.src }}" | ||
dest: "/usr/share/ceph-ansible/{{ item.dst }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not install config files created from packaged samples into system directory.
@@ -0,0 +1,6 @@ | |||
--- | |||
- name: Install ceph-ansible and install Ceph | |||
hosts: usm_server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ceph-ansible should be installed and configured on qe_server instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could just move installation of ceph-ansible package into qe_server role
I would suggest to move installation of |
Moreover it would be nice if it would be possible to run ceph-ansible playbooks via pytest ansible playbook plugin. |
I'm dumping my notes here:
|
- playbook is run on qe server node - ansible.cfg is used beause of ceph-ansible - files from ceph-ansible packages are copied and they are no more modified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have few questions and notes.
And also it seems like there are by mistake some commits unrelated to the ceph-ansible.
As it is written in ``tasks/main.yml`` ceph-ansible package should be | ||
preinstalled or available in enabled yum repository. | ||
|
||
Example usage of configured ceph-ansible: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following lines sounds slightly strangely (or maybe I just misunderstand them). Could you please check it and at least fix the format, so it will be properly generated? (check the View button)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
@@ -0,0 +1,19 @@ | |||
--- | |||
# home directory which contains copy of files in ceph-ansible package | |||
home_dir: "{{ ansible_env['WORKSPACE'] | default(ansible_env['HOME']) }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name home_dir
sounds to me, like it should be the HOME dir of the user, I would name it maybe something like base_dir
(if I understand the meaning correctly).
Also where should point the ansible_env['WORKSPACE']
? (I wasn't able to find, what it means.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WORKSPACE is variable in Jenkins environment for build workspace, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkudlej ah, yes you are right. Please, write there short description about that and consider the renaming of the home_dir
to something like base_dir
or work_dir
.
journal_devices: [] | ||
|
||
# path to ansible configuration which overrides default ansible configuration | ||
ansible_conf: /tmp/ansible.cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, if /tmp/
is the best place for the configuration file (it might not persist reboot of the machine, but this didn't apply to RHEL 7/CentOS 7 though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is not problem, because it is written every time you run this playbook. This is not configuration file which should persist after reboot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I agree (I somehow thing it is launched only during the qe server configuration).
regexp: '^#generate_fsid: true.*' | ||
line: 'generate_fsid: true' | ||
|
||
# Disabled because this list in directly in ceph-ansible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just typo? Disabled because this list is directly in ceph-ansible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
# edit mons.yml file | ||
|
||
# Disabled on CentOS because calamari is not available in SIG | ||
- name: Enable calamari on mons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just question, it will be installed, configured and running on all mons, or only on one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ceph-ansible install and run calamari on all mons. Console 2 has no problem with this. It is OK to create user in Calamari only on one instance after installation for import purpose.
@@ -3,3 +3,78 @@ | |||
================ | |||
|
|||
This role configures the machine for execution of usmqe integration tests. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this and the following files are part of this pull request by mistake as it is about Xvfb server and other stuff and not about ceph-ansible.
Tested with ceph-ansible https://koji.fedoraproject.org/koji/buildinfo?buildID=831491 |
|
||
# cd to ceph-ansible dir so relative paths can be used | ||
# default value of variable $base_dir is in defaults/main.yml | ||
$ cd $base_dir/ceph-ansible from defaults/main.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, now it make sense. Maybe just remove the from defaults/main.yml
from the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to block your work, so I'm ok with merging it now.
That said, I would like to test this myself to check what needs to be done to run ceph-ansible playbooks via pytest-ansible-playbook fixture. Moreover, configuring ansible via ansible feels weird.
@@ -0,0 +1,6 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rename this file to just ceph_ansible.yml
or configura_ceph_ansible.yml
?
No description provided.