diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2015-05-26 16:09:13 -0400 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2015-05-26 16:09:13 -0400 |
commit | 5cf4c381c48e3286b1c7417d9873e39ba93cd1a0 (patch) | |
tree | 0ee934a82e94bac74f056580076ad50792fe643e /roles/docker_storage | |
parent | 24433e82d6e6bb90ed842e5c58d235c6cda7643c (diff) | |
parent | 801f215bd2cd5341d63b5dd91298d23b11dc3553 (diff) | |
download | openshift-5cf4c381c48e3286b1c7417d9873e39ba93cd1a0.tar.gz openshift-5cf4c381c48e3286b1c7417d9873e39ba93cd1a0.tar.bz2 openshift-5cf4c381c48e3286b1c7417d9873e39ba93cd1a0.tar.xz openshift-5cf4c381c48e3286b1c7417d9873e39ba93cd1a0.zip |
Merge pull request #249 from kwoodson/docker
Docker storage role.
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 @@ +--- |