diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-01-05 09:28:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-05 09:28:22 -0500 |
commit | afbe1f5aba71c9c2b25c76507dcc18124cbf96d5 (patch) | |
tree | a4aeac783b90f95aaae26a3218edc8bd006557bb /roles | |
parent | 71ae12fc775d4606a66959eb45def687ba716a28 (diff) | |
parent | 5f133b5826eecfb49daeb17b911252ae09e8eb57 (diff) | |
download | openshift-afbe1f5aba71c9c2b25c76507dcc18124cbf96d5.tar.gz openshift-afbe1f5aba71c9c2b25c76507dcc18124cbf96d5.tar.bz2 openshift-afbe1f5aba71c9c2b25c76507dcc18124cbf96d5.tar.xz openshift-afbe1f5aba71c9c2b25c76507dcc18124cbf96d5.zip |
Merge pull request #3008 from bigbank-as/feature/nfs-reclaim-option
Add osnl_volume_reclaim_policy variable to nfs_lvm role
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_storage_nfs_lvm/README.md | 9 | ||||
-rw-r--r-- | roles/openshift_storage_nfs_lvm/defaults/main.yml | 7 | ||||
-rw-r--r-- | roles/openshift_storage_nfs_lvm/templates/nfs.json.j2 | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/roles/openshift_storage_nfs_lvm/README.md b/roles/openshift_storage_nfs_lvm/README.md index 8b8471745..cc674d3fd 100644 --- a/roles/openshift_storage_nfs_lvm/README.md +++ b/roles/openshift_storage_nfs_lvm/README.md @@ -48,6 +48,13 @@ osnl_volume_num_start: 3 # How many volumes/partitions to build, with the size we stated. osnl_number_of_volumes: 2 +# osnl_volume_reclaim_policy +# Volume reclaim policy of a PersistentVolume tells the cluster +# what to do with the volume after it is released. +# +# Valid values are "Retain" or "Recycle" (default). +osnl_volume_reclaim_policy: "Recycle" + ``` ## Dependencies @@ -71,6 +78,7 @@ exported via NFS. json files are created in /root. osnl_volume_size: 5 osnl_volume_num_start: 3 osnl_number_of_volumes: 2 + osnl_volume_reclaim_policy: "Recycle" ## Full example @@ -96,6 +104,7 @@ exported via NFS. json files are created in /root. osnl_volume_size: 5 osnl_volume_num_start: 3 osnl_number_of_volumes: 2 + osnl_volume_reclaim_policy: "Recycle" * Run the playbook: ``` diff --git a/roles/openshift_storage_nfs_lvm/defaults/main.yml b/roles/openshift_storage_nfs_lvm/defaults/main.yml index f81cdc724..48352187c 100644 --- a/roles/openshift_storage_nfs_lvm/defaults/main.yml +++ b/roles/openshift_storage_nfs_lvm/defaults/main.yml @@ -8,3 +8,10 @@ osnl_mount_dir: /exports/openshift # Volume Group to use. osnl_volume_group: openshiftvg + +# Volume reclaim policy of a PersistentVolume tells the cluster +# what to do with the volume after it is released. +# +# Valid values are "Retain" or "Recycle". +# See https://docs.openshift.com/enterprise/3.0/architecture/additional_concepts/storage.html#pv-recycling-policy +osnl_volume_reclaim_policy: "Recycle" diff --git a/roles/openshift_storage_nfs_lvm/templates/nfs.json.j2 b/roles/openshift_storage_nfs_lvm/templates/nfs.json.j2 index 3c4d2f56c..19e150f7d 100644 --- a/roles/openshift_storage_nfs_lvm/templates/nfs.json.j2 +++ b/roles/openshift_storage_nfs_lvm/templates/nfs.json.j2 @@ -12,7 +12,7 @@ "storage": "{{ osnl_volume_size }}Gi" }, "accessModes": [ "ReadWriteOnce", "ReadWriteMany" ], - "persistentVolumeReclaimPolicy": "Recycle", + "persistentVolumeReclaimPolicy": "{{ osnl_volume_reclaim_policy }}", "nfs": { "Server": "{{ inventory_hostname }}", "Path": "{{ osnl_mount_dir }}/{{ item }}" |