summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore75
-rw-r--r--defaults/main.yml127
-rw-r--r--handlers/main.yml49
-rw-r--r--meta/main.yml2
-rw-r--r--meta/openstack-ansible.yml2
-rwxr-xr-xrun_tests.sh94
-rw-r--r--tasks/main.yml66
-rw-r--r--tasks/placement_db_setup.yml46
-rw-r--r--tasks/placement_install.yml97
-rw-r--r--tasks/placement_install_source.yml52
-rw-r--r--tasks/placement_post_install.yml29
-rw-r--r--tasks/placement_pre_install.yml50
-rw-r--r--tasks/placement_service_setup.yml93
-rw-r--r--templates/placement-uwsgi.ini.j227
-rw-r--r--templates/placement.conf.j222
-rw-r--r--tests/ansible-role-requirements.yml61
-rw-r--r--tests/group_vars/all_containers.yml35
-rw-r--r--tests/host_vars/infra1.yml19
-rw-r--r--tests/host_vars/localhost.yml18
-rw-r--r--tests/host_vars/openstack1.yml19
-rw-r--r--tests/inventory36
-rw-r--r--tests/os_placement-overrides.yml21
-rw-r--r--tests/test-install-placement.yml24
-rw-r--r--tests/test-placement-functional.yml45
-rw-r--r--tests/test.yml29
-rw-r--r--tox.ini11
-rw-r--r--vars/distro_install.yml21
-rw-r--r--vars/main.yml31
-rw-r--r--vars/redhat-7.yml19
-rw-r--r--vars/source_install.yml21
-rw-r--r--vars/suse.yml18
-rw-r--r--vars/ubuntu.yml23
-rw-r--r--zuul.d/project.yaml2
33 files changed, 1282 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ce47fe6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,75 @@
1# Compiled source #
2###################
3*.com
4*.class
5*.dll
6*.exe
7*.o
8*.so
9*.pyc
10build/
11dist/
12doc/build/
13
14# Packages #
15############
16# it's better to unpack these files and commit the raw source
17# git has its own built in compression methods
18*.7z
19*.dmg
20*.gz
21*.iso
22*.jar
23*.rar
24*.tar
25*.zip
26
27# Logs and databases #
28######################
29*.log
30*.sql
31*.sqlite
32logs/*
33
34# OS generated files #
35######################
36.DS_Store
37.DS_Store?
38._*
39.Spotlight-V100
40.Trashes
41.idea
42.tox
43*.sublime*
44*.egg-info
45Icon?
46ehthumbs.db
47Thumbs.db
48.eggs
49
50# User driven backup files #
51############################
52*.bak
53*.swp
54
55# Generated by pbr while building docs
56######################################
57AUTHORS
58ChangeLog
59
60# Files created by releasenotes build
61releasenotes/build
62
63# Test temp files
64tests/common
65tests/*.retry
66
67# Vagrant artifacts
68.vagrant
69
70# Git clones
71openstack-ansible-ops
72previous
73
74# Editor files
75.vscode
diff --git a/defaults/main.yml b/defaults/main.yml
new file mode 100644
index 0000000..f6999c6
--- /dev/null
+++ b/defaults/main.yml
@@ -0,0 +1,127 @@
1# Copyright 2019, VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Set installation method
16placement_install_method: "source"
17
18# Set the package install state for distribution and pip packages
19# Options are 'present' and 'latest'
20placement_package_state: "latest"
21placement_pip_package_state: "latest"
22
23# Set the host which will execute the shade modules
24# for the service setup. The host must already have
25# clouds.yaml properly configured.
26placement_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
27placement_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((placement_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
28
29placement_git_repo: https://git.openstack.org/openstack/placement
30placement_git_install_branch: master
31placement_developer_mode: false
32placement_developer_constraints:
33 - "git+{{ placement_git_repo }}@{{ placement_git_install_branch }}#egg=openstack-placement"
34
35
36# TODO(odyssey4me):
37# This can be simplified once all the roles are using
38# python_venv_build. We can then switch to using a
39# set of constraints in pip.conf inside the venv,
40# perhaps prepared by giving a giving a list of
41# constraints to the role.
42placement_pip_install_args: >-
43 {{ placement_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
44 {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }}
45 {{ pip_install_options | default('') }}
46
47# Name of the virtual env to deploy into
48placement_venv_tag: "{{ venv_tag | default('untagged') }}"
49placement_bin: "{{ _placement_bin }}"
50
51## Database info
52placement_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
53placement_galera_address: "{{ galera_address | default('127.0.0.1') }}"
54placement_galera_database: placement
55placement_galera_user: placement
56placement_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
57placement_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
58
59## Placement User / Group
60placement_system_user_name: placement
61placement_system_group_name: placement
62placement_system_comment: placement system user
63placement_system_shell: /bin/false
64placement_system_user_home: "/var/lib/{{ placement_system_user_name }}"
65
66# API
67placement_bind_address: 0.0.0.0
68placement_service_port: 8780
69
70# UWSGI
71placement_wsgi_processes_max: 16
72placement_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, placement_wsgi_processes_max] | min }}"
73placement_wsgi_threads: 1
74placement_wsgi_buffer_size: 65535
75
76## Service Type and Data
77placement_service_region: RegionOne
78placement_service_name: placement
79placement_service_proto: http
80placement_service_registry_proto: "{{ placement_service_proto }}"
81placement_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(placement_service_proto) }}"
82placement_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(placement_service_proto) }}"
83placement_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(placement_service_proto) }}"
84placement_service_type: placement
85placement_service_description: "Placement Service"
86placement_service_user_name: placement
87placement_service_project_name: service
88placement_service_project_domain_id: default
89placement_service_user_domain_id: default
90placement_service_publicurl: "{{ placement_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ placement_service_port }}"
91placement_service_internalurl: "{{ placement_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}"
92placement_service_adminurl: "{{ placement_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}"
93placement_service_in_ldap: false
94
95placement_auth_strategy: keystone
96
97## Keystone authentication middleware
98placement_keystone_auth_type: password
99placement_role_name: admin
100
101# Common pip packages
102placement_pip_packages:
103 - openstack-placement
104 - PyMySQL
105 - python-memcached
106 - cryptography
107 - uwsgi
108
109## Service Name-Group Mapping
110placement_services:
111 placement-api:
112 group: placement_api
113 service_name: placement-api
114 init_config_overrides: "{{ placement_api_init_overrides }}"
115 start_order: 1
116 wsgi_overrides: "{{ placement_api_uwsgi_ini_overrides }}"
117 wsgi_app: True
118 wsgi_name: placement-api
119 uwsgi_bind_address: "{{ placement_bind_address }}"
120 uwsgi_port: "{{ placement_service_port }}"
121 execstarts: "{{ placement_uwsgi_bin }}/uwsgi --autoload --ini /etc/uwsgi/placement-api.ini"
122 execreloads: "{{ placement_uwsgi_bin }}/uwsgi --reload /var/run/placement-api/placement-uwsgi.pid"
123
124## Tunable overrides
125placement_api_uwsgi_ini_overrides: {}
126placement_api_init_overrides: {}
127placement_placement_conf_overrides: {}
diff --git a/handlers/main.yml b/handlers/main.yml
new file mode 100644
index 0000000..b91ec2c
--- /dev/null
+++ b/handlers/main.yml
@@ -0,0 +1,49 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17- name: Stop services
18 service:
19 name: "{{ item.service_name }}"
20 enabled: yes
21 state: "stopped"
22 daemon_reload: yes
23 with_items: "{{ filtered_placement_services }}"
24 register: _stop
25 until: _stop is success
26 retries: 5
27 delay: 2
28 listen:
29 - "Restart placement services"
30 - "venv changed"
31
32- name: Start services
33 service:
34 name: "{{ item.service_name }}"
35 enabled: yes
36 state: "started"
37 daemon_reload: yes
38 with_items: "{{ filtered_placement_services }}"
39 register: _start
40 until: _start is success
41 retries: 5
42 delay: 2
43 listen:
44 - "Restart placement services"
45 - "venv changed"
46
47- meta: noop
48 listen: Manage LB
49 when: false \ No newline at end of file
diff --git a/meta/main.yml b/meta/main.yml
index 0cd8d4d..ff17dc2 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -1,5 +1,5 @@
1--- 1---
2# Copyright 2018, Vexxhost, Inc. 2# Copyright 2019, VEXXHOST, Inc.
3# 3#
4# Licensed under the Apache License, Version 2.0 (the "License"); 4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License. 5# you may not use this file except in compliance with the License.
diff --git a/meta/openstack-ansible.yml b/meta/openstack-ansible.yml
index 455263e..36c6762 100644
--- a/meta/openstack-ansible.yml
+++ b/meta/openstack-ansible.yml
@@ -1,5 +1,5 @@
1--- 1---
2# Copyright 2018, Vexxhost, Inc. 2# Copyright 2019, VEXXHOST, Inc.
3# 3#
4# Licensed under the Apache License, Version 2.0 (the "License"); 4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License. 5# you may not use this file except in compliance with the License.
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755
index 0000000..cbffb04
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,94 @@
1#!/usr/bin/env bash
2# Copyright 2015, Rackspace US, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# PURPOSE:
17# This script clones the openstack-ansible-tests repository to the
18# tests/common folder in order to be able to re-use test components
19# for role testing. This is intended to be the thinnest possible
20# shim for test execution outside of OpenStack CI.
21
22# WARNING:
23# This file is maintained in the openstack-ansible-tests repository.
24# https://git.openstack.org/cgit/openstack/openstack-ansible-tests/tree/run_tests.sh
25# If you need to modify this file, update the one in the openstack-ansible-tests
26# repository and then update this file as well. The purpose of this file is to
27# prepare the host and then execute all the tox tests.
28#
29
30## Shell Opts ----------------------------------------------------------------
31set -xeu
32
33## Vars ----------------------------------------------------------------------
34
35WORKING_DIR="$(readlink -f $(dirname $0))"
36OSA_PROJECT_NAME="$(sed -n 's|^project=openstack/\(.*\).git$|\1|p' $(pwd)/.gitreview)"
37
38COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
39TESTING_HOME=${TESTING_HOME:-$HOME}
40ZUUL_TESTS_CLONE_LOCATION="/home/zuul/src/git.openstack.org/openstack/openstack-ansible-tests"
41
42# Use .gitreview as the key to determine the appropriate
43# branch to clone for tests.
44TESTING_BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' "${WORKING_DIR}/.gitreview")
45if [[ "${TESTING_BRANCH}" == "" ]]; then
46 TESTING_BRANCH="master"
47fi
48
49## Main ----------------------------------------------------------------------
50
51# Source distribution information
52source /etc/os-release || source /usr/lib/os-release
53
54# Prefer dnf over yum for CentOS.
55which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum'
56
57# Figure out the appropriate package install command
58case ${ID,,} in
59 *suse*) pkg_mgr_cmd="zypper -n in" ;;
60 centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;;
61 ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;;
62 gentoo) pkg_mgr_cmd="emerge" ;;
63 *) echo "unsupported distribution: ${ID,,}"; exit 1 ;;
64esac
65
66# Install git so that we can clone the tests repo if git is not available
67which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git
68
69# Clone the tests repo for access to the common test script
70if [[ ! -d "${COMMON_TESTS_PATH}" ]]; then
71 # The tests repo doesn't need a clone, we can just
72 # symlink it.
73 if [[ "${OSA_PROJECT_NAME}" == "openstack-ansible-tests" ]]; then
74 ln -s "${WORKING_DIR}" "${COMMON_TESTS_PATH}"
75
76 # In zuul v3 any dependent repository is placed into
77 # /home/zuul/src/git.openstack.org, so we check to see
78 # if there is a tests checkout there already. If so, we
79 # symlink that and use it.
80 elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then
81 ln -s "${ZUUL_TESTS_CLONE_LOCATION}" "${COMMON_TESTS_PATH}"
82
83 # Otherwise we're clearly not in zuul or using a previously setup
84 # repo in some way, so just clone it from upstream.
85 else
86 git clone -b "${TESTING_BRANCH}" \
87 https://git.openstack.org/openstack/openstack-ansible-tests \
88 "${COMMON_TESTS_PATH}"
89 fi
90fi
91
92# Execute the common test script
93source tests/common/run_tests_common.sh
94
diff --git a/tasks/main.yml b/tasks/main.yml
new file mode 100644
index 0000000..b387546
--- /dev/null
+++ b/tasks/main.yml
@@ -0,0 +1,66 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: Gather variables for each operating system
17 include_vars: "{{ item }}"
18 with_first_found:
19 - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
20 - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
21 - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
22 - "{{ ansible_distribution | lower }}.yml"
23 - "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
24 - "{{ ansible_os_family | lower }}.yml"
25 tags:
26 - always
27
28- name: Fail if service was deployed using a different installation method
29 fail:
30 msg: "Switching installation methods for OpenStack services is not supported"
31 when:
32 - ansible_local is defined
33 - ansible_local.openstack_ansible is defined
34 - ansible_local.openstack_ansible.placement is defined
35 - ansible_local.openstack_ansible.placement.install_method is defined
36 - ansible_local.openstack_ansible.placement.install_method != placement_install_method
37
38- name: Gather variables for installation method
39 include_vars: "{{ placement_install_method }}_install.yml"
40 tags:
41 - always
42
43- include_tasks: placement_pre_install.yml
44 tags:
45 - placement-install
46
47- include_tasks: placement_install.yml
48 tags:
49 - placement-install
50
51- include_tasks: placement_post_install.yml
52 tags:
53 - placement-config
54
55- include_tasks: placement_db_setup.yml
56 run_once: true
57 tags:
58 - placement-config
59
60- include_tasks: placement_service_setup.yml
61 run_once: true
62 tags:
63 - placement-config
64
65- name: Flush handlers
66 meta: flush_handlers
diff --git a/tasks/placement_db_setup.yml b/tasks/placement_db_setup.yml
new file mode 100644
index 0000000..eb20b3c
--- /dev/null
+++ b/tasks/placement_db_setup.yml
@@ -0,0 +1,46 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: Create DB for service
17 mysql_db:
18 login_user: "{{ galera_root_user }}"
19 login_password: "{{ galera_root_password }}"
20 login_host: "{{ placement_galera_address }}"
21 name: "{{ placement_galera_database }}"
22 state: "present"
23 delegate_to: "{{ placement_db_setup_host }}"
24 no_log: True
25
26- name: Grant access to the DB for the service
27 mysql_user:
28 login_user: "{{ galera_root_user }}"
29 login_password: "{{ galera_root_password }}"
30 login_host: "{{ placement_galera_address }}"
31 name: "{{ placement_galera_user }}"
32 password: "{{ placement_galera_password }}"
33 host: "{{ item }}"
34 state: "present"
35 priv: "{{ placement_galera_database }}.*:ALL"
36 delegate_to: "{{ placement_db_setup_host }}"
37 with_items:
38 - "localhost"
39 - "%"
40 no_log: True
41
42- name: Perform a Placement DB sync
43 command: "{{ placement_bin }}/placement-manage db sync"
44 become: yes
45 become_user: "{{ placement_system_user_name }}"
46 changed_when: false
diff --git a/tasks/placement_install.yml b/tasks/placement_install.yml
new file mode 100644
index 0000000..ab4b4bb
--- /dev/null
+++ b/tasks/placement_install.yml
@@ -0,0 +1,97 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: Record the installation method
17 ini_file:
18 dest: "/etc/ansible/facts.d/openstack_ansible.fact"
19 section: "placement"
20 option: "install_method"
21 value: "{{ placement_install_method }}"
22
23- name: Refresh local facts to ensure the placement section is present
24 setup:
25 filter: ansible_local
26 gather_subset: "!all"
27
28- name: Install distro packages
29 package:
30 name: "{{ placement_package_list }}"
31 state: "{{ placement_package_state }}"
32 update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
33 cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
34 register: install_packages
35 until: install_packages is success
36 retries: 5
37 delay: 2
38
39- name: Install placement packages from PIP
40 include_tasks: placement_install_source.yml
41 when: placement_install_method == 'source'
42
43- name: Record the need for a service restart
44 ini_file:
45 dest: "/etc/ansible/facts.d/openstack_ansible.fact"
46 section: "placement"
47 option: "need_service_restart"
48 value: true
49 when: (install_packages | changed) or
50 ('need_service_restart' not in ansible_local['openstack_ansible']['placement'])
51
52- name: Run the systemd service role
53 include_role:
54 name: systemd_service
55 private: true
56 vars:
57 systemd_user_name: "{{ placement_system_user_name }}"
58 systemd_group_name: "{{ placement_system_group_name }}"
59 systemd_tempd_prefix: openstack
60 systemd_slice_name: placement
61 systemd_lock_path: /var/lock/placement
62 systemd_CPUAccounting: true
63 systemd_BlockIOAccounting: true
64 systemd_MemoryAccounting: true
65 systemd_TasksAccounting: true
66 systemd_services:
67 - service_name: "{{ service_var.service_name }}"
68 enabled: yes
69 state: started
70 execstarts: "{{ service_var.execstarts }}"
71 execreloads: "{{ service_var.execreloads | default([]) }}"
72 config_overrides: "{{ service_var.init_config_overrides }}"
73 with_items: "{{ filtered_placement_services }}"
74 loop_control:
75 loop_var: service_var
76 tags:
77 - placement-config
78 - systemd-service
79
80- name: Ensure uWSGI directory exists
81 file:
82 path: "/etc/uwsgi/"
83 state: directory
84 mode: "0711"
85
86- name: Apply uWSGI configuration
87 config_template:
88 src: "placement-uwsgi.ini.j2"
89 dest: "/etc/uwsgi/{{ item.service_name }}.ini"
90 mode: "0744"
91 config_overrides: "{{ item.wsgi_overrides }}"
92 config_type: ini
93 with_items: "{{ filtered_placement_services }}"
94 when: item.wsgi_app | default(False)
95 notify:
96 - Manage LB
97 - Restart placement services
diff --git a/tasks/placement_install_source.yml b/tasks/placement_install_source.yml
new file mode 100644
index 0000000..84eb59a
--- /dev/null
+++ b/tasks/placement_install_source.yml
@@ -0,0 +1,52 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# TODO(odyssey4me):
17# This can be simplified once all the roles are using
18# python_venv_build. We can then switch to using a
19# set of constraints in pip.conf inside the venv,
20# perhaps prepared by giving a giving a list of
21# constraints to the role.
22- name: Create developer mode constraint file
23 copy:
24 dest: "/opt/developer-pip-constraints.txt"
25 content: |
26 {% for item in placement_developer_constraints %}
27 {{ item }}
28 {% endfor %}
29 when: placement_developer_mode | bool
30
31- name: Ensure remote wheel building is disabled in developer mode
32 set_fact:
33 venv_build_host: "{{ ansible_hostname }}"
34 when:
35 - placement_developer_mode | bool
36
37- name: Install the python venv
38 include_role:
39 name: "python_venv_build"
40 private: yes
41 vars:
42 venv_install_destination_path: "{{ placement_bin | dirname }}"
43 venv_install_distro_package_list: "{{ placement_distro_packages }}"
44 venv_pip_install_args: "{{ placement_pip_install_args }}"
45 venv_pip_packages: "{{ placement_pip_packages }}"
46 venv_facts_when_changed:
47 - section: "placement"
48 option: "need_service_restart"
49 value: True
50 - section: "placement"
51 option: "venv_tag"
52 value: "{{ placement_venv_tag }}"
diff --git a/tasks/placement_post_install.yml b/tasks/placement_post_install.yml
new file mode 100644
index 0000000..58a0062
--- /dev/null
+++ b/tasks/placement_post_install.yml
@@ -0,0 +1,29 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: Copy placement configs
17 config_template:
18 src: "{{ item.src }}"
19 dest: "{{ item.dest }}"
20 owner: "root"
21 group: "{{ item.group|default(placement_system_group_name) }}"
22 mode: "0640"
23 config_overrides: "{{ item.config_overrides }}"
24 config_type: "{{ item.config_type }}"
25 with_items:
26 - src: "placement.conf.j2"
27 dest: "/etc/placement/placement.conf"
28 config_overrides: "{{ placement_placement_conf_overrides }}"
29 config_type: "ini"
diff --git a/tasks/placement_pre_install.yml b/tasks/placement_pre_install.yml
new file mode 100644
index 0000000..2aa9a17
--- /dev/null
+++ b/tasks/placement_pre_install.yml
@@ -0,0 +1,50 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: create the system group
17 group:
18 name: "{{ placement_system_group_name }}"
19 gid: "{{ placement_system_group_gid|default(omit) }}"
20 state: "present"
21 system: "yes"
22
23- name: Create the placement system user
24 user:
25 name: "{{ placement_system_user_name }}"
26 uid: "{{ placement_system_user_uid|default(omit) }}"
27 group: "{{ placement_system_group_name }}"
28 comment: "{{ placement_system_comment }}"
29 shell: "{{ placement_system_shell }}"
30 system: "yes"
31 createhome: "yes"
32 home: "{{ placement_system_user_home }}"
33
34- name: Create placement dir
35 file:
36 path: "{{ item.path }}"
37 state: directory
38 owner: "{{ item.owner|default(placement_system_user_name) }}"
39 group: "{{ item.group|default(placement_system_group_name) }}"
40 mode: "{{ item.mode|default('0755') }}"
41 with_items:
42 - path: "/openstack"
43 mode: "0755"
44 owner: "root"
45 group: "root"
46 - path: "/etc/placement"
47 mode: "0700"
48 - path: "{{ placement_system_user_home }}"
49 - path: "/var/log/placement"
50 mode: "0755"
diff --git a/tasks/placement_service_setup.yml b/tasks/placement_service_setup.yml
new file mode 100644
index 0000000..2ce80cc
--- /dev/null
+++ b/tasks/placement_service_setup.yml
@@ -0,0 +1,93 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# We set the python interpreter to the ansible runtime venv if
17# the delegation is to localhost so that we get access to the
18# appropriate python libraries in that venv. If the delegation
19# is to another host, we assume that it is accessible by the
20# system python instead.
21#
22- name: Setup the service
23 delegate_to: "{{ placement_service_setup_host }}"
24 vars:
25 ansible_python_interpreter: "{{ placement_service_setup_host_python_interpreter }}"
26 block:
27 - name: Add services to the keystone service catalog
28 os_keystone_service:
29 cloud: default
30 state: present
31 name: "{{ placement_service_name }}"
32 service_type: "{{ placement_service_type }}"
33 description: "{{ placement_service_description }}"
34 endpoint_type: admin
35 verify: "{{ not keystone_service_adminuri_insecure }}"
36 register: add_service
37 until: add_service is success
38 retries: 5
39 delay: 10
40
41 - name: Add service user
42 os_user:
43 cloud: default
44 state: present
45 name: "{{ placement_service_user_name }}"
46 password: "{{ placement_service_password }}"
47 domain: default
48 default_project: "{{ placement_service_project_name }}"
49 endpoint_type: admin
50 verify: "{{ not keystone_service_adminuri_insecure }}"
51 register: add_service
52 when: not placement_service_in_ldap | bool
53 until: add_service is success
54 retries: 5
55 delay: 10
56 no_log: True
57
58 - name: Add service user to admin role
59 os_user_role:
60 cloud: default
61 state: present
62 user: "{{ placement_service_user_name }}"
63 role: "{{ placement_role_name }}"
64 project: "{{ placement_service_project_name }}"
65 endpoint_type: admin
66 verify: "{{ not keystone_service_adminuri_insecure }}"
67 register: add_service
68 when: not placement_service_in_ldap | bool
69 until: add_service is success
70 retries: 5
71 delay: 10
72
73 - name: Add endpoints to keystone endpoint catalog
74 os_keystone_endpoint:
75 cloud: default
76 state: present
77 service: "{{ placement_service_name }}"
78 endpoint_interface: "{{ item.interface }}"
79 url: "{{ item.url }}"
80 region: "{{ placement_service_region }}"
81 endpoint_type: admin
82 verify: "{{ not keystone_service_adminuri_insecure }}"
83 register: add_service
84 until: add_service is success
85 retries: 5
86 delay: 10
87 with_items:
88 - interface: "public"
89 url: "{{ placement_service_publicurl }}"
90 - interface: "internal"
91 url: "{{ placement_service_internalurl }}"
92 - interface: "admin"
93 url: "{{ placement_service_adminurl }}"
diff --git a/templates/placement-uwsgi.ini.j2 b/templates/placement-uwsgi.ini.j2
new file mode 100644
index 0000000..7fd0130
--- /dev/null
+++ b/templates/placement-uwsgi.ini.j2
@@ -0,0 +1,27 @@
1# {{ ansible_managed }}
2[uwsgi]
3uid = {{ placement_system_user_name }}
4gid = {{ placement_system_group_name }}
5
6{% if placement_install_method == 'source' %}
7virtualenv = /openstack/venvs/placement-{{ placement_venv_tag }}
8{% endif %}
9wsgi-file = {{ placement_bin }}/{{ item.wsgi_name }}
10http = {{ item.uwsgi_bind_address }}:{{ item.uwsgi_port }}
11
12master = true
13enable-threads = true
14processes = {{ placement_wsgi_processes }}
15threads = {{ placement_wsgi_threads }}
16exit-on-reload = false
17die-on-term = true
18lazy-apps = true
19add-header = Connection: close
20buffer-size = {{ placement_wsgi_buffer_size }}
21thunder-lock = true
22logfile-chmod = 644
23pidfile = /var/run/{{ item.service_name }}/{{ item.service_name }}.pid
24
25# Avoid filling up the logs with health check requests from haproxy.
26route-user-agent = ^osa-haproxy-healthcheck$ donotlog:
27
diff --git a/templates/placement.conf.j2 b/templates/placement.conf.j2
new file mode 100644
index 0000000..9f8efab
--- /dev/null
+++ b/templates/placement.conf.j2
@@ -0,0 +1,22 @@
1# {{ ansible_managed }}
2
3[DEFAULT]
4log_dir = /var/log/placement
5
6[keystone_authtoken]
7auth_type = {{ placement_keystone_auth_type }}
8insecure = {{ keystone_service_internaluri_insecure | bool }}
9auth_url = {{ keystone_service_adminuri }}
10www_authenticate_uri = {{ keystone_service_publicuri }}
11project_domain_id = {{ placement_service_project_domain_id }}
12user_domain_id = {{ placement_service_user_domain_id }}
13project_name = {{ placement_service_project_name }}
14username = {{ placement_service_user_name }}
15password = {{ placement_service_password }}
16region_name = {{ keystone_service_region }}
17memcached_servers = {{ memcached_servers }}
18memcache_security_strategy = ENCRYPT
19memcache_secret_key = {{ memcached_encryption_key }}
20
21[placement_database]
22connection = mysql+pymysql://{{ placement_galera_user }}:{{ placement_galera_password }}@{{ placement_galera_address }}/{{ placement_galera_database }}?charset=utf8{% if placement_galera_use_ssl | bool %}&ssl_ca={{ placement_galera_ssl_ca_cert }}{% endif %}
diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml
new file mode 100644
index 0000000..5aeee2d
--- /dev/null
+++ b/tests/ansible-role-requirements.yml
@@ -0,0 +1,61 @@
1---
2- name: apt_package_pinning
3 src: https://git.openstack.org/openstack/openstack-ansible-apt_package_pinning
4 scm: git
5 version: master
6- name: pip_install
7 src: https://git.openstack.org/openstack/openstack-ansible-pip_install
8 scm: git
9 version: master
10- name: openstack_hosts
11 src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts
12 scm: git
13 version: master
14- name: lxc_hosts
15 src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts
16 scm: git
17 version: master
18- name: lxc_container_create
19 src: https://git.openstack.org/openstack/openstack-ansible-lxc_container_create
20 scm: git
21 version: master
22- name: galera_client
23 src: https://git.openstack.org/openstack/openstack-ansible-galera_client
24 scm: git
25 version: master
26- name: galera_server
27 src: https://git.openstack.org/openstack/openstack-ansible-galera_server
28 scm: git
29 version: master
30- name: memcached_server
31 src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
32 scm: git
33 version: master
34- name: rabbitmq_server
35 src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server
36 scm: git
37 version: master
38- name: os_keystone
39 src: https://git.openstack.org/openstack/openstack-ansible-os_keystone
40 scm: git
41 version: master
42- name: openstack_openrc
43 src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
44 scm: git
45 version: master
46- name: os_tempest
47 src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
48 scm: git
49 version: master
50- name: systemd_service
51 src: https://git.openstack.org/openstack/ansible-role-systemd_service
52 scm: git
53 version: master
54- name: systemd_mount
55 src: https://git.openstack.org/openstack/ansible-role-systemd_mount
56 scm: git
57 version: master
58- name: python_venv_build
59 src: https://git.openstack.org/openstack/ansible-role-python_venv_build
60 scm: git
61 version: master
diff --git a/tests/group_vars/all_containers.yml b/tests/group_vars/all_containers.yml
new file mode 100644
index 0000000..b6cc613
--- /dev/null
+++ b/tests/group_vars/all_containers.yml
@@ -0,0 +1,35 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16container_networks:
17 management_address:
18 address: "{{ ansible_host }}"
19 bridge: "br-mgmt"
20 interface: "eth1"
21 netmask: "255.255.252.0"
22 type: "veth"
23physical_host: localhost
24properties:
25 service_name: "{{ inventory_hostname }}"
26
27# NOTE(cloudnull): The lxc-openstack AA profile for is used to ensure general
28# container functionality typical to the integrated build.
29lxc2_container_config_list:
30 - 'lxc.aa_profile=lxc-openstack'
31
32lxc3_container_config_list:
33 - 'lxc.apparmor.profile=lxc-openstack'
34
35lxc_container_config_list: "{{ lookup('pipe', 'lxc-info --version || echo 2.0.0') is version_compare('3.0.0', 'lt') | ternary(lxc2_container_config_list, lxc3_container_config_list) }}"
diff --git a/tests/host_vars/infra1.yml b/tests/host_vars/infra1.yml
new file mode 100644
index 0000000..65bc182
--- /dev/null
+++ b/tests/host_vars/infra1.yml
@@ -0,0 +1,19 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16ansible_host: 10.1.0.2
17ansible_become: True
18ansible_user: root
19container_name: infra1
diff --git a/tests/host_vars/localhost.yml b/tests/host_vars/localhost.yml
new file mode 100644
index 0000000..b2937e9
--- /dev/null
+++ b/tests/host_vars/localhost.yml
@@ -0,0 +1,18 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16bridges:
17 - name: "br-mgmt"
18 ip_addr: "10.1.0.1"
diff --git a/tests/host_vars/openstack1.yml b/tests/host_vars/openstack1.yml
new file mode 100644
index 0000000..4173943
--- /dev/null
+++ b/tests/host_vars/openstack1.yml
@@ -0,0 +1,19 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16ansible_host: 10.1.0.3
17ansible_become: True
18ansible_user: root
19container_name: openstack1
diff --git a/tests/inventory b/tests/inventory
new file mode 100644
index 0000000..795fdc8
--- /dev/null
+++ b/tests/inventory
@@ -0,0 +1,36 @@
1[all]
2localhost
3infra1
4openstack1
5
6[all_containers]
7infra1
8openstack1
9
10[oslomsg_rpc_all]
11infra1
12
13[oslomsg_notify_all]
14infra1
15
16[rabbitmq_all]
17infra1
18
19[galera_all]
20infra1
21
22[service_all:children]
23rabbitmq_all
24galera_all
25
26[keystone_all]
27openstack1
28
29[utility_all]
30openstack1
31
32[placement_all:children]
33placement_api
34
35[placement_api]
36openstack1
diff --git a/tests/os_placement-overrides.yml b/tests/os_placement-overrides.yml
new file mode 100644
index 0000000..866a6ad
--- /dev/null
+++ b/tests/os_placement-overrides.yml
@@ -0,0 +1,21 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16placement_galera_password: secret
17placement_service_password: secret
18placement_developer_mode: true
19placement_service_publicurl: "{{ placement_service_proto }}://{{ hostvars[groups['placement_api'][0]]['ansible_host'] }}:{{ placement_service_port }}"
20placement_service_internalurl: "{{ placement_service_publicurl }}"
21placement_service_adminurl: "{{ placement_service_publicurl }}" \ No newline at end of file
diff --git a/tests/test-install-placement.yml b/tests/test-install-placement.yml
new file mode 100644
index 0000000..c680c80
--- /dev/null
+++ b/tests/test-install-placement.yml
@@ -0,0 +1,24 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- name: Install placement
17 hosts: placement_all
18 remote_user: root
19 gather_facts: true
20 any_errors_fatal: true
21 vars_files:
22 - common/test-vars.yml
23 roles:
24 - role: "os_placement" \ No newline at end of file
diff --git a/tests/test-placement-functional.yml b/tests/test-placement-functional.yml
new file mode 100644
index 0000000..06f8b6d
--- /dev/null
+++ b/tests/test-placement-functional.yml
@@ -0,0 +1,45 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16- hosts: localhost
17 gather_facts: false
18 tasks:
19 - name: Get authentication token
20 os_auth:
21 cloud: default
22
23 - name: Set facts for placement URL
24 set_fact:
25 placement_token: "{{ auth_token }}"
26 placement_url: "{{ service_catalog | json_query('[?name==`placement`].endpoints | [0][?interface==`public`].url | [0]') }}"
27
28 - name: Run simple placement request
29 register: placement_request
30 uri:
31 url: "{{ placement_url }}/resource_providers"
32 headers:
33 X-Auth-Token: "{{ placement_token }}"
34
35 - name: Log the HTTP request
36 debug:
37 var: placement_request
38
39 - name: Assert response is valid
40 assert:
41 that:
42 - placement_request.status == 200
43 - placement_request.json.resource_providers == []
44 vars:
45 ansible_python_interpreter: "{{ ansible_playbook_python }}" \ No newline at end of file
diff --git a/tests/test.yml b/tests/test.yml
new file mode 100644
index 0000000..f15382a
--- /dev/null
+++ b/tests/test.yml
@@ -0,0 +1,29 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Setup the host
17- import_playbook: common/test-setup-host.yml
18
19# Install RabbitMQ/MariaDB
20- import_playbook: common/test-install-infra.yml
21
22# Install Keystone
23- import_playbook: common/test-install-keystone.yml
24
25# Install Placement
26- import_playbook: test-install-placement.yml
27
28# Test Placement
29- import_playbook: test-placement-functional.yml \ No newline at end of file
diff --git a/tox.ini b/tox.ini
index 7f3d3c8..cde0360 100644
--- a/tox.ini
+++ b/tox.ini
@@ -95,3 +95,14 @@ commands =
95 {[testenv:bashate]commands} 95 {[testenv:bashate]commands}
96 {[testenv:ansible-lint]commands} 96 {[testenv:ansible-lint]commands}
97 {[testenv:ansible-syntax]commands} 97 {[testenv:ansible-syntax]commands}
98
99[testenv:functional]
100commands =
101 bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
102
103[testenv:distro_install]
104setenv =
105 {[testenv]setenv}
106 ANSIBLE_PARAMETERS=-e @{toxinidir}/tests/common/test-distro_install-vars.yml
107commands =
108 bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
diff --git a/vars/distro_install.yml b/vars/distro_install.yml
new file mode 100644
index 0000000..2a2b40e
--- /dev/null
+++ b/vars/distro_install.yml
@@ -0,0 +1,21 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16placement_package_list: |-
17 {% set packages = (placement_distro_packages + placement_service_distro_packages) %}
18 {{ packages }}
19
20_placement_bin: "/usr/bin"
21placement_uwsgi_bin: '/usr/sbin' \ No newline at end of file
diff --git a/vars/main.yml b/vars/main.yml
new file mode 100644
index 0000000..cf738a4
--- /dev/null
+++ b/vars/main.yml
@@ -0,0 +1,31 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17# Compile a list of the services on a host based on whether
18# the host is in the host group and the service is enabled.
19# The service list is provided in the defined start order.
20
21filtered_placement_services: |-
22 {% set services = [] %}
23 {% for key, value in placement_services.items() %}
24 {% if (value['group'] in group_names) and
25 (('condition' not in value) or
26 ('condition' in value and value['condition'])) %}
27 {% set _ = value.update({'service_key': key}) %}
28 {% set _ = services.append(value) %}
29 {% endif %}
30 {% endfor %}
31 {{ services | sort(attribute='start_order') }}
diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml
new file mode 100644
index 0000000..7a070d8
--- /dev/null
+++ b/vars/redhat-7.yml
@@ -0,0 +1,19 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16placement_distro_packages: []
17
18placement_service_distro_packages:
19 - openstack-placement-api
diff --git a/vars/source_install.yml b/vars/source_install.yml
new file mode 100644
index 0000000..c0d78f0
--- /dev/null
+++ b/vars/source_install.yml
@@ -0,0 +1,21 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16placement_package_list: |-
17 {% set packages = placement_distro_packages %}
18 {{ packages }}
19
20_placement_bin: "/openstack/venvs/placement-{{ placement_venv_tag }}/bin"
21placement_uwsgi_bin: "{{ _placement_bin }}"
diff --git a/vars/suse.yml b/vars/suse.yml
new file mode 100644
index 0000000..adaa6bd
--- /dev/null
+++ b/vars/suse.yml
@@ -0,0 +1,18 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16placement_distro_packages: []
17
18placement_service_distro_packages: [] \ No newline at end of file
diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml
new file mode 100644
index 0000000..3ccb082
--- /dev/null
+++ b/vars/ubuntu.yml
@@ -0,0 +1,23 @@
1---
2# Copyright 2019, VEXXHOST, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17## APT Cache options
18cache_timeout: 600
19
20# Common apt packages
21placement_distro_packages: []
22
23placement_service_distro_packages: [] \ No newline at end of file
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index a9056fe..fef6028 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -15,5 +15,7 @@
15- project: 15- project:
16 templates: 16 templates:
17 - check-requirements 17 - check-requirements
18 - openstack-ansible-role-jobs
19 - openstack-ansible-role-distro_install-jobs
18 - publish-openstack-docs-pti 20 - publish-openstack-docs-pti
19 - release-notes-jobs-python3 21 - release-notes-jobs-python3