rhtconsulting / rhc-ose

OpenShift Automation and Utilities by Red Hat Consulting
42 stars 34 forks source link

Add docker role #150

Closed vvaldez closed 8 years ago

vvaldez commented 8 years ago

What does this PR do?

Adds Ansible role for Docker. Largely taken from cicd docker.yml with a few changes. Changed docker-storage-setup file to use a template and referred to defined variables for DEV and VG which follow the other roles in this repo with defaults set. Each instance uses the output of pvs to determine if the DEV and VG are already in use, in which case it will skip docker-storage-setup steps.

How should this be manually tested?

Provision an environment and include this role. The PR includes a reference to this role in ose-provision.yml

Is there a relevant Issue open for this?

None.

Who would you like to review this?

/cc @oybed @etsauer @sabre1041

sabre1041 commented 8 years ago

lgtm

detiber commented 8 years ago

@vvaldez I made a few comments here, but I would really like to see the docker storage configuration contributed upstream to the docker role in openshift-ansible. I'd be happy to work with you on changes that would be needed to get it working there and tested.

etsauer commented 8 years ago

@vvaldez I agree with @detiber. If you don't mind, please work with him to get this opened against openshift-ansible

oybed commented 8 years ago

Unless I'm missing something, it looks like this may already be part of openshift-ansible(?) https://github.com/openshift/openshift-ansible/tree/master/roles/docker_storage_setup

detiber commented 8 years ago

@oybed sort of... That role will arbitrarily kill /var/lib/docker and offers no idempotence.

vvaldez commented 8 years ago

@detiber I'm finally getting to work on this and I see the role was moved to openshift-tools: https://github.com/openshift/openshift-tools/tree/stg/ansible/roles/docker_storage_setup

What is the best way to work on this PR and have it benefit both openshift-tools and this project? I see that role is not idempotent, which is one thing I have added (though not as good as it could be) in the current commits.

vvaldez commented 8 years ago

Should I split this into two roles, one for docker and one for docker_storage_setup?

detiber commented 8 years ago

I would put the basic docker-storage-setup config (targeted at new installations where Docker storage isn't already configured) into the Docker role itself.

I could see a use for a separate role/playbook that could manage Docker storage in a more in depth way, though. For example, the dedicated playbook/role could handle migrating from one storage backend to another (something we wouldn't want to arbitrarily run on a system we didn't bootstrap).

etsauer commented 8 years ago

Going to try a manual merge of this. We will do further cleanup later.