diff --git a/playbooks/roles/os_swift/defaults/main.yml b/playbooks/roles/os_swift/defaults/main.yml index 9dda635883..e1d82dce3d 100644 --- a/playbooks/roles/os_swift/defaults/main.yml +++ b/playbooks/roles/os_swift/defaults/main.yml @@ -187,3 +187,14 @@ swift_object_program_names: swift_proxy_program_names: - swift-proxy-server + +## Tunable overrides +swift_swift_conf_overrides: {} +swift_swift_dispersion_conf_overrides: {} +swift_proxy_server_conf_overrides: {} +swift_account_server_conf_overrides: {} +swift_account_server_replicator_conf_overrides: {} +swift_container_server_conf_overrides: {} +swift_container_server_replicator_conf_overrides: {} +swift_object_server_conf_overrides: {} +swift_object_server_replicator_conf_overrides: {} diff --git a/playbooks/roles/os_swift/tasks/swift_post_install.yml b/playbooks/roles/os_swift/tasks/swift_post_install.yml index fc417c2930..6034723903 100644 --- a/playbooks/roles/os_swift/tasks/swift_post_install.yml +++ b/playbooks/roles/os_swift/tasks/swift_post_install.yml @@ -14,15 +14,40 @@ # limitations under the License. - name: Copy swift config - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" + mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { 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" } + - src: "swift.conf.j2" + dest: "/etc/swift/swift.conf" + config_overrides: "{{ swift_swift_conf_overrides }}" + config_type: "ini" + - src: "swift-dispersion.conf.j2" + dest: "/etc/swift/dispersion.conf" + config_overrides: "{{ swift_swift_dispersion_conf_overrides }}" + config_type: "ini" + notify: + - Restart swift account services + - Restart swift container services + - Restart swift object services + - Restart swift proxy services + tags: + - swift-config + - swift-post-install + +- name: Copy swift config + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "{{ swift_system_user_name }}" + group: "{{ swift_system_group_name }}" + with_items: + - { src: "swift-rsyslog.conf.j2", dest: "/etc/rsyslog.d/49-swift.conf" } notify: - Restart swift account services - Restart swift container services diff --git a/playbooks/roles/os_swift/tasks/swift_proxy_hosts.yml b/playbooks/roles/os_swift/tasks/swift_proxy_hosts.yml index 921138992f..08477b9808 100644 --- a/playbooks/roles/os_swift/tasks/swift_proxy_hosts.yml +++ b/playbooks/roles/os_swift/tasks/swift_proxy_hosts.yml @@ -23,9 +23,17 @@ service_home: "{{ swift_system_home_folder }}" - name: swift proxy server configuration - template: - src: "proxy-server.conf.j2" - dest: "/etc/swift/proxy-server/proxy-server.conf" + config_template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" + group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" + with_items: + - src: "proxy-server.conf.j2" + dest: "/etc/swift/proxy-server/proxy-server.conf" + config_overrides: "{{ swift_proxy_server_conf_overrides }}" + config_type: "ini" notify: Restart swift proxy services diff --git a/playbooks/roles/os_swift/tasks/swift_storage_hosts_account.yml b/playbooks/roles/os_swift/tasks/swift_storage_hosts_account.yml index 2cf0cdae74..49ad8927ce 100644 --- a/playbooks/roles/os_swift/tasks/swift_storage_hosts_account.yml +++ b/playbooks/roles/os_swift/tasks/swift_storage_hosts_account.yml @@ -80,26 +80,36 @@ service_home: "{{ swift_system_home_folder }}" - name: "Swift account server configuration" - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "account-server.conf.j2", dest: "/etc/swift/account-server/account-server.conf" } + - src: "account-server.conf.j2" + dest: "/etc/swift/account-server/account-server.conf" + config_overrides: "{{ swift_account_server_conf_overrides }}" + config_type: "ini" notify: Restart swift account services # We only create the dedicated replicator configuration when using a dedicated replication_network - name: "Swift account server replicator configuration" - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "account-server-replicator.conf.j2", dest: "/etc/swift/account-server/account-server-replicator.conf" } + - src: "account-server-replicator.conf.j2" + dest: "/etc/swift/account-server/account-server-replicator.conf" + config_overrides: "{{ swift_account_server_replicator_conf_overrides }}" + config_type: "ini" when: > swift.replication_network is defined and swift.replication_network != swift.storage_network diff --git a/playbooks/roles/os_swift/tasks/swift_storage_hosts_container.yml b/playbooks/roles/os_swift/tasks/swift_storage_hosts_container.yml index 8a7183b9cc..7cf784ed6a 100644 --- a/playbooks/roles/os_swift/tasks/swift_storage_hosts_container.yml +++ b/playbooks/roles/os_swift/tasks/swift_storage_hosts_container.yml @@ -89,26 +89,36 @@ service_home: "{{ swift_system_home_folder }}" - name: "Swift container server configuration" - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "container-server.conf.j2", dest: "/etc/swift/container-server/container-server.conf" } + - src: "container-server.conf.j2" + dest: "/etc/swift/container-server/container-server.conf" + config_overrides: "{{ swift_container_server_conf_overrides }}" + config_type: "ini" notify: Restart swift container services # We only create the dedicated replicator configuration when using a dedicated replication_network -- name: "Swift container server configuration" - template: +- name: "Swift container server replicator configuration" + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "container-server-replicator.conf.j2", dest: "/etc/swift/container-server/container-server-replicator.conf" } + - src: "container-server-replicator.conf.j2" + dest: "/etc/swift/container-server/container-server-replicator.conf" + config_overrides: "{{ swift_container_server_replicator_conf_overrides }}" + config_type: "ini" when: > swift.replication_network is defined and swift.replication_network != swift.storage_network diff --git a/playbooks/roles/os_swift/tasks/swift_storage_hosts_object.yml b/playbooks/roles/os_swift/tasks/swift_storage_hosts_object.yml index 60a3b695c7..8d96fd8fae 100644 --- a/playbooks/roles/os_swift/tasks/swift_storage_hosts_object.yml +++ b/playbooks/roles/os_swift/tasks/swift_storage_hosts_object.yml @@ -80,26 +80,36 @@ service_home: "{{ swift_system_home_folder }}" - name: "Swift object server configuration" - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "object-server.conf.j2", dest: "/etc/swift/object-server/object-server.conf" } + - src: "object-server.conf.j2" + dest: "/etc/swift/object-server/object-server.conf" + config_overrides: "{{ swift_object_server_conf_overrides }}" + config_type: "ini" notify: Restart swift object services # We only create the dedicated replicator configuration when using a dedicated replication_network -- name: "Swift object server configuration" - template: +- name: "Swift object server replicator configuration" + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ swift_system_user_name }}" group: "{{ swift_system_group_name }}" mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "object-server-replicator.conf.j2", dest: "/etc/swift/object-server/object-server-replicator.conf" } + - src: "object-server-replicator.conf.j2" + dest: "/etc/swift/object-server/object-server-replicator.conf" + config_overrides: "{{ swift_object_server_replicator_conf_overrides }}" + config_type: "ini" when: > swift.replication_network is defined and swift.replication_network != swift.storage_network