diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2015-05-26 14:36:14 -0400 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2015-05-26 16:06:20 -0400 |
commit | 801f215bd2cd5341d63b5dd91298d23b11dc3553 (patch) | |
tree | f96b2eb92236fc81aba6607ab26053595cad5e5e /roles/docker_storage | |
parent | 95d94334bb028b9b3c655f7da4ca47c5b639e338 (diff) | |
download | openshift-801f215bd2cd5341d63b5dd91298d23b11dc3553.tar.gz openshift-801f215bd2cd5341d63b5dd91298d23b11dc3553.tar.bz2 openshift-801f215bd2cd5341d63b5dd91298d23b11dc3553.tar.xz openshift-801f215bd2cd5341d63b5dd91298d23b11dc3553.zip |
docker-storage role added
Diffstat (limited to 'roles/docker_storage')
-rw-r--r-- | roles/docker_storage/README.md | 39 | ||||
-rw-r--r-- | roles/docker_storage/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/docker_storage/handlers/main.yml | 1 | ||||
-rw-r--r-- | roles/docker_storage/meta/main.yml | 9 | ||||
-rw-r--r-- | roles/docker_storage/tasks/main.yml | 37 | ||||
-rw-r--r-- | roles/docker_storage/vars/main.yml | 1 |
6 files changed, 88 insertions, 0 deletions
diff --git a/roles/docker_storage/README.md b/roles/docker_storage/README.md new file mode 100644 index 000000000..0d8f31afc --- /dev/null +++ b/roles/docker_storage/README.md @@ -0,0 +1,39 @@ +docker_storage +========= + +Configure docker_storage options +------------ + +None + +Role Variables +-------------- + +None + +Dependencies +------------ + +None + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role/docker_storage: + - key: df.fs + value: xfs + } + +License +------- + +ASL 2.0 + +Author Information +------------------ + +Openshift operations, Red Hat, Inc diff --git a/roles/docker_storage/defaults/main.yml b/roles/docker_storage/defaults/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/docker_storage/defaults/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/docker_storage/handlers/main.yml b/roles/docker_storage/handlers/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/docker_storage/handlers/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/docker_storage/meta/main.yml b/roles/docker_storage/meta/main.yml new file mode 100644 index 000000000..a5d51cd3a --- /dev/null +++ b/roles/docker_storage/meta/main.yml @@ -0,0 +1,9 @@ +--- +galaxy_info: + author: Openshift + description: Setup docker_storage options + company: Red Hat, Inc + license: ASL 2.0 + min_ansible_version: 1.2 +dependencies: +- docker diff --git a/roles/docker_storage/tasks/main.yml b/roles/docker_storage/tasks/main.yml new file mode 100644 index 000000000..48a3fc208 --- /dev/null +++ b/roles/docker_storage/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- lvg: + pvs: "{{ dst_device }}" + vg: "{{ dst_vg }}" + register: dst_lvg + +- lvol: + lv: data + vg: "{{ dst_vg }}" + size: 95%VG + register: dst_lvol_data + +- lvol: + lv: metadata + vg: "{{ dst_vg }}" + size: 5%VG + register: dst_lvol_metadata + + +- name: Update docker_storage options + lineinfile: + dest: /etc/sysconfig/docker-storage + backrefs: yes + regexp: "^(DOCKER_STORAGE_OPTIONS=)" + line: '\1 --storage-opt {{ dst_options | oo_combine_key_value("=") | join(" --storage-opt ") }}' + when: dst_options is defined and dst_options | length > 0 + register: dst_config + + +- name: Reload systemd units + command: systemctl daemon-reload + notify: + - restart docker + when: dst_config | changed or + dst_lvg | changed or + dst_lvol_data | changed or + dst_lvol_metadata | changed diff --git a/roles/docker_storage/vars/main.yml b/roles/docker_storage/vars/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/docker_storage/vars/main.yml @@ -0,0 +1 @@ +--- |