converted utility to use repo_packages

converted rpc_support to use repo_packages
This commit is contained in:
Kevin Carter 2014-10-01 22:28:57 -05:00
parent b41fc58920
commit d083e7b535
16 changed files with 126 additions and 117 deletions

View File

@ -22,18 +22,3 @@ service_name: utility
# Only used when the lxc vg is present on the target # Only used when the lxc vg is present on the target
container_lvm_fstype: ext4 container_lvm_fstype: ext4
container_lvm_fssize: 5GB container_lvm_fssize: 5GB
service_pip_dependencies:
- python-openstackclient
- python-cinderclient
- python-glanceclient
- python-heatclient
- python-keystoneclient
- python-neutronclient
- python-novaclient
- python-swiftclient
- python-memcached
- pycrypto
container_packages:
- ruby1.9.1

View File

@ -21,6 +21,6 @@
- include: neutron-all.yml - include: neutron-all.yml
- include: cinder-all.yml - include: cinder-all.yml
- include: horizon-all.yml - include: horizon-all.yml
- include: utility.yml - include: utility-all.yml
- include: rpc-support.yml - include: rpc-support-all.yml
- include: ../infrastructure/rsyslog-config.yml - include: ../infrastructure/rsyslog-config.yml

View File

@ -13,22 +13,6 @@
# 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: Ensure rpc support packages are installed - include: rpc-support-common.yml
apt: - include: rpc-support-api.yml
pkg: "{{ item }}" - include: rpc-support-holland.yml
state: present
update_cache: yes
cache_valid_time: 600
with_items:
- vim
- linux-crashdump
- iotop
- dstat
- tcpdump
- lsof
- htop
register: rpc_support_packages
until: rpc_support_packages|success
retries: 3
tags:
- support_packages

View File

@ -13,12 +13,6 @@
# 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.
# Add all support options to all hosts
- hosts: hosts:all_containers
user: root
roles:
- rpc_support_common
# Ensure security groups and keys are within the openstack api # Ensure security groups and keys are within the openstack api
- hosts: utility[0] - hosts: utility[0]
user: root user: root
@ -40,7 +34,7 @@
- { src: "/root/.ssh/rpc_support", name: "rpc_support" } - { src: "/root/.ssh/rpc_support", name: "rpc_support" }
- { src: "/root/.ssh/rpc_support.pub", name: "rpc_support_pub" } - { src: "/root/.ssh/rpc_support.pub", name: "rpc_support_pub" }
- hosts: utility:utility[0] - hosts: utility:neutron_all:!utility[0]
user: root user: root
gather_facts: false gather_facts: false
tasks: tasks:
@ -56,11 +50,3 @@
with_items: with_items:
- { src: "/root/.ssh/rpc_support", name: "rpc_support", file_mode: "0600", dir_mode: "0755" } - { src: "/root/.ssh/rpc_support", name: "rpc_support", file_mode: "0600", dir_mode: "0755" }
- { src: "/root/.ssh/rpc_support.pub", name: "rpc_support_pub", file_mode: "0640", dir_mode: "0755" } - { src: "/root/.ssh/rpc_support.pub", name: "rpc_support_pub", file_mode: "0640", dir_mode: "0755" }
# Setup holland backup
- hosts: galera
user: root
roles:
- rpc_support_holland
vars:
holland_release: "{{ rpc_support_holland_branch|default('v1.0.10') }}"

View File

@ -0,0 +1,24 @@
---
# 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.
# Add all support options to all hosts
- hosts: hosts:all_containers
user: root
roles:
- common
- container_common
- rpc_support_common
vars_files:
- vars/repo_packages/rpc_support.yml

View File

@ -0,0 +1,25 @@
---
# 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.
# Setup holland backup
- hosts: galera
user: root
roles:
- common
- container_common
- openstack_common
- rpc_support_holland
vars_files:
- vars/repo_packages/holland.yml

View File

@ -0,0 +1,17 @@
---
# 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.
- include: utility-common.yml
- include: utility-serverspec.yml

View File

@ -0,0 +1,26 @@
---
# 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.
- hosts: utility_all
user: root
roles:
- common
- container_common
- utility_common
- openstack_openrc
- galera_client_cnf
vars_files:
- vars/config_vars/utility_config.yml
- vars/repo_packages/utility.yml

View File

@ -13,17 +13,6 @@
# 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.
- hosts: utility_all
user: root
roles:
- common
- container_common
- utility_common
- openstack_openrc
- galera_client_cnf
vars_files:
- vars/config_vars/utility_config.yml
- hosts: all_containers:!utility_all - hosts: all_containers:!utility_all
user: root user: root
roles: roles:

View File

