Updating os_swift to use the Multi-Distro framework
Debian-specific vars and logic have been moved to tasks that will execute only on those distributions. Change-Id: I370621eda9e87bd19532e4e37e46097607bf4166 Implements: blueprint multi-platform-host
This commit is contained in:
parent
8382b8812a
commit
69759b2152
@ -18,7 +18,6 @@ swift_ceilometer_enabled: False
|
|||||||
|
|
||||||
## Verbosity Options
|
## Verbosity Options
|
||||||
debug: False
|
debug: False
|
||||||
cache_timeout: 600
|
|
||||||
|
|
||||||
swift_git_repo: https://git.openstack.org/openstack/swift
|
swift_git_repo: https://git.openstack.org/openstack/swift
|
||||||
swift_git_install_branch: master
|
swift_git_install_branch: master
|
||||||
@ -269,17 +268,6 @@ swift_pip_packages:
|
|||||||
- python-swiftclient
|
- python-swiftclient
|
||||||
- swift
|
- swift
|
||||||
|
|
||||||
swift_apt_packages:
|
|
||||||
- curl
|
|
||||||
- gcc
|
|
||||||
- git-core
|
|
||||||
- liberasurecode1
|
|
||||||
- liberasurecode-dev
|
|
||||||
- libffi-dev
|
|
||||||
- openssh-server
|
|
||||||
- python-dev
|
|
||||||
- rsync
|
|
||||||
|
|
||||||
swift_account_program_names:
|
swift_account_program_names:
|
||||||
- swift-account-server
|
- swift-account-server
|
||||||
- swift-account-auditor
|
- swift-account-auditor
|
||||||
|
@ -36,5 +36,7 @@ dependencies:
|
|||||||
- role: pip_install
|
- role: pip_install
|
||||||
when:
|
when:
|
||||||
- swift_developer_mode | bool
|
- swift_developer_mode | bool
|
||||||
- apt_package_pinning
|
- role: apt_package_pinning
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'apt'
|
||||||
- openstack_openrc
|
- openstack_openrc
|
||||||
|
44
tasks/install-apt.yml
Normal file
44
tasks/install-apt.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
|
||||||
|
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
|
||||||
|
#in 1.9.x or we move to 2.0 (if tested working)
|
||||||
|
- name: Check apt last update file
|
||||||
|
stat:
|
||||||
|
path: /var/cache/apt
|
||||||
|
register: apt_cache_stat
|
||||||
|
tags:
|
||||||
|
- swift-apt-packages
|
||||||
|
|
||||||
|
- name: Update apt if needed
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
|
||||||
|
tags:
|
||||||
|
- swift-apt-packages
|
||||||
|
|
||||||
|
- name: Install apt packages
|
||||||
|
apt:
|
||||||
|
pkg: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items: swift_apt_packages
|
||||||
|
tags:
|
||||||
|
- swift-install
|
||||||
|
- swift-apt-packages
|
@ -13,6 +13,15 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Gather variables for each operating system
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
|
||||||
|
- "{{ ansible_distribution | lower }}.yml"
|
||||||
|
- "{{ ansible_os_family | lower }}.yml"
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
- include: swift_pre_install.yml
|
- include: swift_pre_install.yml
|
||||||
when:
|
when:
|
||||||
- swift_do_setup | bool
|
- swift_do_setup | bool
|
||||||
|
@ -13,35 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
|
- include: install-apt.yml
|
||||||
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
|
when:
|
||||||
#in 1.9.x or we move to 2.0 (if tested working)
|
- ansible_pkg_mgr == 'apt'
|
||||||
- name: Check apt last update file
|
|
||||||
stat:
|
|
||||||
path: /var/cache/apt
|
|
||||||
register: apt_cache_stat
|
|
||||||
tags:
|
tags:
|
||||||
- swift-apt-packages
|
- install-apt
|
||||||
|
|
||||||
- name: Update apt if needed
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
|
|
||||||
tags:
|
|
||||||
- swift-apt-packages
|
|
||||||
|
|
||||||
- name: Install apt packages
|
|
||||||
apt:
|
|
||||||
pkg: "{{ item }}"
|
|
||||||
state: latest
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: swift_apt_packages
|
|
||||||
tags:
|
|
||||||
- swift-install
|
|
||||||
- swift-apt-packages
|
|
||||||
|
|
||||||
- name: Create developer mode constraint file
|
- name: Create developer mode constraint file
|
||||||
copy:
|
copy:
|
||||||
|
@ -24,10 +24,14 @@
|
|||||||
state: present
|
state: present
|
||||||
delegate_to: "{{ physical_host }}"
|
delegate_to: "{{ physical_host }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'apt'
|
||||||
- name: Ensure xfsprogs is installed on containers
|
- name: Ensure xfsprogs is installed on containers
|
||||||
apt:
|
apt:
|
||||||
name: xfsprogs
|
name: xfsprogs
|
||||||
state: present
|
state: present
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'apt'
|
||||||
- name: Openstack directory Create
|
- name: Openstack directory Create
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
|
27
vars/debian.yml
Normal file
27
vars/debian.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
cache_timeout: 600
|
||||||
|
|
||||||
|
swift_apt_packages:
|
||||||
|
- curl
|
||||||
|
- gcc
|
||||||
|
- git-core
|
||||||
|
- liberasurecode1
|
||||||
|
- liberasurecode-dev
|
||||||
|
- libffi-dev
|
||||||
|
- openssh-server
|
||||||
|
- python-dev
|
||||||
|
- rsync
|
Loading…
Reference in New Issue
Block a user