updated to use cache role
diff --git a/clean.yml b/clean.yml index 489da83..a4b3715 100644 --- a/clean.yml +++ b/clean.yml
@@ -11,10 +11,8 @@ state: absent with_items: - '~/.ansible/tmp/cache' - - '~/.ansible/tmp/ansible.log' + - '~/.ansible/tmp/log' - '~/.apigee/ssh_keys' - - '~/.apigee/logs' - - '~/.apigee/configs' - '~/.apigee/logs_configs'
diff --git a/configuration/update_cache.yml b/configuration/update_cache.yml deleted file mode 100644 index 687a78f..0000000 --- a/configuration/update_cache.yml +++ /dev/null
@@ -1,15 +0,0 @@ ---- -- name: Update ansible cache - hosts: planet - vars_files: - - ~/.apigee/credentials.yml - pre_tasks: - - name: Update core server facts - setup: - - - name: Update AWS EC2 facts if this is an AWS instance - ec2_facts: - when: "{{ ansible_bios_version | lower | search('amazon') }}" - roles: - - apigee-opdk-setup-default-settings -
diff --git a/replication_factor_update.yml b/replication_factor_update.yml deleted file mode 100644 index 96a907c..0000000 --- a/replication_factor_update.yml +++ /dev/null
@@ -1,56 +0,0 @@ ---- -- name: Update cache with server attributes - include: configuration/update_cache.yml - tags: - - cache - -- name: Rolling restart of all RMPs and MS - hosts: rmp,ms - serial: 1 - vars_files: - - ~/.apigee/credentials.yml - roles: - - { role: apigee-opdk-stop-components, tags: ['pre_restart', 'pre_stop'] } - - { role: apigee-opdk-start-components, tags: ['pre_restart', 'pre_start'], component_start_delay: '{{ start_delay | default(0) }}' } - -- name: Change cassandra replication factor - hosts: ds[0] - serial: 1 - vars_files: - - ~/.apigee/credentials.yml - 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 - serial: 1 - vars_files: - - ~/.apigee/credentials.yml - roles: - - { role: apigee-opdk-cassandra-repair, tags: ['repair'] } - -- name: Rolling restart of all RMPs and MS - hosts: rmp,ms - serial: 1 - vars_files: - - ~/.apigee/credentials.yml - roles: - - { role: apigee-opdk-stop-components, tags: ['post_restart', 'post_stop'] } - - { role: apigee-opdk-start-components, tags: ['post_restart', 'post_start'], component_start_delay: '{{ start_delay | default(0) }}' }
diff --git a/requirements.yml b/requirements.yml index 2f2c98c..4902cc9 100644 --- a/requirements.yml +++ b/requirements.yml
@@ -8,3 +8,5 @@ - src: https://github.com/carlosfrias/apigee-opdk-start-components.git - src: https://github.com/carlosfrias/apigee-opdk-setup-default-settings.git + +- src: https://github.com/carlosfrias/apigee-opdk-cache-update.git
diff --git a/update.yml b/update.yml index ff12de2..63fea72 100644 --- a/update.yml +++ b/update.yml
@@ -1,18 +1,61 @@ --- -- include: replication_factor_update.yml - vars: - hosts: dc-1-ds - opdk_region: dc-1 - tags: - - dc-1 +- name: Update the ansible cache + hosts: planet + tags: ['cache'] + vars_files: + - ~/.apigee/credentials.yml + roles: + - apigee-opdk-setup-default-settings -- include: replication_factor_update.yml + hosts: rmp,ms + serial: 1 + vars_files: + - ~/.apigee/credentials.yml + roles: + - { role: apigee-opdk-stop-components, tags: ['pre_restart', 'pre_stop'] } + - { role: apigee-opdk-start-components, tags: ['pre_restart', 'pre_start'], component_start_delay: '{{ start_delay | default(0) }}' } + +- name: Change cassandra replication factor + hosts: ds[0] + serial: 1 + vars_files: + - ~/.apigee/credentials.yml vars: - hosts: dc-2-ds - opdk_region: dc-2 - replication_factor: '{{ factor }}' - tags: - - dc-2 + 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 + serial: 1 + vars_files: + - ~/.apigee/credentials.yml + roles: + - { role: apigee-opdk-cassandra-repair, tags: ['repair'] } + +- name: Rolling restart of all RMPs and MS + hosts: rmp,ms + serial: 1 + vars_files: + - ~/.apigee/credentials.yml + roles: + - { role: apigee-opdk-stop-components, tags: ['post_restart', 'post_stop'] } + - { role: apigee-opdk-start-components, tags: ['post_restart', 'post_start'], component_start_delay: '{{ start_delay | default(0) }}' } - hosts: ms,rmp,qpid,pg serial: 1