diff options
author | Jan Chaloupka <jchaloup@redhat.com> | 2017-09-19 09:44:37 +0200 |
---|---|---|
committer | Jan Chaloupka <jchaloup@redhat.com> | 2017-09-21 16:47:01 +0200 |
commit | 2c8d16c36b8eec5c2a82fb5da7291736654e55f2 (patch) | |
tree | 538abc2a50573e3463ab5cd04aefaf2de8369db5 /roles/etcd_upgrade | |
parent | af580f808d78667bde54b88d4c33fca493828945 (diff) | |
download | openshift-2c8d16c36b8eec5c2a82fb5da7291736654e55f2.tar.gz openshift-2c8d16c36b8eec5c2a82fb5da7291736654e55f2.tar.bz2 openshift-2c8d16c36b8eec5c2a82fb5da7291736654e55f2.tar.xz openshift-2c8d16c36b8eec5c2a82fb5da7291736654e55f2.zip |
consolidate etcd_upgrade role
Diffstat (limited to 'roles/etcd_upgrade')
-rw-r--r-- | roles/etcd_upgrade/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/etcd_upgrade/meta/main.yml | 17 | ||||
-rw-r--r-- | roles/etcd_upgrade/tasks/main.yml | 14 | ||||
-rw-r--r-- | roles/etcd_upgrade/tasks/upgrade.yml | 11 | ||||
-rw-r--r-- | roles/etcd_upgrade/tasks/upgrade_image.yml | 48 | ||||
-rw-r--r-- | roles/etcd_upgrade/tasks/upgrade_rpm.yml | 32 | ||||
-rw-r--r-- | roles/etcd_upgrade/vars/main.yml | 3 |
7 files changed, 0 insertions, 128 deletions
diff --git a/roles/etcd_upgrade/defaults/main.yml b/roles/etcd_upgrade/defaults/main.yml deleted file mode 100644 index 61bbba225..000000000 --- a/roles/etcd_upgrade/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -r_etcd_upgrade_action: upgrade -r_etcd_upgrade_mechanism: rpm diff --git a/roles/etcd_upgrade/meta/main.yml b/roles/etcd_upgrade/meta/main.yml deleted file mode 100644 index afdb0267f..000000000 --- a/roles/etcd_upgrade/meta/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -galaxy_info: - author: Jan Chaloupka - description: - company: Red Hat, Inc. - license: Apache License, Version 2.0 - min_ansible_version: 1.9 - platforms: - - name: EL - versions: - - 7 - categories: - - cloud - - system -dependencies: -- role: etcd_common - r_etcd_common_embedded_etcd: "{{ r_etcd_upgrade_embedded_etcd }}" diff --git a/roles/etcd_upgrade/tasks/main.yml b/roles/etcd_upgrade/tasks/main.yml deleted file mode 100644 index 129c69d6b..000000000 --- a/roles/etcd_upgrade/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# INPUT r_etcd_upgrade_action -- name: Fail if invalid etcd_upgrade_action provided - fail: - msg: "etcd_upgrade role can only be called with 'upgrade'" - when: - - r_etcd_upgrade_action not in ['upgrade'] - -- name: Detecting Atomic Host Operating System - stat: - path: /run/ostree-booted - register: l_ostree_booted - -- include: "{{ r_etcd_upgrade_action }}.yml" diff --git a/roles/etcd_upgrade/tasks/upgrade.yml b/roles/etcd_upgrade/tasks/upgrade.yml deleted file mode 100644 index 420c9638e..000000000 --- a/roles/etcd_upgrade/tasks/upgrade.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# INPUT r_etcd_upgrade_version -# INPUT r_etcd_upgrade_mechanism -- name: Failt if r_etcd_upgrade_mechanism is not set during upgrade - fail: - msg: "r_etcd_upgrade_mechanism can be only set to 'rpm' or 'image'" - when: - - r_etcd_upgrade_mechanism not in ['rpm', 'image'] - -- name: "Upgrade {{ r_etcd_upgrade_mechanism }} based etcd" - include: upgrade_{{ r_etcd_upgrade_mechanism }}.yml diff --git a/roles/etcd_upgrade/tasks/upgrade_image.yml b/roles/etcd_upgrade/tasks/upgrade_image.yml deleted file mode 100644 index 136ec1142..000000000 --- a/roles/etcd_upgrade/tasks/upgrade_image.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -# INPUT r_etcd_upgrade_version -- name: Verify cluster is healthy pre-upgrade - command: "{{ etcdctlv2 }} cluster-health" - -- name: Get current image - shell: "grep 'ExecStart=' {{ etcd_service_file }} | awk '{print $NF}'" - register: current_image - -- name: Set new_etcd_image - set_fact: - new_etcd_image: "{{ current_image.stdout | regex_replace('/etcd.*$','/etcd:' ~ r_etcd_upgrade_version ) }}" - -- name: Pull new etcd image - command: "docker pull {{ new_etcd_image }}" - -- name: Update to latest etcd image - replace: - dest: "{{ etcd_service_file }}" - regexp: "{{ current_image.stdout }}$" - replace: "{{ new_etcd_image }}" - -- name: Restart etcd_container - systemd: - name: "{{ etcd_service }}" - daemon_reload: yes - state: restarted - -## TODO: probably should just move this into the backup playbooks, also this -## will fail on atomic host. We need to revisit how to do etcd backups there as -## the container may be newer than etcdctl on the host. Assumes etcd3 obsoletes etcd (7.3.1) -- name: Upgrade etcd for etcdctl when not atomic - package: name=etcd state=latest - when: not l_ostree_booted.stat.exists | bool - -- name: Verify cluster is healthy - command: "{{ etcdctlv2 }} cluster-health" - register: etcdctl - until: etcdctl.rc == 0 - retries: 3 - delay: 10 - -- name: Store new etcd_image - # DEPENDENCY openshift_facts - openshift_facts: - role: etcd - local_facts: - etcd_image: "{{ new_etcd_image }}" diff --git a/roles/etcd_upgrade/tasks/upgrade_rpm.yml b/roles/etcd_upgrade/tasks/upgrade_rpm.yml deleted file mode 100644 index 324b69605..000000000 --- a/roles/etcd_upgrade/tasks/upgrade_rpm.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# INPUT r_etcd_upgrade_version? - -# F23 GA'd with etcd 2.0, currently has 2.2 in updates -# F24 GA'd with etcd-2.2, currently has 2.2 in updates -# F25 Beta currently has etcd 3.0 -# RHEL 7.3.4 with etcd-3.1.3-1.el7 -# RHEL 7.3.3 with etcd-3.1.0-2.el7 -# RHEL 7.3.2 with etcd-3.0.15-1.el7 - -- name: Verify cluster is healthy pre-upgrade - command: "{{ etcdctlv2 }} cluster-health" - -- set_fact: - l_etcd_target_package: "{{ 'etcd' if r_etcd_upgrade_version is not defined else 'etcd-'+r_etcd_upgrade_version+'*' }}" - -- name: Update etcd RPM to {{ l_etcd_target_package }} - package: - name: "{{ l_etcd_target_package }}" - state: latest - -- name: Restart etcd - service: - name: "{{ etcd_service }}" - state: restarted - -- name: Verify cluster is healthy - command: "{{ etcdctlv2 }} cluster-health" - register: etcdctl - until: etcdctl.rc == 0 - retries: 3 - delay: 10 diff --git a/roles/etcd_upgrade/vars/main.yml b/roles/etcd_upgrade/vars/main.yml deleted file mode 100644 index 5ed919d42..000000000 --- a/roles/etcd_upgrade/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# EXPECTS etcd_peer -etcdctlv2: "etcdctl --cert-file {{ etcd_peer_cert_file }} --key-file {{ etcd_peer_key_file }} --ca-file {{ etcd_peer_ca_file }} -C https://{{ etcd_peer }}:{{ etcd_client_port }}" |