Repository: openshift/openshift-ansible

Issue:
Unable to create custom default storageclass
#### Description
> I want to install Openshift on AWS with the EFS Provisioner only.

##### Version

Please put the following version information in the code block
indicated below.

* Your ansible version per `ansible --version`

If you're operating from a **git clone**:

* The output of `git describe`

If you're running from playbooks installed via RPM or
`atomic-openshift-utils`

* The output of `rpm -q atomic-openshift-utils openshift-ansible`

Place the output between the code block below:

```
$ ansible --version
ansible 2.4.0.0

$ git describe
openshift-ansible-3.6.173.0.58-1
```

##### Steps To Reproduce
1. Set openshift_storageclass_provisioner to efs
2. Run the playbook


##### Expected Results
Describe what you expected to happen.

```
Created EFS Storage Class
```

##### Observed Results
Describe what is actually happening.

```
TASK [openshift_default_storage_class : Ensure storageclass object] ****************************************************************************************************************************************
Sunday 22 October 2017  00:58:20 +0200 (0:00:00.118)       0:45:38.475 ********
fatal: [openshift-master1]: FAILED! => {
    "changed": false,
    "failed": true
}

MSG:

value of provisioner must be one of: aws-ebs,gce-pd,glusterfs,cinder, got: penshift.org/aws-efs
.......

Failure summary:


  1. Hosts:    openshift-master1
     Play:     Create Hosted Resources
     Task:     Ensure storageclass object
     Message:  value of provisioner must be one of: aws-ebs,gce-pd,glusterfs,cinder, got: penshift.org/aws-efs
```
Related Code:

https://github.com/openshift/openshift-ansible/blob/a148a0f2768e37f212a12c21e6dda4c02b80143c/roles/lib_openshift/library/oc_storageclass.py#L1667

For long output or logs, consider using a [gist](https://gist.github.com/)


##### Additional Information

Provide any additional information which may help us diagnose the
issue.

* Your operating system and version, ie: RHEL 7.2, Fedora 23 (`$ cat /etc/redhat-release`)
* Your inventory file (especially any non-standard configuration parameters)
* Sample code, etc

```
CentOS7.4


openshift_storageclass_name="efs"
openshift_storageclass_provisioner="aws-efs"
```



Discussion:

Resolving patch:
diff --git a/roles/lib_openshift/library/oc_storageclass.py b/roles/lib_openshift/library/oc_storageclass.py
--- a/roles/lib_openshift/library/oc_storageclass.py
+++ b/roles/lib_openshift/library/oc_storageclass.py
@@ -1664,7 +1664,7 @@ def main():
             name=dict(default=None, type='str'),
             annotations=dict(default=None, type='dict'),
             parameters=dict(default=None, type='dict'),
-            provisioner=dict(required=True, type='str', choices=['aws-ebs', 'gce-pd', 'glusterfs', 'cinder']),
+            provisioner=dict(required=True, type='str'),
             api_version=dict(default='v1', type='str'),
             default_storage_class=dict(default="false", type='str'),
         ),
diff --git a/roles/lib_openshift/src/ansible/oc_storageclass.py b/roles/lib_openshift/src/ansible/oc_storageclass.py
--- a/roles/lib_openshift/src/ansible/oc_storageclass.py
+++ b/roles/lib_openshift/src/ansible/oc_storageclass.py
@@ -14,7 +14,7 @@ def main():
             name=dict(default=None, type='str'),
             annotations=dict(default=None, type='dict'),
             parameters=dict(default=None, type='dict'),
-            provisioner=dict(required=True, type='str', choices=['aws-ebs', 'gce-pd', 'glusterfs', 'cinder']),
+            provisioner=dict(required=True, type='str'),
             api_version=dict(default='v1', type='str'),
             default_storage_class=dict(default="false", type='str'),
         ),


Test patch: