diff options
author | Scott Dodson <sdodson@redhat.com> | 2015-10-05 12:53:10 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2015-12-15 15:45:45 -0500 |
commit | 8e7c5c970b8adc83fd6d5cad115f4edb06b36d98 (patch) | |
tree | 408ffd1864ae9cd34ef238d5c5a9ff2aa59193d9 /roles/etcd/tasks | |
parent | a0b6fc7db1be2cf6190d982f90e96f4c39a4c699 (diff) | |
download | openshift-8e7c5c970b8adc83fd6d5cad115f4edb06b36d98.tar.gz openshift-8e7c5c970b8adc83fd6d5cad115f4edb06b36d98.tar.bz2 openshift-8e7c5c970b8adc83fd6d5cad115f4edb06b36d98.tar.xz openshift-8e7c5c970b8adc83fd6d5cad115f4edb06b36d98.zip |
Containerization work by @sdodson
Diffstat (limited to 'roles/etcd/tasks')
-rw-r--r-- | roles/etcd/tasks/main.yml | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/roles/etcd/tasks/main.yml b/roles/etcd/tasks/main.yml index d661ce437..aef52886b 100644 --- a/roles/etcd/tasks/main.yml +++ b/roles/etcd/tasks/main.yml @@ -7,8 +7,42 @@ msg: IPv4 address not found for {{ etcd_interface }} when: "'ipv4' not in hostvars[inventory_hostname]['ansible_' ~ etcd_interface] or 'address' not in hostvars[inventory_hostname]['ansible_' ~ etcd_interface].ipv4" +- debug: var=openshift.common.is_containerized +- debug: var=openshift.common.is_atomic + - name: Install etcd - action: "{{ ansible_pkg_mgr }} name=etcd-2.* state=present" and not is_atomic + action: "{{ ansible_pkg_mgr }} name=etcd-2.* state=present" + when: not openshift.common.is_containerized | bool + +- name: Pull etcd container + command: > + docker pull {{ openshift.etcd.etcd_image }} + when: openshift.common.is_containerized | bool + +- name: Install etcd container service file + template: + dest: "/etc/systemd/system/etcd_container.service" + src: etcd.docker.service + register: install_etcd_result + when: openshift.common.is_containerized | bool + +- name: Ensure etcd datadir exists + when: openshift.common.is_containerized | bool + file: + path: "{{ etcd_data_dir }}" + state: directory + mode: 0700 + +- name: Disable system etcd when containerized + when: openshift.common.is_containerized | bool + service: + name: etcd + state: stopped + enabled: no + +- name: Reload systemd units + command: systemctl daemon-reload + when: openshift.common.is_containerized and ( install_etcd_result | changed ) - name: Validate permissions on the config dir file: @@ -52,7 +86,7 @@ - name: Enable etcd service: - name: etcd + name: "{{ etcd_service }}" state: started enabled: yes register: start_result |