@ -14,20 +14,20 @@
# limitations under the License. # limitations under the License.
- name: Get package from git - name: Get package from git
git: > git:
repo={{ git_repo }} repo: "{{ git_repo }}"
dest="/opt/{{ service_name }}_{{ git_install_branch | replace('/', '_') }}" dest: "{{ git_dest }}"
version={{ git_install_branch }} version: "{{ git_install_branch }}"
register: git_clone register: git_clone
ignore_errors: yes ignore_errors: yes
until: git_clone|success until: git_clone|success
retries: 5 retries: 5
- name: Get package from fallback git repo - name: Get package from fallback git repo
git: > git:
repo={{ git_fallback_repo }} repo: "{{ git_fallback_repo }}"
dest="/opt/{{ service_name }}_{{ git_install_branch | replace('/', '_') }}" dest: "{{ git_dest }}"
version={{ git_install_branch }} version: "{{ git_install_branch }}"
register: git_fallback_clone register: git_fallback_clone
when: git_clone|failed when: git_clone|failed
until: git_fallback_clone|success until: git_fallback_clone|success

View File

@ -14,12 +14,23 @@
# limitations under the License. # limitations under the License.
- name: Install service source - name: Install service source
pip: > pip:
name="/opt/{{ service_name }}_{{ git_install_branch | replace('/', '_') }}" name: "/opt/{{ service_name }}_{{ git_install_branch | replace('/', '_') }}"
extra_args="{{ pip_install_options|default('') }} --allow-all-external" extra_args: "{{ pip_install_options|default('') }} --allow-all-external"
register: pip_install register: pip_install
until: pip_install|success until: pip_install|success
retries: 5 retries: 5
async: 1800 async: 1800
delay: 5 delay: 5
poll: 5 poll: 5
- name: Install pip repo plugins
pip:
name: "{{ git_dest }}/{{ item.path }}/{{ item.package }}"
extra_args: "{{ pip_install_options|default('') }} --allow-all-external"
when: git_dest is defined and git_repo_plugins is defined
with_items: git_repo_plugins
register: pip_install
until: pip_install|success
retries: 5
delay: 10

View File

@ -13,7 +13,6 @@
# 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.
- include: support_packages.yml
- include: bashrc.yml - include: bashrc.yml
- include: histformat.yml - include: histformat.yml
- include: motd.yml - include: motd.yml

View File

@ -13,22 +13,6 @@
# 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: Ensure supporting holland packages are installed
apt:
pkg: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 600
with_items:
- mariadb-client
- xtrabackup
register: rpc_support_packages
until: rpc_support_packages|success
retries: 3
tags:
- holland_supporting_packages
- holland_all
- name: Create rpc_support backup user - name: Create rpc_support backup user
mysql_user: mysql_user:
name: "{{ item.name }}" name: "{{ item.name }}"
@ -51,31 +35,6 @@
- holland_sql_user - holland_sql_user
- holland_all - holland_all
- name: Get holland from git
git:
repo: https://github.com/holland-backup/holland
dest: "/opt/holland_{{ holland_release }}"
version: "{{ holland_release }}"
register: holland_clone
until: holland_clone|success
retries: 5
tags:
- holland_source
- holland_all
- name: Install holland source
pip:
name: "{{ item }}"
with_items:
- "mysql-python"
- "/opt/holland_{{ holland_release }}"
- "/opt/holland_{{ holland_release }}/plugins/holland.lib.common"
- "/opt/holland_{{ holland_release }}/plugins/holland.lib.mysql"
- "/opt/holland_{{ holland_release }}/plugins/holland.backup.xtrabackup"
tags:
- holland_source
- holland_all
- name: Create supporting holland directories - name: Create supporting holland directories
file: file:
state: directory state: directory
@ -93,8 +52,8 @@
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
state: link state: link
with_items: with_items:
- { src: "/opt/holland_{{ holland_release }}/config/providers", dest: "/etc/holland/providers" } - { src: "{{ git_dest }}/config/providers", dest: "/etc/holland/providers" }
- { src: "/opt/holland_{{ holland_release }}/config/backupsets", dest: "/etc/holland/backupsets" } - { src: "{{ git_dest }}/config/backupsets", dest: "/etc/holland/backupsets" }
tags: tags:
- holland_conf - holland_conf
- holland_all - holland_all

View File

@ -17,6 +17,7 @@ repo_path: "{{ pip_wheel_name }}_{{ git_install_branch | replace('/', '_') }}"
## Git Source ## Git Source
git_repo: "https://github.com/rcbops/ansible-lxc-rpc" git_repo: "https://github.com/rcbops/ansible-lxc-rpc"
git_dest: "/opt/{{ repo_path }}"
git_install_branch: master git_install_branch: master
pip_wheel_name: ansible-lxc-rpc pip_wheel_name: ansible-lxc-rpc

View File

@ -14,6 +14,7 @@
# limitations under the License. # limitations under the License.
repo_package_name: holland repo_package_name: holland
service_name: holland
repo_path: "holland_{{ git_install_branch | replace('/', '_') }}" repo_path: "holland_{{ git_install_branch | replace('/', '_') }}"

View File

@ -28,3 +28,5 @@ service_pip_dependencies:
- python-neutronclient - python-neutronclient
- python-novaclient - python-novaclient
- python-swiftclient - python-swiftclient
- python-memcached
- pycrypto