Handler should only restart relevent swift services
* Adjust the handler to include a "restart" handler for each of account, container, object and proxy service groups. * Add a variable in defaults listing program names for each swift service group. * Remove the over-arching "all swift program_names" variable. * Change the storage and proxy host tasks to call the appropriate * handler. Change-Id: I25adfa152fc7a3da83ca7c12d57977eec8b51d7b Closes-Bug: #1427601
This commit is contained in:
parent
8cf39b11ff
commit
98aba34aa1
@ -127,21 +127,24 @@ swift_apt_packages:
|
||||
- python-dev
|
||||
- rsync
|
||||
|
||||
swift_program_names:
|
||||
- swift-proxy-server
|
||||
- swift-object-server
|
||||
- swift-object-auditor
|
||||
- swift-object-replicator
|
||||
- swift-object-updater
|
||||
- swift-object-server-replicator
|
||||
swift_account_program_names:
|
||||
- swift-account-server
|
||||
- swift-account-auditor
|
||||
- swift-account-replicator
|
||||
- swift-account-reaper
|
||||
|
||||
swift_container_program_names:
|
||||
- swift-container-server
|
||||
- swift-container-auditor
|
||||
- swift-container-replicator
|
||||
- swift-container-sync
|
||||
- swift-container-updater
|
||||
- swift-container-server-replicator
|
||||
- swift-account-server
|
||||
- swift-account-auditor
|
||||
- swift-account-replicator
|
||||
- swift-account-reaper
|
||||
- swift-account-server-replicator
|
||||
|
||||
swift_object_program_names:
|
||||
- swift-object-server
|
||||
- swift-object-auditor
|
||||
- swift-object-replicator
|
||||
- swift-object-updater
|
||||
|
||||
swift_proxy_program_names:
|
||||
- swift-proxy-server
|
||||
|
@ -13,13 +13,40 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Restart swift services
|
||||
- name: Restart swift account services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: "restarted"
|
||||
pattern: "{{ item }}"
|
||||
register: service_restart
|
||||
with_items: swift_program_names
|
||||
with_items: swift_account_program_names
|
||||
failed_when: false
|
||||
|
||||
- name: Restart swift container services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: "restarted"
|
||||
pattern: "{{ item }}"
|
||||
register: service_restart
|
||||
with_items: swift_container_program_names
|
||||
failed_when: false
|
||||
|
||||
- name: Restart swift object services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: "restarted"
|
||||
pattern: "{{ item }}"
|
||||
register: service_restart
|
||||
with_items: swift_object_program_names
|
||||
failed_when: false
|
||||
|
||||
- name: Restart swift proxy services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: "restarted"
|
||||
pattern: "{{ item }}"
|
||||
register: service_restart
|
||||
with_items: swift_proxy_program_names
|
||||
failed_when: false
|
||||
|
||||
- name: Restart service
|
||||
|
@ -23,7 +23,11 @@
|
||||
- { src: "swift.conf.j2", dest: "/etc/swift/swift.conf" }
|
||||
- { src: "swift-rsyslog.conf.j2", dest: "/etc/rsyslog.d/49-swift.conf" }
|
||||
- { src: "swift-dispersion.conf.j2", dest: "/etc/swift/dispersion.conf" }
|
||||
notify: Restart swift services
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
- Restart swift object services
|
||||
- Restart swift proxy services
|
||||
tags:
|
||||
- swift-config
|
||||
- swift-post-install
|
||||
|
@ -28,4 +28,4 @@
|
||||
dest: "/etc/swift/proxy-server/proxy-server.conf"
|
||||
owner: "{{ swift_system_user_name }}"
|
||||
mode: "0644"
|
||||
notify: Restart swift services
|
||||
notify: Restart swift proxy services
|
||||
|
@ -75,7 +75,7 @@
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- { src: "account-server.conf.j2", dest: "/etc/swift/account-server/account-server.conf" }
|
||||
notify: Restart swift services
|
||||
notify: Restart swift account services
|
||||
|
||||
# We only create the dedicated replicator configuration when using a dedicated replication_network
|
||||
- name: "Swift account server replicator configuration"
|
||||
@ -90,4 +90,4 @@
|
||||
when: >
|
||||
swift.replication_network is defined and
|
||||
swift.replication_network != swift.storage_network
|
||||
notify: Restart swift services
|
||||
notify: Restart swift account services
|
||||
|
@ -84,7 +84,7 @@
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- { src: "container-server.conf.j2", dest: "/etc/swift/container-server/container-server.conf" }
|
||||
notify: Restart swift services
|
||||
notify: Restart swift container services
|
||||
|
||||
# We only create the dedicated replicator configuration when using a dedicated replication_network
|
||||
- name: "Swift container server configuration"
|
||||
@ -99,4 +99,4 @@
|
||||
when: >
|
||||
swift.replication_network is defined and
|
||||
swift.replication_network != swift.storage_network
|
||||
notify: Restart swift services
|
||||
notify: Restart swift container services
|
||||
|
@ -75,7 +75,7 @@
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- { src: "object-server.conf.j2", dest: "/etc/swift/object-server/object-server.conf" }
|
||||
notify: Restart swift services
|
||||
notify: Restart swift object services
|
||||
|
||||
# We only create the dedicated replicator configuration when using a dedicated replication_network
|
||||
- name: "Swift object server configuration"
|
||||
@ -90,4 +90,4 @@
|
||||
when: >
|
||||
swift.replication_network is defined and
|
||||
swift.replication_network != swift.storage_network
|
||||
notify: Restart swift services
|
||||
notify: Restart swift object services
|
||||
|
@ -20,8 +20,7 @@
|
||||
mode: "0644"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
notify:
|
||||
- Restart swift services
|
||||
register: init_script
|
||||
tags:
|
||||
- upstart-init
|
||||
- swift-init
|
||||
@ -29,8 +28,7 @@
|
||||
- name: Reload init scripts
|
||||
shell: |
|
||||
initctl reload-configuration
|
||||
notify:
|
||||
- Restart swift services
|
||||
when: init_script|changed
|
||||
tags:
|
||||
- upstart-init
|
||||
- swift-init
|
||||
@ -39,8 +37,8 @@
|
||||
service:
|
||||
name: "{{ program_name }}"
|
||||
enabled: "yes"
|
||||
notify:
|
||||
- Restart swift services
|
||||
state: restarted
|
||||
when: init_script|changed
|
||||
tags:
|
||||
- upstart-init
|
||||
- swift-init
|
||||
|
Loading…
Reference in New Issue
Block a user