Skip to content
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

Merged
merged 5 commits into from Jan 20, 2017

Conversation

mkudlej
Copy link
Contributor

@mkudlej mkudlej commented Jan 11, 2017

No description provided.

@mkudlej
Copy link
Contributor Author

mkudlej commented Jan 11, 2017

@Tendrl/qe please review

Copy link
Contributor

@dahorak dahorak left a 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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 }}"
Copy link
Contributor

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).

Copy link
Contributor Author

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 }}"
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

@dahorak dahorak left a 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
Copy link
Contributor

@mbukatov mbukatov Jan 12, 2017

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 }}"
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

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

@mbukatov
Copy link
Contributor

I would suggest to move installation of ceph-ansible package into qe-server role, and then enable repo with this package in qe_server playbook.

@mbukatov
Copy link
Contributor

Moreover it would be nice if it would be possible to run ceph-ansible playbooks via pytest ansible playbook plugin.

@mbukatov
Copy link
Contributor

I'm dumping my notes here:

  • we are not testing ceph-ansible, we are just using it
  • we use it for setup of import cluster test case(s)
  • ceph-ansible will be installed, configured and used on qe_server
  • we install it from rpm package (which has a minor issue right now, because the package is not available in Storage SIG)
  • we have ansible role for configuration of ceph ansible (see tasks in this pull request)

- 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
@mkudlej
Copy link
Contributor Author

mkudlej commented Jan 18, 2017

@dahorak @mbukatov please review my changes

Copy link
Contributor

@dahorak dahorak left a 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:
Copy link
Contributor

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)

Copy link
Contributor Author

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']) }}"
Copy link
Contributor

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.)

Copy link
Contributor Author

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?

Copy link
Contributor

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
Copy link
Contributor

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).

Copy link
Contributor Author

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.

Copy link
Contributor

@dahorak dahorak Jan 19, 2017

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
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@mkudlej
Copy link
Contributor Author

mkudlej commented Jan 19, 2017

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
Copy link
Contributor

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.

Copy link
Contributor

@mbukatov mbukatov left a 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 @@
---
Copy link
Contributor

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?

@mbukatov mbukatov merged commit 1f74c19 into usmqe:master Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants