diff --git a/handlers/main.yml b/handlers/main.yml index dec9c703..65a9e0e2 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -37,10 +37,12 @@ service: name: "rsyslog" state: "restarted" + enabled: "yes" + sleep: 2 - name: Restart rsync service service: - name: "rsync" + name: "{{ swift_rsync_service_name }}" state: "restarted" enabled: "yes" sleep: 2 diff --git a/meta/main.yml b/meta/main.yml index 63df61fb..465ff333 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -31,6 +31,7 @@ galaxy_info: - openstack dependencies: - pip_install + - rsyslog_client - role: apt_package_pinning when: - ansible_pkg_mgr == 'apt' diff --git a/releasenotes/notes/os_swift-centos7-support-23846d7eafbfa957.yaml b/releasenotes/notes/os_swift-centos7-support-23846d7eafbfa957.yaml new file mode 100644 index 00000000..a654cf66 --- /dev/null +++ b/releasenotes/notes/os_swift-centos7-support-23846d7eafbfa957.yaml @@ -0,0 +1,3 @@ +--- +features: + - CentOS7/RHEL support has been added to the os_swift role. diff --git a/tasks/install-yum.yml b/tasks/install-yum.yml new file mode 100644 index 00000000..0eda2db2 --- /dev/null +++ b/tasks/install-yum.yml @@ -0,0 +1,33 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Install RDO package + yum: + pkg: "{{ rdo_package }}" + state: "present" + register: install_cloud_rdo_package + until: install_cloud_rdo_package | success + retries: 5 + delay: 2 + +- name: Install yum packages + yum: + pkg: "{{ item }}" + state: "{{ swift_package_state }}" + register: install_packages + until: install_packages|success + retries: 5 + delay: 2 + with_items: "{{ swift_distro_packages }}" diff --git a/tasks/swift_calculate_addresses.yml b/tasks/swift_calculate_addresses.yml index 3f46aa22..967c9159 100644 --- a/tasks/swift_calculate_addresses.yml +++ b/tasks/swift_calculate_addresses.yml @@ -41,6 +41,14 @@ tags: - always +- name: Gather facts for storage_bridge + setup: + filter: "{{ swift_storage_bridge }}" + when: + - swift_storage_bridge is defined + - hostvars[inventory_hostname][swift_storage_bridge] is defined + - swift_storage_address is not defined + - name: Swift storage address not found fail: msg: "{{ swift.storage_network }} not found on host, can't find storage address." @@ -96,6 +104,14 @@ tags: - always +- name: Gather facts for storage_bridge + setup: + filter: "{{ swift_replication_bridge }}" + when: + - swift_replication_bridge is defined + - hostvars[inventory_hostname][swift_replication_bridge] is defined + - swift_replication_address is not defined + - name: Swift replication address not found fail: msg: "{{ swift.replication_network }} not found on host, can't find swift_replican_address" diff --git a/tasks/swift_install.yml b/tasks/swift_install.yml index 00e21a37..08fc00c7 100644 --- a/tasks/swift_install.yml +++ b/tasks/swift_install.yml @@ -17,6 +17,10 @@ static: no when: ansible_pkg_mgr == 'apt' +- include: install-yum.yml + static: no + when: ansible_pkg_mgr == 'yum' + - name: Create developer mode constraint file copy: dest: "/opt/developer-pip-constraints.txt" diff --git a/tasks/swift_storage_hosts_setup.yml b/tasks/swift_storage_hosts_setup.yml index 581c13e9..f0fa4acd 100644 --- a/tasks/swift_storage_hosts_setup.yml +++ b/tasks/swift_storage_hosts_setup.yml @@ -43,11 +43,13 @@ mode: "0644" notify: "Restart rsync service" -- name: "Enable rsync in defaults" +# Red Hat/CentOS are enabled as part of the handler +- name: "Enable rsync service in defaults (Debian)" lineinfile: dest: "/etc/default/rsync" line: "RSYNC_ENABLE=true" regexp: "^RSYNC_ENABLE*" + when: ansible_pkg_mgr =="apt" notify: "Restart rsync service" - name: "Setup swift-recon-cron cron job" diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index fe68d49d..6a67d695 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -42,3 +42,7 @@ src: https://git.openstack.org/openstack/openstack-ansible-os_keystone scm: git version: master +- name: rsyslog_client + src: https://git.openstack.org/openstack/openstack-ansible-rsyslog_client + scm: git + version: master diff --git a/vars/debian.yml b/vars/debian.yml index 46faba49..bf31589c 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -26,3 +26,7 @@ swift_distro_packages: - python-dev - rsync - libssl-dev + +swift_syslog_user_name: syslog +swift_syslog_group_name: syslog +swift_rsync_service_name: rsync diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml new file mode 100644 index 00000000..075c7529 --- /dev/null +++ b/vars/redhat-7.yml @@ -0,0 +1,33 @@ +--- +# Copyright 2016, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +swift_distro_packages: + - curl + - gcc + - git + - liberasurecode + - liberasurecode-devel + - libffi-devel + - openssh-server + - python-devel + - rsync + - openssl-devel + - cronie + - cronie-anacron + +swift_syslog_user_name: root +swift_syslog_group_name: root +swift_rsync_service_name: rsyncd +rdo_package: "https://rdoproject.org/repos/rdo-release.rpm"