Browse Source

Add initial placement role

This patch adds the support for the placement service with
a simple functional test which hits the API (which in turn
hits the database and keystone for authorization).

Depends-On: I878e8c479d8963b339b5e1f6031f649c0f87082f
Change-Id: Iaa11a8cc4d945712b62c3b9c2cb6ad168def34eb
Guilherme Steinmüller 5 months ago
parent
commit
32c1eb8488

+ 75
- 0
.gitignore View File

@@ -0,0 +1,75 @@
1
+# Compiled source #
2
+###################
3
+*.com
4
+*.class
5
+*.dll
6
+*.exe
7
+*.o
8
+*.so
9
+*.pyc
10
+build/
11
+dist/
12
+doc/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
32
+logs/*
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
45
+Icon?
46
+ehthumbs.db
47
+Thumbs.db
48
+.eggs
49
+
50
+# User driven backup files #
51
+############################
52
+*.bak
53
+*.swp
54
+
55
+# Generated by pbr while building docs
56
+######################################
57
+AUTHORS
58
+ChangeLog
59
+
60
+# Files created by releasenotes build
61
+releasenotes/build
62
+
63
+# Test temp files
64
+tests/common
65
+tests/*.retry
66
+
67
+# Vagrant artifacts
68
+.vagrant
69
+
70
+# Git clones
71
+openstack-ansible-ops
72
+previous
73
+
74
+# Editor files
75
+.vscode

+ 127
- 0
defaults/main.yml View File

@@ -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
16
+placement_install_method: "source"
17
+
18
+# Set the package install state for distribution and pip packages
19
+# Options are 'present' and 'latest'
20
+placement_package_state: "latest"
21
+placement_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.
26
+placement_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
27
+placement_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
+
29
+placement_git_repo: https://git.openstack.org/openstack/placement
30
+placement_git_install_branch: master
31
+placement_developer_mode: false
32
+placement_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.
42
+placement_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
48
+placement_venv_tag: "{{ venv_tag | default('untagged') }}"
49
+placement_bin: "{{ _placement_bin }}"
50
+
51
+## Database info
52
+placement_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
53
+placement_galera_address: "{{ galera_address | default('127.0.0.1') }}"
54
+placement_galera_database: placement
55
+placement_galera_user: placement
56
+placement_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
57
+placement_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
58
+
59
+## Placement User / Group
60
+placement_system_user_name: placement
61
+placement_system_group_name: placement
62
+placement_system_comment: placement system user
63
+placement_system_shell: /bin/false
64
+placement_system_user_home: "/var/lib/{{ placement_system_user_name }}"
65
+
66
+# API
67
+placement_bind_address: 0.0.0.0
68
+placement_service_port: 8780
69
+
70
+# UWSGI
71
+placement_wsgi_processes_max: 16
72
+placement_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, placement_wsgi_processes_max] | min }}"
73
+placement_wsgi_threads: 1
74
+placement_wsgi_buffer_size: 65535
75
+
76
+## Service Type and Data
77
+placement_service_region: RegionOne
78
+placement_service_name: placement
79
+placement_service_proto: http
80
+placement_service_registry_proto: "{{ placement_service_proto }}"
81
+placement_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(placement_service_proto) }}"
82
+placement_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(placement_service_proto) }}"
83
+placement_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(placement_service_proto) }}"
84
+placement_service_type: placement
85
+placement_service_description: "Placement Service"
86
+placement_service_user_name: placement
87
+placement_service_project_name: service
88
+placement_service_project_domain_id: default
89
+placement_service_user_domain_id: default
90
+placement_service_publicurl: "{{ placement_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ placement_service_port }}"
91
+placement_service_internalurl: "{{ placement_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}"
92
+placement_service_adminurl: "{{ placement_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}"
93
+placement_service_in_ldap: false
94
+
95
+placement_auth_strategy: keystone
96
+
97
+## Keystone authentication middleware
98
+placement_keystone_auth_type: password
99
+placement_role_name: admin
100
+
101
+# Common pip packages
102
+placement_pip_packages:
103
+  - openstack-placement
104
+  - PyMySQL
105
+  - python-memcached
106
+  - cryptography
107
+  - uwsgi
108
+
109
+## Service Name-Group Mapping
110
+placement_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
125
+placement_api_uwsgi_ini_overrides: {}
126
+placement_api_init_overrides: {}
127
+placement_placement_conf_overrides: {}

+ 49
- 0
handlers/main.yml View File

@@ -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

+ 1
- 1
meta/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2018, Vexxhost, Inc.
2
+# Copyright 2019, VEXXHOST, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
meta/openstack-ansible.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2018, Vexxhost, Inc.
2
+# Copyright 2019, VEXXHOST, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 94
- 0
run_tests.sh View File

@@ -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 ----------------------------------------------------------------
31
+set -xeu
32
+
33
+## Vars ----------------------------------------------------------------------
34
+
35
+WORKING_DIR="$(readlink -f $(dirname $0))"
36
+OSA_PROJECT_NAME="$(sed -n 's|^project=openstack/\(.*\).git$|\1|p' $(pwd)/.gitreview)"
37
+
38
+COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
39
+TESTING_HOME=${TESTING_HOME:-$HOME}
40
+ZUUL_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.
44
+TESTING_BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' "${WORKING_DIR}/.gitreview")
45
+if [[ "${TESTING_BRANCH}" == "" ]]; then
46
+  TESTING_BRANCH="master"
47
+fi
48
+
49
+## Main ----------------------------------------------------------------------
50
+
51
+# Source distribution information
52
+source /etc/os-release || source /usr/lib/os-release
53
+
54
+# Prefer dnf over yum for CentOS.
55
+which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum'
56
+
57
+# Figure out the appropriate package install command
58
+case ${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 ;;
64
+esac
65
+
66
+# Install git so that we can clone the tests repo if git is not available
67
+which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git
68
+
69
+# Clone the tests repo for access to the common test script
70
+if [[ ! -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
90
+fi
91
+
92
+# Execute the common test script
93
+source tests/common/run_tests_common.sh
94
+

+ 66
- 0
tasks/main.yml View File

@@ -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

+ 46
- 0
tasks/placement_db_setup.yml View File

@@ -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

+ 97
- 0
tasks/placement_install.yml View File

@@ -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

+ 52
- 0
tasks/placement_install_source.yml View File

@@ -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 }}"

+ 29
- 0
tasks/placement_post_install.yml View File

@@ -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"

+ 50
- 0
tasks/placement_pre_install.yml View File

@@ -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"

+ 93
- 0
tasks/placement_service_setup.yml View File

@@ -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 }}"

+ 27
- 0
templates/placement-uwsgi.ini.j2 View File

@@ -0,0 +1,27 @@
1
+# {{ ansible_managed }}
2
+[uwsgi]
3
+uid = {{ placement_system_user_name }}
4
+gid = {{ placement_system_group_name }}
5
+
6
+{% if placement_install_method == 'source' %}
7
+virtualenv = /openstack/venvs/placement-{{ placement_venv_tag }}
8
+{% endif %}
9
+wsgi-file = {{ placement_bin }}/{{ item.wsgi_name }}
10
+http = {{ item.uwsgi_bind_address }}:{{ item.uwsgi_port }}
11
+
12
+master = true
13
+enable-threads = true
14
+processes = {{ placement_wsgi_processes }}
15
+threads = {{ placement_wsgi_threads }}
16
+exit-on-reload = false
17
+die-on-term = true
18
+lazy-apps = true
19
+add-header = Connection: close
20
+buffer-size = {{ placement_wsgi_buffer_size }}
21
+thunder-lock = true
22
+logfile-chmod = 644
23
+pidfile = /var/run/{{ item.service_name }}/{{ item.service_name }}.pid
24
+
25
+# Avoid filling up the logs with health check requests from haproxy.
26
+route-user-agent = ^osa-haproxy-healthcheck$ donotlog:
27
+

+ 22
- 0
templates/placement.conf.j2 View File

@@ -0,0 +1,22 @@
1
+# {{ ansible_managed }}
2
+
3
+[DEFAULT]
4
+log_dir = /var/log/placement
5
+
6
+[keystone_authtoken]
7
+auth_type = {{ placement_keystone_auth_type }}
8
+insecure = {{ keystone_service_internaluri_insecure | bool }}
9
+auth_url = {{ keystone_service_adminuri }}
10
+www_authenticate_uri = {{ keystone_service_publicuri }}
11
+project_domain_id = {{ placement_service_project_domain_id }}
12
+user_domain_id = {{ placement_service_user_domain_id }}
13
+project_name = {{ placement_service_project_name }}
14
+username = {{ placement_service_user_name }}
15
+password = {{ placement_service_password }}
16
+region_name = {{ keystone_service_region }}
17
+memcached_servers = {{ memcached_servers }}
18
+memcache_security_strategy = ENCRYPT
19
+memcache_secret_key = {{ memcached_encryption_key }}
20
+
21
+[placement_database]
22
+connection = 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 %}

+ 61
- 0
tests/ansible-role-requirements.yml View File

@@ -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

+ 35
- 0
tests/group_vars/all_containers.yml View File

@@ -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
+
16
+container_networks:
17
+  management_address:
18
+    address: "{{ ansible_host }}"
19
+    bridge: "br-mgmt"
20
+    interface: "eth1"
21
+    netmask: "255.255.252.0"
22
+    type: "veth"
23
+physical_host: localhost
24
+properties:
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.
29
+lxc2_container_config_list:
30
+  - 'lxc.aa_profile=lxc-openstack'
31
+
32
+lxc3_container_config_list:
33
+  - 'lxc.apparmor.profile=lxc-openstack'
34
+
35
+lxc_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) }}"

+ 19
- 0
tests/host_vars/infra1.yml View File

@@ -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
+
16
+ansible_host: 10.1.0.2
17
+ansible_become: True
18
+ansible_user: root
19
+container_name: infra1

+ 18
- 0
tests/host_vars/localhost.yml View File

@@ -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
+
16
+bridges:
17
+  - name: "br-mgmt"
18
+    ip_addr: "10.1.0.1"

+ 19
- 0
tests/host_vars/openstack1.yml View File

@@ -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
+
16
+ansible_host: 10.1.0.3
17
+ansible_become: True
18
+ansible_user: root
19
+container_name: openstack1

+ 36
- 0
tests/inventory View File

@@ -0,0 +1,36 @@
1
+[all]
2
+localhost
3
+infra1
4
+openstack1
5
+
6
+[all_containers]
7
+infra1
8
+openstack1
9
+
10
+[oslomsg_rpc_all]
11
+infra1
12
+
13
+[oslomsg_notify_all]
14
+infra1
15
+
16
+[rabbitmq_all]
17
+infra1
18
+
19
+[galera_all]
20
+infra1
21
+
22
+[service_all:children]
23
+rabbitmq_all
24
+galera_all
25
+
26
+[keystone_all]
27
+openstack1
28
+
29
+[utility_all]
30
+openstack1
31
+
32
+[placement_all:children]
33
+placement_api
34
+
35
+[placement_api]
36
+openstack1

+ 21
- 0
tests/os_placement-overrides.yml View File

@@ -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
+
16
+placement_galera_password: secret
17
+placement_service_password: secret
18
+placement_developer_mode: true
19
+placement_service_publicurl: "{{ placement_service_proto }}://{{ hostvars[groups['placement_api'][0]]['ansible_host'] }}:{{ placement_service_port }}"
20
+placement_service_internalurl: "{{ placement_service_publicurl }}"
21
+placement_service_adminurl: "{{ placement_service_publicurl }}"

+ 24
- 0
tests/test-install-placement.yml View File

@@ -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"

+ 45
- 0
tests/test-placement-functional.yml View File

@@ -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 }}"

+ 29
- 0
tests/test.yml View File

@@ -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

+ 11
- 0
tox.ini View File

@@ -95,3 +95,14 @@ commands =
95 95
     {[testenv:bashate]commands}
96 96
     {[testenv:ansible-lint]commands}
97 97
     {[testenv:ansible-syntax]commands}
98
+
99
+[testenv:functional]
100
+commands =
101
+    bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
102
+
103
+[testenv:distro_install]
104
+setenv =
105
+    {[testenv]setenv}
106
+    ANSIBLE_PARAMETERS=-e @{toxinidir}/tests/common/test-distro_install-vars.yml
107
+commands =
108
+    bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"

+ 21
- 0
vars/distro_install.yml View File

@@ -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
+
16
+placement_package_list: |-
17
+  {% set packages = (placement_distro_packages + placement_service_distro_packages) %}
18
+  {{ packages }}
19
+
20
+_placement_bin: "/usr/bin"
21
+placement_uwsgi_bin: '/usr/sbin'

+ 31
- 0
vars/main.yml View File

@@ -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
+
21
+filtered_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') }}

+ 19
- 0
vars/redhat-7.yml View File

@@ -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
+
16
+placement_distro_packages: []
17
+
18
+placement_service_distro_packages:
19
+  - openstack-placement-api

+ 21
- 0
vars/source_install.yml View File

@@ -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
+
16
+placement_package_list: |-
17
+  {% set packages = placement_distro_packages %}
18
+  {{ packages }}
19
+
20
+_placement_bin: "/openstack/venvs/placement-{{ placement_venv_tag }}/bin"
21
+placement_uwsgi_bin: "{{ _placement_bin }}"

+ 18
- 0
vars/suse.yml View File

@@ -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
+
16
+placement_distro_packages: []
17
+
18
+placement_service_distro_packages: []

+ 23
- 0
vars/ubuntu.yml View File

@@ -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
18
+cache_timeout: 600
19
+
20
+# Common apt packages
21
+placement_distro_packages: []
22
+
23
+placement_service_distro_packages: []

+ 2
- 0
zuul.d/project.yaml View File

@@ -15,5 +15,7 @@
15 15
 - project:
16 16
     templates:
17 17
       - check-requirements
18
+      - openstack-ansible-role-jobs
19
+      - openstack-ansible-role-distro_install-jobs
18 20
       - publish-openstack-docs-pti
19 21
       - release-notes-jobs-python3

Loading…
Cancel
Save