adds the config_template to swift

The change modifies the swift template tasks such that it's now
using the config_template action plugin. This change will make so that
config files can be dynamically updated, by a deployer, at run time,
without requiring the need to modify the in tree templates or defaults.

Partially implements: blueprint tunable-openstack-configuration

Change-Id: Id992937f35afa0549f9f0d0fbcf0be5e6978df57
This commit is contained in:
Kevin Carter 2015-09-14 18:21:57 -05:00
parent 235649dc78
commit 9f559457f4
No known key found for this signature in database
GPG Key ID: 69FEFFC5E2D9273F
6 changed files with 95 additions and 21 deletions

View File

@ -187,3 +187,14 @@ swift_object_program_names:
swift_proxy_program_names: swift_proxy_program_names:
- swift-proxy-server - 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: {}

View File

@ -14,15 +14,40 @@
# limitations under the License. # limitations under the License.
- name: Copy swift config - name: Copy swift config
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: with_items:
- { src: "swift.conf.j2", dest: "/etc/swift/swift.conf" } - src: "swift.conf.j2"
- { src: "swift-rsyslog.conf.j2", dest: "/etc/rsyslog.d/49-swift.conf" } dest: "/etc/swift/swift.conf"
- { src: "swift-dispersion.conf.j2", dest: "/etc/swift/dispersion.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: notify:
- Restart swift account services - Restart swift account services
- Restart swift container services - Restart swift container services

View File

@ -23,9 +23,17 @@
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- name: swift proxy server configuration - name: swift proxy server configuration
template: config_template:
src: "proxy-server.conf.j2" src: "{{ item.src }}"
dest: "/etc/swift/proxy-server/proxy-server.conf" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}"
mode: "0644" 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 notify: Restart swift proxy services

View File

@ -80,26 +80,36 @@
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- name: "Swift account server configuration" - name: "Swift account server configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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 notify: Restart swift account services
# We only create the dedicated replicator configuration when using a dedicated replication_network # We only create the dedicated replicator configuration when using a dedicated replication_network
- name: "Swift account server replicator configuration" - name: "Swift account server replicator configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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: > when: >
swift.replication_network is defined and swift.replication_network is defined and
swift.replication_network != swift.storage_network swift.replication_network != swift.storage_network

View File

@ -89,26 +89,36 @@
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- name: "Swift container server configuration" - name: "Swift container server configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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 notify: Restart swift container services
# We only create the dedicated replicator configuration when using a dedicated replication_network # We only create the dedicated replicator configuration when using a dedicated replication_network
- name: "Swift container server configuration" - name: "Swift container server replicator configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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: > when: >
swift.replication_network is defined and swift.replication_network is defined and
swift.replication_network != swift.storage_network swift.replication_network != swift.storage_network

View File

@ -80,26 +80,36 @@
service_home: "{{ swift_system_home_folder }}" service_home: "{{ swift_system_home_folder }}"
- name: "Swift object server configuration" - name: "Swift object server configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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 notify: Restart swift object services
# We only create the dedicated replicator configuration when using a dedicated replication_network # We only create the dedicated replicator configuration when using a dedicated replication_network
- name: "Swift object server configuration" - name: "Swift object server replicator configuration"
template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ swift_system_user_name }}" owner: "{{ swift_system_user_name }}"
group: "{{ swift_system_group_name }}" group: "{{ swift_system_group_name }}"
mode: "0644" mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items: 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: > when: >
swift.replication_network is defined and swift.replication_network is defined and
swift.replication_network != swift.storage_network swift.replication_network != swift.storage_network