modularized functionality that is used more than once.
diff --git a/backup.yml b/backup.yml deleted file mode 100644 index e5978f2..0000000 --- a/backup.yml +++ /dev/null
@@ -1,16 +0,0 @@ ---- -- name: Backup zookeeper - include: opdk-backup.yml - vars: - hosts: 'ds' - component_name: 'apigee-zookeeper' - tags: - - zookeeper - -- name: Backup cassandra - include: opdk-backup.yml - vars: - hosts: 'ds' - component_name: 'apigee-cassandra' - tags: - - cassandra
diff --git a/consistency.yml b/consistency.yml new file mode 100644 index 0000000..67db74a --- /dev/null +++ b/consistency.yml
@@ -0,0 +1,7 @@ +--- +- name: Set message processor consistencylevel + hosts: '{{ hosts }}' + gather_facts: no + serial: 1 + roles: + - { role: apigee-opdk-cassandra-consistencylevel-modifier}
diff --git a/opdk-backup.yml b/opdk-backup.yml index 53746a5..3837fee 100644 --- a/opdk-backup.yml +++ b/opdk-backup.yml
@@ -1,5 +1,6 @@ --- -- hosts: '{{ hosts }}' +- name: Perform backup of edge component + hosts: ds gather_facts: no serial: 1 roles:
diff --git a/repair.yml b/repair.yml new file mode 100644 index 0000000..0390f2b --- /dev/null +++ b/repair.yml
@@ -0,0 +1,7 @@ +--- +- name: Execute nodetool repair on Cassandra nodes after updating + hosts: ds + gather_facts: no + serial: 1 + roles: + - { role: apigee-opdk-cassandra-repair }
diff --git a/rolling-restart.yml b/rolling-restart.yml new file mode 100644 index 0000000..c1164f8 --- /dev/null +++ b/rolling-restart.yml
@@ -0,0 +1,8 @@ +--- +- name: Perform rolling restart of edge components + hosts: ds,rmp,ms + gather_facts: no + serial: 1 + roles: + - { role: apigee-opdk-stop-components, tags: ['pre_restart', 'pre_stop', 'stop'] } + - { role: apigee-opdk-start-components, tags: ['pre_restart', 'pre_start','start'], component_start_delay: '{{ start_delay | default(0) }}' }
diff --git a/update-replication-factor.yml b/update-replication-factor.yml new file mode 100644 index 0000000..cca27e3 --- /dev/null +++ b/update-replication-factor.yml
@@ -0,0 +1,132 @@ +--- +- name: Update the ansible cache + hosts: planet + gather_facts: no + tags: ['cache'] + vars_files: + - ~/.apigee/credentials.yml + roles: + - apigee-opdk-setup-default-settings + +- name: Backup zookeeper + include: opdk-backup.yml + tags: ['backup', 'backup-zookeeper'] + vars: + component_name: 'apigee-zookeeper' + +- name: Backup cassandra + include: opdk-backup.yml + tags: ['backup', 'backup-cassandra'] + vars: + component_name: 'apigee-cassandra' + +- name: Set message processor consistencylevel=TWO + include: consistency.yml + tags: ['two'] + vars: + hosts: rmp + consistency_level: 'TWO' + property_file: 'message-processor' + +- name: Set management server consistencylevel=TWO + include: consistency.yml + tags: ['two'] + vars: + hosts: ms + consistency_level: 'TWO' + property_file: 'management-server' + +- name: Rolling restart of Cassandra, RMP and MS + include: rolling-restart.yml + tags: ['restart'] + +- name: Execute nodetool repair on Cassandra nodes after updating + include: repair.yml + tags: ['repair'] + +- name: Change cassandra replication factor + gather_facts: no + hosts: ds[0] + tags: ['update-replication-factor'] + serial: 1 + vars: + replication_factor: 6 + cassandra_keyspaces: + - auth + - cache + - devconnect + - user_settings + - apprepo + - kms + - scheduler + - ax_custom_report_model + - audit + - aries + - apimodel + - edgenotification + - analytics + - keyvaluemap + - counter + roles: + - { role: apigee-opdk-cassandra-change-replication-factor, keyspaces: '{{ cassandra_keyspaces }}' } + +- name: Execute nodetool repair on Cassandra nodes after updating + include: repair.yml + +- name: Rolling restart of Cassandra, RMP and MS + include: rolling-restart.yml + +- name: Set message processor consistencylevel=LOCAL_QUORUM + include: consistency.yml + tags: ['local-quorum'] + vars: + hosts: rmp + consistency_level: 'LOCAL_QUORUM' + property_file: 'message-processor' + +- name: Set management server consistencylevel=LOCAL_QUORUM + include: consistency.yml + tags: ['local-quorum'] + vars: + hosts: ms + consistency_level: 'LOCAL_QUORUM' + property_file: 'management-server' + +- name: Rolling restart of Cassandra, RMP and MS + include: rolling-restart.yml + +- name: Download logs and configs from dc-1-ds + include: opdk-setup-log-files.yml + vars: + hosts: dc-1-ds + tags: ['logs'] + +- name: Download logs and configs from dc-1-ms + include: opdk-setup-log-files.yml + vars: + hosts: dc-1-ms + tags: ['logs'] + +- name: Download logs and configs from dc-1-rmp + include: opdk-setup-log-files.yml + vars: + hosts: dc-1-rmp + tags: ['logs'] + +- name: Download logs and configs from dc-2-ds + include: opdk-setup-log-files.yml + vars: + hosts: dc-2-ds + tags: ['logs'] + +- name: Download logs and configs from dc-2-ms + include: opdk-setup-log-files.yml + vars: + hosts: dc-2-ms + tags: ['logs'] + +- name: Download logs and configs from dc-2-rmp + include: opdk-setup-log-files.yml + vars: + hosts: dc-2-rmp + tags: ['logs']
diff --git a/update.yml b/update.yml deleted file mode 100644 index 361edaf..0000000 --- a/update.yml +++ /dev/null
@@ -1,150 +0,0 @@ ---- -- name: Update the ansible cache - hosts: planet - gather_facts: no - tags: ['cache'] - vars_files: - - ~/.apigee/credentials.yml - roles: - - apigee-opdk-setup-default-settings - -- name: Create backup prior to doing any work - include: backup.yml - tags: - - 'backup' - -- name: Set message processor consistencylevel=TWO - hosts: rmp - gather_facts: no - serial: 1 - tags: ['rmp-cl-two'] - roles: - - { role: apigee-opdk-cassandra-consistencylevel-modifier, consistency_level: 'TWO', property_file: 'message-processor' } - -- name: Set management server consistencylevel=TWO - hosts: ms - gather_facts: no - serial: 1 - tags: ['ms-cl-two'] - roles: - - { role: apigee-opdk-cassandra-consistencylevel-modifier, consistency_level: 'TWO', property_file: 'management-server' } - -- name: Rolling restart of Cassandra, RMP and MS with consistencylevel=TWO - hosts: ds,rmp,ms - gather_facts: no - serial: 1 - roles: - - { role: apigee-opdk-stop-components, tags: ['pre_restart', 'pre_stop', 'stop', 'restart'] } - - { role: apigee-opdk-start-components, tags: ['pre_restart', 'pre_start','start', 'restart'], component_start_delay: '{{ start_delay | default(0) }}' } - -- name: Execute nodetool repair on Cassandra nodes after updating - hosts: ds - gather_facts: no - serial: 1 - roles: - - { role: apigee-opdk-cassandra-repair, tags: ['repair'] } - -- name: Change cassandra replication factor - gather_facts: no - hosts: ds[0] - serial: 1 - vars: - cassandra_keyspaces: - - auth - - cache - - devconnect - - user_settings - - apprepo - - kms - - scheduler - - ax_custom_report_model - - audit - - aries - - apimodel - - edgenotification - - analytics - - keyvaluemap - - counter - roles: - - { role: apigee-opdk-cassandra-change-replication-factor, tags: ['update'], keyspaces: '{{ cassandra_keyspaces }}' } - -- name: Execute nodetool repair on Cassandra nodes - hosts: ds - gather_facts: no - serial: 1 - roles: - - { role: apigee-opdk-cassandra-repair, tags: ['repair'] } - -- name: Rolling restart of Cassandra, RMPs and MS - hosts: ds,rmp,ms - gather_facts: no - serial: 1 - roles: - - { role: apigee-opdk-stop-components, } - - { role: apigee-opdk-start-components, component_start_delay: '{{ start_delay | default(0) }}' } - -- name: Set message processor consistencylevel=LOCAL_QUORUM - hosts: rmp - gather_facts: no - serial: 1 - tags: ['rmp-cl-local'] - roles: - - { role: apigee-opdk-cassandra-consistencylevel-modifier, consistency_level: 'LOCAL_QUORUM', property_file: 'message-processor' } - -- name: Set management server consistencylevel=LOCAL_QUORUM - hosts: ms - gather_facts: no - serial: 1 - tags: ['ms-cl-local'] - roles: - - { role: apigee-opdk-cassandra-consistencylevel-modifier, consistency_level: 'LOCAL_QUORUM', property_file: 'management-server' } - -- name: Rolling restart of Cassandra, RMP and MS with consistencylevel=LOCAL_QUORUM - hosts: ds,rmp,ms - gather_facts: no - serial: 1 - roles: - - { role: apigee-opdk-stop-components, } - - { role: apigee-opdk-start-components, component_start_delay: '{{ start_delay | default(0) }}' } - -- name: Download logs and configs from dc-1-ds - include: opdk-setup-log-files.yml - vars: - hosts: dc-1-ds - tags: - - logs - -- name: Download logs and configs from dc-1-ms - include: opdk-setup-log-files.yml - vars: - hosts: dc-1-ms - tags: - - logs - -- name: Download logs and configs from dc-1-rmp - include: opdk-setup-log-files.yml - vars: - hosts: dc-1-rmp - tags: - - logs - -- name: Download logs and configs from dc-2-ds - include: opdk-setup-log-files.yml - vars: - hosts: dc-2-ds - tags: - - logs - -- name: Download logs and configs from dc-2-ms - include: opdk-setup-log-files.yml - vars: - hosts: dc-2-ms - tags: - - logs - -- name: Download logs and configs from dc-2-rmp - include: opdk-setup-log-files.yml - vars: - hosts: dc-2-rmp - tags: - - logs